summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp43
1 files changed, 34 insertions, 9 deletions
diff --git a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
index 474f06dac..494ca6bd7 100644
--- a/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,22 +34,33 @@
namespace WebKit {
+const char* WebApplicationCacheManagerProxy::supplementName()
+{
+ return "WebApplicationCacheManagerProxy";
+}
+
PassRefPtr<WebApplicationCacheManagerProxy> WebApplicationCacheManagerProxy::create(WebContext* context)
{
return adoptRef(new WebApplicationCacheManagerProxy(context));
}
WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebContext* context)
- : m_webContext(context)
+ : WebContextSupplement(context)
{
- m_webContext->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), this);
+ context->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), this);
}
WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()
{
}
-void WebApplicationCacheManagerProxy::invalidate()
+
+void WebApplicationCacheManagerProxy::contextDestroyed()
+{
+ invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebApplicationCacheManagerProxy::processDidClose(WebProcessProxy*)
{
invalidateCallbackMap(m_arrayCallbacks);
}
@@ -59,20 +70,28 @@ bool WebApplicationCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
return m_arrayCallbacks.isEmpty();
}
-void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+void WebApplicationCacheManagerProxy::refWebContextSupplement()
+{
+ APIObject::ref();
+}
+
+void WebApplicationCacheManagerProxy::derefWebContextSupplement()
{
- didReceiveWebApplicationCacheManagerProxyMessage(connection, messageID, decoder);
+ APIObject::deref();
}
void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
{
+ if (!context())
+ return;
+
RefPtr<ArrayCallback> callback = prpCallback;
uint64_t callbackID = callback->callbackID();
m_arrayCallbacks.set(callbackID, callback.release());
// FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
- m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::GetApplicationCacheOrigins(callbackID));
+ context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::GetApplicationCacheOrigins(callbackID));
}
void WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins(const Vector<SecurityOriginData>& originDatas, uint64_t callbackID)
@@ -83,19 +102,25 @@ void WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins(const Vector
void WebApplicationCacheManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* origin)
{
+ if (!context())
+ return;
+
SecurityOriginData securityOriginData;
securityOriginData.protocol = origin->protocol();
securityOriginData.host = origin->host();
securityOriginData.port = origin->port();
// FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
- m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteEntriesForOrigin(securityOriginData));
+ context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteEntriesForOrigin(securityOriginData));
}
void WebApplicationCacheManagerProxy::deleteAllEntries()
{
+ if (!context())
+ return;
+
// FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
- m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteAllEntries());
+ context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebApplicationCacheManager::DeleteAllEntries());
}
} // namespace WebKit