[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 14:59:11 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e017aa45444df1cb2ad53501446e8f0888f4ad1c
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 26 23:05:31 2010 +0000
Pass a downloadID to the web process whenever a download is requested
https://bugs.webkit.org/show_bug.cgi?id=48380
Reviewed by Sam Weinig.
* UIProcess/WebContext.cpp:
(WebKit::WebContext::generateDownloadID):
Generate a unique download ID.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
Pass along a download ID if needed.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::startDownload):
Call the web frame member function.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::WebFrame):
Initialize m_policyDownloadID.
(WebKit::WebFrame::invalidatePolicyListener):
Reset m_policyDownloadID.
(WebKit::WebFrame::didReceivePolicyDecision):
Set m_policyDownloadID.
(WebKit::WebFrame::startDownload):
Assert that m_policyDownloadID is not zero.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
Pass along the download ID.
* WebProcess/WebPage/WebPage.messages.in:
Add the download ID.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 175cf94..cc607c6 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,42 @@
+2010-10-26 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Pass a downloadID to the web process whenever a download is requested
+ https://bugs.webkit.org/show_bug.cgi?id=48380
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::generateDownloadID):
+ Generate a unique download ID.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::receivedPolicyDecision):
+ Pass along a download ID if needed.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::startDownload):
+ Call the web frame member function.
+
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::WebFrame):
+ Initialize m_policyDownloadID.
+
+ (WebKit::WebFrame::invalidatePolicyListener):
+ Reset m_policyDownloadID.
+
+ (WebKit::WebFrame::didReceivePolicyDecision):
+ Set m_policyDownloadID.
+
+ (WebKit::WebFrame::startDownload):
+ Assert that m_policyDownloadID is not zero.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::didReceivePolicyDecision):
+ Pass along the download ID.
+
+ * WebProcess/WebPage/WebPage.messages.in:
+ Add the download ID.
+
2010-10-26 Alexey Proskuryakov <ap at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 86ca6f4..5547098 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -384,6 +384,12 @@ void WebContext::setCacheModel(CacheModel cacheModel)
m_process->send(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel)), 0);
}
+uint64_t WebContext::generateDownloadID()
+{
+ static uint64_t uniqueDownloadID = 0;
+ return ++uniqueDownloadID;
+}
+
void WebContext::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
switch (messageID.get<WebContextMessage::Kind>()) {
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 6ff5b3f..1352f58 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -119,6 +119,9 @@ public:
void setShouldPaintNativeControls(bool);
#endif
+ // Downloads.
+ uint64_t generateDownloadID();
+
private:
WebContext(ProcessModel, const String& injectedBundlePath);
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index ccba216..da24051 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -445,12 +445,16 @@ void WebPageProxy::handleTouchEvent(const WebTouchEvent& event)
}
#endif
-void WebPageProxy::receivedPolicyDecision(WebCore::PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
+void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy* frame, uint64_t listenerID)
{
if (!isValid())
return;
- process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action), m_pageID);
+ uint64_t downloadID = 0;
+ if (action == PolicyDownload)
+ downloadID = pageNamespace()->context()->generateDownloadID();
+
+ process()->send(Messages::WebPage::DidReceivePolicyDecision(frame->frameID(), listenerID, action, downloadID), m_pageID);
}
void WebPageProxy::setCustomUserAgent(const String& userAgent)
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 9f69584..e2e2c81 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -657,9 +657,9 @@ void WebFrameLoaderClient::setMainFrameDocumentReady(bool)
notImplemented();
}
-void WebFrameLoaderClient::startDownload(const ResourceRequest&)
+void WebFrameLoaderClient::startDownload(const ResourceRequest& request)
{
- notImplemented();
+ m_frame->startDownload(request);
}
void WebFrameLoaderClient::willChangeTitle(DocumentLoader*)
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.cpp b/WebKit2/WebProcess/WebPage/WebFrame.cpp
index e36e255..c6f3905 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -109,6 +109,7 @@ WebFrame::WebFrame()
: m_coreFrame(0)
, m_policyListenerID(0)
, m_policyFunction(0)
+ , m_policyDownloadID(0)
, m_frameLoaderClient(this)
, m_loadListener(0)
, m_frameID(generateFrameID())
@@ -177,11 +178,12 @@ void WebFrame::invalidatePolicyListener()
if (!m_policyListenerID)
return;
+ m_policyDownloadID = 0;
m_policyListenerID = 0;
m_policyFunction = 0;
}
-void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action)
+void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action, uint64_t downloadID)
{
if (!m_coreFrame)
return;
@@ -198,9 +200,18 @@ void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action
invalidatePolicyListener();
+ m_policyDownloadID = downloadID;
+
(m_coreFrame->loader()->policyChecker()->*function)(action);
}
+void WebFrame::startDownload(const WebCore::ResourceRequest&)
+{
+ ASSERT(m_policyDownloadID);
+
+ m_policyDownloadID = 0;
+}
+
String WebFrame::source() const
{
if (!m_coreFrame)
diff --git a/WebKit2/WebProcess/WebPage/WebFrame.h b/WebKit2/WebProcess/WebPage/WebFrame.h
index bd13797..fcc640c 100644
--- a/WebKit2/WebProcess/WebPage/WebFrame.h
+++ b/WebKit2/WebProcess/WebPage/WebFrame.h
@@ -67,7 +67,9 @@ public:
uint64_t setUpPolicyListener(WebCore::FramePolicyFunction);
void invalidatePolicyListener();
- void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction);
+ void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t downloadID);
+
+ void startDownload(const WebCore::ResourceRequest&);
String source() const;
@@ -116,6 +118,7 @@ private:
uint64_t m_policyListenerID;
WebCore::FramePolicyFunction m_policyFunction;
+ uint64_t m_policyDownloadID;
WebFrameLoaderClient m_frameLoaderClient;
LoadListener* m_loadListener;
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 8a9ca20..7242293 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -644,12 +644,12 @@ void WebPage::setIsInWindow(bool isInWindow)
}
}
-void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction)
+void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
{
WebFrame* frame = WebProcess::shared().webFrame(frameID);
if (!frame)
return;
- frame->didReceivePolicyDecision(listenerID, static_cast<WebCore::PolicyAction>(policyAction));
+ frame->didReceivePolicyDecision(listenerID, static_cast<PolicyAction>(policyAction), downloadID);
}
void WebPage::show()
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index 4bf2e7f..8083b0b 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -220,7 +220,7 @@ private:
void platformPreferencesDidChange(const WebPreferencesStore&);
void updatePreferences(const WebPreferencesStore&);
- void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction);
+ void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID);
void setCustomUserAgent(const String&);
#if PLATFORM(MAC)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.messages.in b/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 2d2523c..ff2f5bd 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -43,7 +43,7 @@ messages -> WebPage {
Reload(bool reloadFromOrigin)
StopLoading()
- DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction)
+ DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID)
GetRenderTreeExternalRepresentation(uint64_t callbackID)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list