summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:44:40 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:44:40 +0000
commitc61cc652f61fe89b5b1ccb7156896ba11cc0c7f1 (patch)
tree8f159443ffcb4cfad6ab1b64a6cdf70b297428c9
parentf244388daae810a179fe229a6da4a33344b68fa3 (diff)
downloadchromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.zip
chromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.tar.gz
chromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.tar.bz2
First half of http://codereview.chromium.org/274014/show
This fixes storage events in single process mode, fixes a bug due to the glue/webkitclient_impl not being updated when I introduced quota support, introduces a params struct for storage events, and is general cleanup. Submitting this first since the change to add the url param made things bigger than I liked. TBR=darin TEST=none BUG=25427 Review URL: http://codereview.chromium.org/348071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30945 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/in_process_webkit/browser_webkitclient_impl.cc2
-rw-r--r--chrome/browser/in_process_webkit/browser_webkitclient_impl.h2
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc58
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h17
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_uitest.cc16
-rw-r--r--chrome/common/render_messages.h52
-rw-r--r--chrome/common/render_messages_internal.h8
-rw-r--r--chrome/renderer/render_thread.cc13
-rw-r--r--chrome/renderer/render_thread.h5
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.cc14
-rw-r--r--chrome/renderer/renderer_webkitclient_impl.h4
-rw-r--r--chrome/worker/worker_webkitclient_impl.cc22
-rw-r--r--chrome/worker/worker_webkitclient_impl.h7
-rw-r--r--webkit/glue/webkitclient_impl.cc18
-rw-r--r--webkit/glue/webkitclient_impl.h6
15 files changed, 152 insertions, 92 deletions
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
index ec893fb..e4105f6 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.cc
@@ -95,7 +95,7 @@ WebKit::WebData BrowserWebKitClientImpl::loadResource(const char* name) {
WebKit::WebStorageNamespace*
BrowserWebKitClientImpl::createLocalStorageNamespace(
- const WebKit::WebString& path) {
+ const WebKit::WebString& path, unsigned quota) {
// The "WebStorage" interface is used for renderer WebKit -> browser WebKit
// communication only. "WebStorageClient" will be used for browser WebKit ->
// renderer WebKit. So this will never be implemented.
diff --git a/chrome/browser/in_process_webkit/browser_webkitclient_impl.h b/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
index ff79350..b562fd8 100644
--- a/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
+++ b/chrome/browser/in_process_webkit/browser_webkitclient_impl.h
@@ -31,7 +31,7 @@ class BrowserWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual void getPluginList(bool refresh, WebKit::WebPluginListBuilder*);
virtual WebKit::WebData loadResource(const char* name);
virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
- const WebKit::WebString& path);
+ const WebKit::WebString& path, unsigned quota);
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
virtual void dispatchStorageEvent(const WebKit::WebString& key,
const WebKit::WebString& oldValue, const WebKit::WebString& newValue,
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
index 9380cd3..63ff96e 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
@@ -13,21 +13,22 @@
#include "chrome/browser/renderer_host/browser_render_process_host.h"
#include "chrome/common/render_messages.h"
-DOMStorageDispatcherHost* DOMStorageDispatcherHost::current_ = NULL;
+DOMStorageDispatcherHost* DOMStorageDispatcherHost::storage_event_host_ = NULL;
DOMStorageDispatcherHost::
-AutoSetCurrentDispatcherHost::AutoSetCurrentDispatcherHost(
+ScopedStorageEventContext::ScopedStorageEventContext(
DOMStorageDispatcherHost* dispatcher_host) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
- DCHECK(!current_);
- current_ = dispatcher_host;
+ DCHECK(!storage_event_host_);
+ storage_event_host_ = dispatcher_host;
+ DCHECK(storage_event_host_);
}
DOMStorageDispatcherHost::
-AutoSetCurrentDispatcherHost::~AutoSetCurrentDispatcherHost() {
+ScopedStorageEventContext::~ScopedStorageEventContext() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
- DCHECK(current_);
- current_ = NULL;
+ DCHECK(storage_event_host_);
+ storage_event_host_ = NULL;
}
DOMStorageDispatcherHost::DOMStorageDispatcherHost(
@@ -76,16 +77,24 @@ void DOMStorageDispatcherHost::Shutdown() {
}
/* static */
-void DOMStorageDispatcherHost::DispatchStorageEvent(const string16& key,
+void DOMStorageDispatcherHost::DispatchStorageEvent(const NullableString16& key,
const NullableString16& old_value, const NullableString16& new_value,
const string16& origin, bool is_local_storage) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
- DCHECK(current_);
- ChromeThread::PostTask(
- ChromeThread::IO, FROM_HERE,
- NewRunnableMethod(
- current_, &DOMStorageDispatcherHost::OnStorageEvent, key, old_value,
- new_value, origin, is_local_storage));
+ DCHECK(is_local_storage); // Only LocalStorage is implemented right now.
+ DCHECK(storage_event_host_);
+ ViewMsg_DOMStorageEvent_Params params;
+ params.key_ = key;
+ params.old_value_ = old_value;
+ params.new_value_ = new_value;
+ params.origin_ = origin;
+ params.storage_type_ = is_local_storage ? DOM_STORAGE_LOCAL
+ : DOM_STORAGE_SESSION;
+ // The storage_event_host_ is the DOMStorageDispatcherHost that is up in the
+ // current call stack since it caused the storage event to fire.
+ ChromeThread::PostTask(ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(storage_event_host_,
+ &DOMStorageDispatcherHost::OnStorageEvent, params));
}
bool DOMStorageDispatcherHost::OnMessageReceived(const IPC::Message& message,
@@ -282,14 +291,14 @@ void DOMStorageDispatcherHost::OnSetItem(int64 storage_area_id,
return;
}
- AutoSetCurrentDispatcherHost auto_set(this);
+ ScopedStorageEventContext scope(this);
storage_area->SetItem(key, value, &quota_exception);
ViewHostMsg_DOMStorageSetItem::WriteReplyParams(reply_msg, quota_exception);
Send(reply_msg);
}
-void DOMStorageDispatcherHost::OnRemoveItem(int64 storage_area_id,
- const string16& key) {
+void DOMStorageDispatcherHost::OnRemoveItem(
+ int64 storage_area_id, const string16& key) {
if (ChromeThread::CurrentlyOn(ChromeThread::IO)) {
PostTaskToWebKitThread(FROM_HERE, NewRunnableMethod(this,
&DOMStorageDispatcherHost::OnRemoveItem, storage_area_id, key));
@@ -304,7 +313,7 @@ void DOMStorageDispatcherHost::OnRemoveItem(int64 storage_area_id,
return;
}
- AutoSetCurrentDispatcherHost auto_set(this);
+ ScopedStorageEventContext scope(this);
storage_area->RemoveItem(key);
}
@@ -323,23 +332,18 @@ void DOMStorageDispatcherHost::OnClear(int64 storage_area_id) {
return;
}
- AutoSetCurrentDispatcherHost auto_set(this);
+ ScopedStorageEventContext scope(this);
storage_area->Clear();
}
-void DOMStorageDispatcherHost::OnStorageEvent(const string16& key,
- const NullableString16& old_value, const NullableString16& new_value,
- const string16& origin, bool is_local_storage) {
+void DOMStorageDispatcherHost::OnStorageEvent(
+ const ViewMsg_DOMStorageEvent_Params& params) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
- DCHECK(is_local_storage); // Only LocalStorage is implemented right now.
- DOMStorageType dom_storage_type = is_local_storage ? DOM_STORAGE_LOCAL
- : DOM_STORAGE_SESSION;
const DOMStorageContext::DispatcherHostSet* set =
Context()->GetDispatcherHostSet();
DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin();
while (cur != set->end()) {
- (*cur)->Send(new ViewMsg_DOMStorageEvent(key, old_value, new_value, origin,
- dom_storage_type));
+ (*cur)->Send(new ViewMsg_DOMStorageEvent(params));
++cur;
}
}
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
index 94a7c00..28e3fc8 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
@@ -16,6 +16,7 @@
class DOMStorageContext;
class Task;
class WebKitThread;
+struct ViewMsg_DOMStorageEvent_Params;
// This class handles the logistics of DOM Storage within the browser process.
// It mostly ferries information between IPCs and the WebKit implementations,
@@ -42,7 +43,7 @@ class DOMStorageDispatcherHost :
void Send(IPC::Message* message);
// Only call on the WebKit thread.
- static void DispatchStorageEvent(const string16& key,
+ static void DispatchStorageEvent(const NullableString16& key,
const NullableString16& old_value, const NullableString16& new_value,
const string16& origin, bool is_local_storage);
@@ -60,14 +61,12 @@ class DOMStorageDispatcherHost :
void OnGetItem(int64 storage_area_id, const string16& key,
IPC::Message* reply_msg);
void OnSetItem(int64 storage_area_id, const string16& key,
- const string16& value, IPC::Message* reply_msg);
+ const string16& value, IPC::Message* reply_msg);
void OnRemoveItem(int64 storage_area_id, const string16& key);
void OnClear(int64 storage_area_id);
// Only call on the IO thread.
- void OnStorageEvent(const string16& key, const NullableString16& old_value,
- const NullableString16& new_value, const string16& origin,
- bool is_local_storage);
+ void OnStorageEvent(const ViewMsg_DOMStorageEvent_Params& params);
// A shortcut for accessing our context.
DOMStorageContext* Context() {
@@ -79,14 +78,14 @@ class DOMStorageDispatcherHost :
const tracked_objects::Location& from_here, Task* task);
// Use whenever there's a chance OnStorageEvent will be called.
- class AutoSetCurrentDispatcherHost {
+ class ScopedStorageEventContext {
public:
- AutoSetCurrentDispatcherHost(DOMStorageDispatcherHost* dispatcher_host);
- ~AutoSetCurrentDispatcherHost();
+ ScopedStorageEventContext(DOMStorageDispatcherHost* dispatcher_host);
+ ~ScopedStorageEventContext();
};
// Only access on the WebKit thread! Used for storage events.
- static DOMStorageDispatcherHost* current_;
+ static DOMStorageDispatcherHost* storage_event_host_;
// Data shared between renderer processes with the same profile.
scoped_refptr<WebKitContext> webkit_context_;
diff --git a/chrome/browser/in_process_webkit/dom_storage_uitest.cc b/chrome/browser/in_process_webkit/dom_storage_uitest.cc
index f90fc9e..2ea3f5d 100644
--- a/chrome/browser/in_process_webkit/dom_storage_uitest.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_uitest.cc
@@ -83,6 +83,7 @@ class DOMStorageTest : public UILayoutTest {
ASSERT_TRUE(tab.get());
GURL url = GetTestUrl(L"layout_tests", L"clear_dom_storage.html");
+ tab->SetCookie(url, "");
ASSERT_TRUE(tab->NavigateToURL(url));
WaitUntilCookieNonEmpty(tab.get(), url, "cleared", kTestIntervalMs,
@@ -101,24 +102,15 @@ class DOMStorageTest : public UILayoutTest {
FilePath test_dir_;
};
-// http://code.google.com/p/chromium/issues/detail?id=24145
-#if defined(OS_WIN)
-#define MAYBE_DOMStorageLayoutTests FLAKY_DOMStorageLayoutTests
-#define MAYBE_SessionStorageLayoutTests FLAKY_SessionStorageLayoutTests
-#else
-#define MAYBE_DOMStorageLayoutTests DOMStorageLayoutTests
-#define MAYBE_SessionStorageLayoutTests SessionStorageLayoutTests
-#endif // defined(OS_WIN)
-
-TEST_F(DOMStorageTest, MAYBE_DOMStorageLayoutTests) {
+TEST_F(DOMStorageTest, DOMStorageLayoutTests) {
InitializeForLayoutTest(test_dir_, FilePath(), false);
AddResources();
RunTests(kTopLevelFiles);
}
-TEST_F(DOMStorageTest, FLAKY_LocalStorageLayoutTests) {
+TEST_F(DOMStorageTest, LocalStorageLayoutTests) {
InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("localstorage"),
false);
AddResources();
@@ -127,7 +119,7 @@ TEST_F(DOMStorageTest, FLAKY_LocalStorageLayoutTests) {
RunTests(kLocalStorageFiles);
}
-TEST_F(DOMStorageTest, MAYBE_SessionStorageLayoutTests) {
+TEST_F(DOMStorageTest, SessionStorageLayoutTests) {
InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"),
false);
AddResources();
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 87fc773..2e4bd89 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -495,6 +495,24 @@ struct ViewHostMsg_ScriptedPrint_Params {
bool has_selection;
};
+// Signals a storage event.
+struct ViewMsg_DOMStorageEvent_Params {
+ // The key that generated the storage event. Null if clear() was called.
+ NullableString16 key_;
+
+ // The old value of this key. Null on clear() or if it didn't have a value.
+ NullableString16 old_value_;
+
+ // The new value of this key. Null on removeItem() or clear().
+ NullableString16 new_value_;
+
+ // The origin this is associated with.
+ string16 origin_;
+
+ // The storage type of this event.
+ DOMStorageType storage_type_;
+};
+
namespace IPC {
template <>
@@ -2204,6 +2222,40 @@ struct ParamTraits<DOMStorageType> {
}
};
+// Traits for ViewMsg_DOMStorageEvent_Params.
+template <>
+struct ParamTraits<ViewMsg_DOMStorageEvent_Params> {
+ typedef ViewMsg_DOMStorageEvent_Params param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.key_);
+ WriteParam(m, p.old_value_);
+ WriteParam(m, p.new_value_);
+ WriteParam(m, p.origin_);
+ WriteParam(m, p.storage_type_);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->key_) &&
+ ReadParam(m, iter, &p->old_value_) &&
+ ReadParam(m, iter, &p->new_value_) &&
+ ReadParam(m, iter, &p->origin_) &&
+ ReadParam(m, iter, &p->storage_type_);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.key_, l);
+ l->append(L", ");
+ LogParam(p.old_value_, l);
+ l->append(L", ");
+ LogParam(p.new_value_, l);
+ l->append(L", ");
+ LogParam(p.origin_, l);
+ l->append(L", ");
+ LogParam(p.storage_type_, l);
+ l->append(L")");
+ }
+};
+
// Traits for WebCookie
template <>
struct ParamTraits<webkit_glue::WebCookie> {
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index f3887f0..2ff15ed 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -768,12 +768,8 @@ IPC_BEGIN_MESSAGES(View)
int64 /* space available to origin */)
// Storage events are broadcast to renderer processes.
- IPC_MESSAGE_CONTROL5(ViewMsg_DOMStorageEvent,
- string16 /* key */,
- NullableString16 /* old_value */,
- NullableString16 /* new_value */,
- string16 /* origin */,
- DOMStorageType /* dom_storage_type */)
+ IPC_MESSAGE_CONTROL1(ViewMsg_DOMStorageEvent,
+ ViewMsg_DOMStorageEvent_Params)
#if defined(IPC_MESSAGE_LOG_ENABLED)
// Tell the renderer process to begin or end IPC message logging.
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 9790d6d..9e033e6 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -266,14 +266,13 @@ void RenderThread::OnExtensionSetHostPermissions(
ExtensionProcessBindings::SetHostPermissions(extension_url, permissions);
}
-void RenderThread::OnDOMStorageEvent(const string16& key,
- const NullableString16& old_value, const NullableString16& new_value,
- const string16& origin, DOMStorageType dom_storage_type) {
- if (!dom_storage_event_dispatcher_.get()) {
+void RenderThread::OnDOMStorageEvent(
+ const ViewMsg_DOMStorageEvent_Params& params) {
+ if (!dom_storage_event_dispatcher_.get())
dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create());
- }
- dom_storage_event_dispatcher_->dispatchStorageEvent(key, old_value, new_value,
- origin, dom_storage_type == DOM_STORAGE_LOCAL);
+ dom_storage_event_dispatcher_->dispatchStorageEvent(params.key_,
+ params.old_value_, params.new_value_, params.origin_,
+ params.storage_type_ == DOM_STORAGE_LOCAL);
}
void RenderThread::OnExtensionSetL10nMessages(
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h
index 5dfb1c9..249c57a 100644
--- a/chrome/renderer/render_thread.h
+++ b/chrome/renderer/render_thread.h
@@ -34,6 +34,7 @@ class UserScriptSlave;
class URLPattern;
struct RendererPreferences;
+struct ViewMsg_DOMStorageEvent_Params;
struct WebPreferences;
namespace WebKit {
@@ -151,9 +152,7 @@ class RenderThread : public RenderThreadBase,
void OnSetExtensionFunctionNames(const std::vector<std::string>& names);
void OnPageActionsUpdated(const std::string& extension_id,
const std::vector<std::string>& page_actions);
- void OnDOMStorageEvent(const string16& key, const NullableString16& old_value,
- const NullableString16& new_value, const string16& origin,
- DOMStorageType dom_storage_type);
+ void OnDOMStorageEvent(const ViewMsg_DOMStorageEvent_Params& params);
void OnExtensionSetAPIPermissions(
const std::string& extension_id,
const std::vector<std::string>& permissions);
diff --git a/chrome/renderer/renderer_webkitclient_impl.cc b/chrome/renderer/renderer_webkitclient_impl.cc
index 52d4a24..cffa805 100644
--- a/chrome/renderer/renderer_webkitclient_impl.cc
+++ b/chrome/renderer/renderer_webkitclient_impl.cc
@@ -25,6 +25,7 @@
#include "chrome/renderer/visitedlink_slave.h"
#include "googleurl/src/gurl.h"
#include "webkit/api/public/WebCookie.h"
+#include "webkit/api/public/WebStorageEventDispatcher.h"
#include "webkit/api/public/WebString.h"
#include "webkit/api/public/WebURL.h"
#include "webkit/api/public/WebVector.h"
@@ -45,6 +46,7 @@ using WebKit::WebApplicationCacheHostClient;
using WebKit::WebCookie;
using WebKit::WebKitClient;
using WebKit::WebStorageArea;
+using WebKit::WebStorageEventDispatcher;
using WebKit::WebStorageNamespace;
using WebKit::WebString;
using WebKit::WebURL;
@@ -201,6 +203,18 @@ WebStorageNamespace* RendererWebKitClientImpl::createSessionStorageNamespace() {
return new RendererWebStorageNamespaceImpl(DOM_STORAGE_SESSION);
}
+void RendererWebKitClientImpl::dispatchStorageEvent(
+ const WebString& key, const WebString& old_value,
+ const WebString& new_value, const WebString& origin,
+ bool is_local_storage) {
+ DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess));
+ // Inefficient, but only used in single process mode.
+ scoped_ptr<WebStorageEventDispatcher> event_dispatcher(
+ WebStorageEventDispatcher::create());
+ event_dispatcher->dispatchStorageEvent(key, old_value, new_value, origin,
+ is_local_storage);
+}
+
WebApplicationCacheHost* RendererWebKitClientImpl::createApplicationCacheHost(
WebApplicationCacheHostClient* client) {
return new appcache::WebApplicationCacheHostImpl(client,
diff --git a/chrome/renderer/renderer_webkitclient_impl.h b/chrome/renderer/renderer_webkitclient_impl.h
index 28056c3..4a3852b 100644
--- a/chrome/renderer/renderer_webkitclient_impl.h
+++ b/chrome/renderer/renderer_webkitclient_impl.h
@@ -50,6 +50,10 @@ class RendererWebKitClientImpl : public webkit_glue::WebKitClientImpl {
virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
const WebKit::WebString& path, unsigned quota);
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
+ virtual void dispatchStorageEvent(
+ const WebKit::WebString& key, const WebKit::WebString& old_value,
+ const WebKit::WebString& new_value, const WebKit::WebString& origin,
+ bool is_local_storage);
virtual WebKit::WebKitClient::FileHandle databaseOpenFile(
const WebKit::WebString& file_name, int desired_flags,
diff --git a/chrome/worker/worker_webkitclient_impl.cc b/chrome/worker/worker_webkitclient_impl.cc
index d86b189..2ba4419 100644
--- a/chrome/worker/worker_webkitclient_impl.cc
+++ b/chrome/worker/worker_webkitclient_impl.cc
@@ -15,6 +15,7 @@ using WebKit::WebMessagePortChannel;
using WebKit::WebMimeRegistry;
using WebKit::WebSandboxSupport;
using WebKit::WebSharedWorkerRepository;
+using WebKit::WebStorageNamespace;
using WebKit::WebString;
using WebKit::WebURL;
@@ -82,8 +83,25 @@ WebString WorkerWebKitClientImpl::defaultLocale() {
return WebString();
}
-WebSharedWorkerRepository*
-WorkerWebKitClientImpl::sharedWorkerRepository() {
+WebStorageNamespace* WorkerWebKitClientImpl::createLocalStorageNamespace(
+ const WebString& path, unsigned quota) {
+ NOTREACHED();
+ return 0;
+}
+
+WebStorageNamespace* WorkerWebKitClientImpl::createSessionStorageNamespace() {
+ NOTREACHED();
+ return 0;
+}
+
+void WorkerWebKitClientImpl::dispatchStorageEvent(
+ const WebString& key, const WebString& old_value,
+ const WebString& new_value, const WebString& origin,
+ bool is_local_storage) {
+ NOTREACHED();
+}
+
+WebSharedWorkerRepository* WorkerWebKitClientImpl::sharedWorkerRepository() {
return 0;
}
diff --git a/chrome/worker/worker_webkitclient_impl.h b/chrome/worker/worker_webkitclient_impl.h
index 209cdac..6fbe716 100644
--- a/chrome/worker/worker_webkitclient_impl.h
+++ b/chrome/worker/worker_webkitclient_impl.h
@@ -28,6 +28,13 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl,
virtual void prefetchHostName(const WebKit::WebString&);
virtual bool getFileSize(const WebKit::WebString& path, long long& result);
virtual WebKit::WebString defaultLocale();
+ virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
+ const WebKit::WebString& path, unsigned quota);
+ virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
+ virtual void dispatchStorageEvent(
+ const WebKit::WebString& key, const WebKit::WebString& old_value,
+ const WebKit::WebString& new_value, const WebKit::WebString& origin,
+ bool is_local_storage);
virtual WebKit::WebSharedWorkerRepository* sharedWorkerRepository();
// WebMimeRegistry methods:
diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc
index 50ffbd1..a66c674 100644
--- a/webkit/glue/webkitclient_impl.cc
+++ b/webkit/glue/webkitclient_impl.cc
@@ -44,7 +44,6 @@ using WebKit::WebCookie;
using WebKit::WebData;
using WebKit::WebLocalizedString;
using WebKit::WebPluginListBuilder;
-using WebKit::WebStorageNamespace;
using WebKit::WebString;
using WebKit::WebSocketStreamHandle;
using WebKit::WebThemeEngine;
@@ -291,23 +290,6 @@ void WebKitClientImpl::callOnMainThread(void (*func)()) {
main_loop_->PostTask(FROM_HERE, NewRunnableFunction(func));
}
-WebStorageNamespace* WebKitClientImpl::createLocalStorageNamespace(
- const WebString& path, unsigned quota) {
- NOTREACHED();
- return 0;
-}
-
-WebStorageNamespace* WebKitClientImpl::createSessionStorageNamespace() {
- NOTREACHED();
- return 0;
-}
-
-void WebKitClientImpl::dispatchStorageEvent(const WebString& key,
- const WebString& oldValue, const WebString& newValue,
- const WebString& origin, bool isLocalStorage) {
- NOTREACHED();
-}
-
base::PlatformFile WebKitClientImpl::databaseOpenFile(
const WebKit::WebString& file_name, int desired_flags,
base::PlatformFile* dir_handle) {
diff --git a/webkit/glue/webkitclient_impl.h b/webkit/glue/webkitclient_impl.h
index 8b6ab37..ff18ed1 100644
--- a/webkit/glue/webkitclient_impl.h
+++ b/webkit/glue/webkitclient_impl.h
@@ -24,12 +24,6 @@ class WebKitClientImpl : public WebKit::WebKitClient {
virtual WebKit::WebThemeEngine* themeEngine();
virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(
WebKit::WebApplicationCacheHostClient*);
- virtual WebKit::WebStorageNamespace* createLocalStorageNamespace(
- const WebKit::WebString& path, unsigned quota);
- virtual WebKit::WebStorageNamespace* createSessionStorageNamespace();
- virtual void dispatchStorageEvent(const WebKit::WebString& key,
- const WebKit::WebString& oldValue, const WebKit::WebString& newValue,
- const WebKit::WebString& origin, bool isLocalStorage);
virtual bool fileExists(const WebKit::WebString& path);
virtual bool deleteFile(const WebKit::WebString& path);
virtual bool deleteEmptyDirectory(const WebKit::WebString& path);