- Persist localStorage data across sessions when a cache path is specified (issue #139).

- Add a localStorage test to cefclient.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@140 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2010-11-17 17:28:32 +00:00
parent 6ad535823a
commit 3dd54c536c
23 changed files with 1035 additions and 14 deletions

View File

@ -6,6 +6,14 @@
#ifndef _BROWSER_WEBKIT_INIT_H
#define _BROWSER_WEBKIT_INIT_H
#include "browser_appcache_system.h"
#include "browser_database_system.h"
#include "browser_file_system.h"
#include "browser_resource_loader_bridge.h"
#include "browser_webblobregistry_impl.h"
#include "browser_webcookiejar_impl.h"
#include "browser_webstoragenamespace_impl.h"
#include "base/file_util.h"
#include "base/metrics/stats_counters.h"
#include "base/path_service.h"
@ -35,12 +43,6 @@
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitclient_impl.h"
#include "browser_appcache_system.h"
#include "browser_database_system.h"
#include "browser_file_system.h"
#include "browser_resource_loader_bridge.h"
#include "browser_webblobregistry_impl.h"
#include "browser_webcookiejar_impl.h"
class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
@ -193,6 +195,12 @@ class BrowserWebKitInit : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
const WebKit::WebString& path, unsigned quota) {
if (BrowserWebStorageNamespaceImpl::IsStorageActive()) {
// Use the localStorage implementation that writes data to disk.
return new BrowserWebStorageNamespaceImpl(DOM_STORAGE_LOCAL);
}
// Use the default localStorage implementation.
return WebKit::WebStorageNamespace::createLocalStorageNamespace(path,
WebKit::WebStorageNamespace::m_localStorageQuota);
}