Commit 871190d5 authored by andersca@apple.com's avatar andersca@apple.com

The storage manager should know the local storage directory

https://bugs.webkit.org/show_bug.cgi?id=114765

Reviewed by Beth Dakin.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::create):
(WebKit::StorageManager::setLocalStorageDirectory):
(WebKit::StorageManager::setLocalStorageDirectoryInternal):
* UIProcess/Storage/StorageManager.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::setLocalStorageDirectory):
* UIProcess/WebContext.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d90cfee3
2013-04-17 Anders Carlsson <andersca@apple.com>
The storage manager should know the local storage directory
https://bugs.webkit.org/show_bug.cgi?id=114765
Reviewed by Beth Dakin.
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::create):
(WebKit::StorageManager::setLocalStorageDirectory):
(WebKit::StorageManager::setLocalStorageDirectoryInternal):
* UIProcess/Storage/StorageManager.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::setLocalStorageDirectory):
* UIProcess/WebContext.h:
2013-04-17 Joone Hur <joone.hur@intel.com>
[EFL][AC] MiniBrowser starts with a black empty view before painting a web page
......@@ -219,6 +219,11 @@ StorageManager::~StorageManager()
{
}
void StorageManager::setLocalStorageDirectory(const String& localStorageDirectory)
{
m_queue->dispatch(bind(&StorageManager::setLocalStorageDirectoryInternal, this, localStorageDirectory.isolatedCopy()));
}
void StorageManager::createSessionStorageNamespace(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection, unsigned quotaInBytes)
{
m_queue->dispatch(bind(&StorageManager::createSessionStorageNamespaceInternal, this, storageNamespaceID, RefPtr<CoreIPC::Connection>(allowedConnection), quotaInBytes));
......@@ -341,6 +346,11 @@ void StorageManager::clear(CoreIPC::Connection* connection, uint64_t storageMapI
connection->send(Messages::StorageAreaMap::DidClear(), storageMapID);
}
void StorageManager::setLocalStorageDirectoryInternal(const String& localStorageDirectory)
{
m_localStorageDirectory = localStorageDirectory;
}
void StorageManager::createSessionStorageNamespaceInternal(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection, unsigned quotaInBytes)
{
ASSERT(!m_sessionStorageNamespaces.contains(storageNamespaceID));
......
......@@ -43,6 +43,8 @@ public:
static PassRefPtr<StorageManager> create();
~StorageManager();
void setLocalStorageDirectory(const String&);
void createSessionStorageNamespace(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection, unsigned quotaInBytes);
void destroySessionStorageNamespace(uint64_t storageNamespaceID);
void setAllowedSessionStorageNamespaceConnection(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection);
......@@ -66,6 +68,8 @@ private:
void removeItem(CoreIPC::Connection*, uint64_t storageMapID, uint64_t sourceStorageAreaID, const String& key, const String& urlString);
void clear(CoreIPC::Connection*, uint64_t storageMapID, uint64_t sourceStorageAreaID, const String& urlString);
void setLocalStorageDirectoryInternal(const String&);
void createSessionStorageNamespaceInternal(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection, unsigned quotaInBytes);
void destroySessionStorageNamespaceInternal(uint64_t storageNamespaceID);
void setAllowedSessionStorageNamespaceConnectionInternal(uint64_t storageNamespaceID, CoreIPC::Connection* allowedConnection);
......@@ -78,6 +82,8 @@ private:
RefPtr<WorkQueue> m_queue;
String m_localStorageDirectory;
class SessionStorageNamespace;
HashMap<uint64_t, RefPtr<SessionStorageNamespace> > m_sessionStorageNamespaces;
......
......@@ -196,6 +196,8 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
#ifndef NDEBUG
webContextCounter.increment();
#endif
m_storageManager->setLocalStorageDirectory(localStorageDirectory());
}
#if !PLATFORM(MAC)
......@@ -1048,6 +1050,12 @@ String WebContext::iconDatabasePath() const
return platformDefaultIconDatabasePath();
}
void WebContext::setLocalStorageDirectory(const String& directory)
{
m_overrideLocalStorageDirectory = directory;
m_storageManager->setLocalStorageDirectory(localStorageDirectory());
}
String WebContext::localStorageDirectory() const
{
if (!m_overrideLocalStorageDirectory.isEmpty())
......
......@@ -235,7 +235,7 @@ public:
void setDatabaseDirectory(const String& dir) { m_overrideDatabaseDirectory = dir; }
void setIconDatabasePath(const String&);
String iconDatabasePath() const;
void setLocalStorageDirectory(const String& dir) { m_overrideLocalStorageDirectory = dir; }
void setLocalStorageDirectory(const String&);
void setDiskCacheDirectory(const String& dir) { m_overrideDiskCacheDirectory = dir; }
void setCookieStorageDirectory(const String& dir) { m_overrideCookieStorageDirectory = dir; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment