Bug 49605 - Make WebPageProxy::decidePolicyForMIMEType a tad synchronous
Summary: Make WebPageProxy::decidePolicyForMIMEType a tad synchronous
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-16 10:47 PST by Anders Carlsson
Modified: 2010-11-16 11:02 PST (History)
0 users

See Also:


Attachments
Patch (7.12 KB, patch)
2010-11-16 10:49 PST, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (8.65 KB, patch)
2010-11-16 10:56 PST, Anders Carlsson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2010-11-16 10:47:32 PST
Make WebPageProxy::decidePolicyForMIMEType a tad synchronous
Comment 1 Anders Carlsson 2010-11-16 10:49:31 PST
Created attachment 74010 [details]
Patch
Comment 2 Anders Carlsson 2010-11-16 10:56:16 PST
Created attachment 74012 [details]
Patch
Comment 3 Sam Weinig 2010-11-16 10:57:49 PST
Comment on attachment 74012 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=74012&action=review

> WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:533
>  
> -    webPage->send(Messages::WebPageProxy::DecidePolicyForMIMEType(m_frame->frameID(), MIMEType, url, listenerID));
> +    bool receivedPolicyAction;
> +    uint64_t policyAction;
> +    uint64_t downloadID;
> +    if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForMIMEType(m_frame->frameID(), MIMEType, url, listenerID), Messages::WebPageProxy::DecidePolicyForMIMEType::Reply(receivedPolicyAction, policyAction, downloadID)))
> +        return;
> +
> +    if (receivedPolicyAction)
> +        m_frame->didReceivePolicyDecision(listenerID, static_cast<PolicyAction>(policyAction), downloadID);

I think this deserves a comment indicating why this needs to be sync for now and how we may be able to mitigate this issue in the future (if that is desired).
Comment 4 Anders Carlsson 2010-11-16 11:02:54 PST
Committed r72122: <http://trac.webkit.org/changeset/72122>