Changeset 70585 in webkit
- Timestamp:
- Oct 26, 2010 4:05:31 PM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70584 r70585 1 2010-10-26 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Pass a downloadID to the web process whenever a download is requested 6 https://bugs.webkit.org/show_bug.cgi?id=48380 7 8 * UIProcess/WebContext.cpp: 9 (WebKit::WebContext::generateDownloadID): 10 Generate a unique download ID. 11 12 * UIProcess/WebPageProxy.cpp: 13 (WebKit::WebPageProxy::receivedPolicyDecision): 14 Pass along a download ID if needed. 15 16 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 17 (WebKit::WebFrameLoaderClient::startDownload): 18 Call the web frame member function. 19 20 * WebProcess/WebPage/WebFrame.cpp: 21 (WebKit::WebFrame::WebFrame): 22 Initialize m_policyDownloadID. 23 24 (WebKit::WebFrame::invalidatePolicyListener): 25 Reset m_policyDownloadID. 26 27 (WebKit::WebFrame::didReceivePolicyDecision): 28 Set m_policyDownloadID. 29 30 (WebKit::WebFrame::startDownload): 31 Assert that m_policyDownloadID is not zero. 32 33 * WebProcess/WebPage/WebPage.cpp: 34 (WebKit::WebPage::didReceivePolicyDecision): 35 Pass along the download ID. 36 37 * WebProcess/WebPage/WebPage.messages.in: 38 Add the download ID. 39 1 40 2010-10-26 Alexey Proskuryakov <ap@apple.com> 2 41 -
trunk/WebKit2/UIProcess/WebContext.cpp
r70568 r70585 385 385 } 386 386 387 uint64_t WebContext::generateDownloadID() 388 { 389 static uint64_t uniqueDownloadID = 0; 390 return ++uniqueDownloadID; 391 } 392 387 393 void WebContext::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) 388 394 { -
trunk/WebKit2/UIProcess/WebContext.h
r70357 r70585 120 120 #endif 121 121 122 // Downloads. 123 uint64_t generateDownloadID(); 124 122 125 private: 123 126 WebContext(ProcessModel, const String& injectedBundlePath); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r70584 r70585 446 446 #endif 447 447 448 void WebPageProxy::receivedPolicyDecision(WebCore::PolicyAction action, WebFrameProxy* frame, uint64_t listenerID) 449 { 450 if (!isValid()) 451 return; 452 453 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action), m_pageID); 448 void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID) 449 { 450 if (!isValid()) 451 return; 452 453 uint64_t downloadID = 0; 454 if (action == PolicyDownload) 455 downloadID = pageNamespace()->context()->generateDownloadID(); 456 457 process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID); 454 458 } 455 459 -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r70584 r70585 658 658 } 659 659 660 void WebFrameLoaderClient::startDownload(const ResourceRequest& )661 { 662 notImplemented();660 void WebFrameLoaderClient::startDownload(const ResourceRequest& request) 661 { 662 m_frame->startDownload(request); 663 663 } 664 664 -
trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp
r70548 r70585 110 110 , m_policyListenerID(0) 111 111 , m_policyFunction(0) 112 , m_policyDownloadID(0) 112 113 , m_frameLoaderClient(this) 113 114 , m_loadListener(0) … … 178 179 return; 179 180 181 m_policyDownloadID = 0; 180 182 m_policyListenerID = 0; 181 183 m_policyFunction = 0; 182 184 } 183 185 184 void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action )186 void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action, uint64_t downloadID) 185 187 { 186 188 if (!m_coreFrame) … … 199 201 invalidatePolicyListener(); 200 202 203 m_policyDownloadID = downloadID; 204 201 205 (m_coreFrame->loader()->policyChecker()->*function)(action); 206 } 207 208 void WebFrame::startDownload(const WebCore::ResourceRequest&) 209 { 210 ASSERT(m_policyDownloadID); 211 212 m_policyDownloadID = 0; 202 213 } 203 214 -
trunk/WebKit2/WebProcess/WebPage/WebFrame.h
r70548 r70585 68 68 uint64_t setUpPolicyListener(WebCore::FramePolicyFunction); 69 69 void invalidatePolicyListener(); 70 void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction); 70 void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t downloadID); 71 72 void startDownload(const WebCore::ResourceRequest&); 71 73 72 74 String source() const; … … 117 119 uint64_t m_policyListenerID; 118 120 WebCore::FramePolicyFunction m_policyFunction; 121 uint64_t m_policyDownloadID; 119 122 120 123 WebFrameLoaderClient m_frameLoaderClient; -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r70564 r70585 645 645 } 646 646 647 void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction )647 void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID) 648 648 { 649 649 WebFrame* frame = WebProcess::shared().webFrame(frameID); 650 650 if (!frame) 651 651 return; 652 frame->didReceivePolicyDecision(listenerID, static_cast< WebCore::PolicyAction>(policyAction));652 frame->didReceivePolicyDecision(listenerID, static_cast<PolicyAction>(policyAction), downloadID); 653 653 } 654 654 -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r70504 r70585 221 221 void updatePreferences(const WebPreferencesStore&); 222 222 223 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction );223 void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID); 224 224 void setCustomUserAgent(const String&); 225 225 -
trunk/WebKit2/WebProcess/WebPage/WebPage.messages.in
r70097 r70585 44 44 StopLoading() 45 45 46 DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction )46 DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID) 47 47 48 48 GetRenderTreeExternalRepresentation(uint64_t callbackID)
Note: See TracChangeset
for help on using the changeset viewer.