summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.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/WebProcess/ApplicationCache/WebApplicationCacheManager.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/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp')
-rw-r--r--Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp37
1 files changed, 13 insertions, 24 deletions
diff --git a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
index 0bdfb0132..484790402 100644
--- a/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
+++ b/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.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
@@ -26,10 +26,11 @@
#include "config.h"
#include "WebApplicationCacheManager.h"
-#include "MessageID.h"
+#include "ChildProcess.h"
#include "SecurityOriginData.h"
+#include "WebApplicationCacheManagerMessages.h"
#include "WebApplicationCacheManagerProxyMessages.h"
-#include "WebProcess.h"
+#include "WebCoreArgumentCoders.h"
#include <WebCore/ApplicationCache.h>
#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/SecurityOrigin.h>
@@ -39,34 +40,28 @@ using namespace WebCore;
namespace WebKit {
-WebApplicationCacheManager& WebApplicationCacheManager::shared()
+const char* WebApplicationCacheManager::supplementName()
{
- static WebApplicationCacheManager& shared = *new WebApplicationCacheManager;
- return shared;
+ return "WebApplicationCacheManager";
}
-WebApplicationCacheManager::WebApplicationCacheManager()
+WebApplicationCacheManager::WebApplicationCacheManager(ChildProcess* childProcess)
+ : m_childProcess(childProcess)
{
-}
-
-void WebApplicationCacheManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
- didReceiveWebApplicationCacheManagerMessage(connection, messageID, decoder);
+ m_childProcess->addMessageReceiver(Messages::WebApplicationCacheManager::messageReceiverName(), this);
}
void WebApplicationCacheManager::getApplicationCacheOrigins(uint64_t callbackID)
{
- WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
-
- HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash> origins;
+ HashSet<RefPtr<SecurityOrigin>> origins;
cacheStorage().getOriginsWithCache(origins);
Vector<SecurityOriginData> identifiers;
identifiers.reserveCapacity(origins.size());
- HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator end = origins.end();
- HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator i = origins.begin();
+ HashSet<RefPtr<SecurityOrigin>>::iterator end = origins.end();
+ HashSet<RefPtr<SecurityOrigin>>::iterator i = origins.begin();
for (; i != end; ++i) {
RefPtr<SecurityOrigin> origin = *i;
@@ -78,13 +73,11 @@ void WebApplicationCacheManager::getApplicationCacheOrigins(uint64_t callbackID)
identifiers.uncheckedAppend(originData);
}
- WebProcess::shared().connection()->send(Messages::WebApplicationCacheManagerProxy::DidGetApplicationCacheOrigins(identifiers, callbackID), 0);
+ m_childProcess->send(Messages::WebApplicationCacheManagerProxy::DidGetApplicationCacheOrigins(identifiers, callbackID), 0);
}
void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData& originData)
{
- WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
-
RefPtr<SecurityOrigin> origin = SecurityOrigin::create(originData.protocol, originData.host, originData.port);
if (!origin)
return;
@@ -94,15 +87,11 @@ void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData
void WebApplicationCacheManager::deleteAllEntries()
{
- WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
-
cacheStorage().deleteAllEntries();
}
void WebApplicationCacheManager::setAppCacheMaximumSize(uint64_t size)
{
- WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
-
cacheStorage().setMaximumSize(size);
}