summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebContext.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
commitcfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch)
tree24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebKit2/UIProcess/WebContext.cpp
parent69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff)
downloadqtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebKit2/UIProcess/WebContext.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebContext.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/WebKit2/UIProcess/WebContext.cpp b/Source/WebKit2/UIProcess/WebContext.cpp
index 56a017c6f..8ddc93d83 100644
--- a/Source/WebKit2/UIProcess/WebContext.cpp
+++ b/Source/WebKit2/UIProcess/WebContext.cpp
@@ -100,6 +100,9 @@ PassRefPtr<WebContext> WebContext::create(const String& injectedBundlePath)
JSC::initializeThreading();
WTF::initializeMainThread();
RunLoop::initializeMainRunLoop();
+#if PLATFORM(MAC)
+ WebContext::initializeProcessSuppressionSupport();
+#endif
return adoptRef(new WebContext(ProcessModelSharedSecondaryProcess, injectedBundlePath));
}
@@ -136,7 +139,6 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
#endif
{
addMessageReceiver(Messages::WebContext::messageReceiverName(), this);
- addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), this);
addMessageReceiver(CoreIPC::MessageKindTraits<WebContextLegacyMessage::Kind>::messageReceiverName(), this);
// NOTE: These sub-objects must be initialized after m_messageReceiverMap..
@@ -498,7 +500,7 @@ void WebContext::processDidFinishLaunching(WebProcessProxy* process)
if (m_memorySamplerEnabled) {
SandboxExtension::Handle sampleLogSandboxHandle;
double now = WTF::currentTime();
- String sampleLogFilePath = String::format("WebProcess%llu", static_cast<unsigned long long>(now));
+ String sampleLogFilePath = String::format("WebProcess%llupid%d", static_cast<unsigned long long>(now), process->processIdentifier());
sampleLogFilePath = SandboxExtension::createHandleForTemporaryFile(sampleLogFilePath, SandboxExtension::WriteOnly, sampleLogSandboxHandle);
process->send(Messages::WebProcess::StartMemorySampler(sampleLogSandboxHandle, sampleLogFilePath, m_memorySamplerInterval), 0);
@@ -762,6 +764,7 @@ DownloadProxy* WebContext::createDownloadProxy()
{
RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
m_downloads.set(downloadProxy->downloadID(), downloadProxy);
+ addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID(), this);
return downloadProxy.get();
}
@@ -770,6 +773,7 @@ void WebContext::downloadFinished(DownloadProxy* downloadProxy)
ASSERT(m_downloads.contains(downloadProxy->downloadID()));
downloadProxy->invalidate();
+ removeMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID());
m_downloads.remove(downloadProxy->downloadID());
}
@@ -790,6 +794,16 @@ void WebContext::addMessageReceiver(CoreIPC::StringReference messageReceiverName
m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
}
+void WebContext::addMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID, CoreIPC::MessageReceiver* messageReceiver)
+{
+ m_messageReceiverMap.addMessageReceiver(messageReceiverName, destinationID, messageReceiver);
+}
+
+void WebContext::removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID)
+{
+ m_messageReceiverMap.removeMessageReceiver(messageReceiverName, destinationID);
+}
+
bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
return m_messageReceiverMap.dispatchMessage(connection, messageID, decoder);