Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: chrome/renderer/render_thread.cc

Issue 223013: Another stab at the Chromium side of storage events. The WebKit side can be ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/renderer_webstoragenamespace_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.cc
===================================================================
--- chrome/renderer/render_thread.cc (revision 27652)
+++ chrome/renderer/render_thread.cc (working copy)
@@ -11,8 +11,10 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/nullable_string16.h"
#include "base/shared_memory.h"
#include "base/stats_table.h"
+#include "base/string_util.h"
#include "base/thread_local.h"
#include "chrome/common/appcache/appcache_dispatcher.h"
#include "chrome/common/chrome_switches.h"
@@ -45,6 +47,7 @@
#include "webkit/api/public/WebColor.h"
#include "webkit/api/public/WebCache.h"
#include "webkit/api/public/WebKit.h"
+#include "webkit/api/public/WebStorageEventDispatcher.h"
#include "webkit/api/public/WebString.h"
#include "webkit/extensions/v8/benchmarking_extension.h"
#include "webkit/extensions/v8/gears_extension.h"
@@ -59,6 +62,7 @@
using WebKit::WebCache;
using WebKit::WebString;
+using WebKit::WebStorageEventDispatcher;
namespace {
static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */;
@@ -240,6 +244,16 @@
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()) {
+ dom_storage_event_dispatcher_.reset(WebStorageEventDispatcher::create());
+ }
+ dom_storage_event_dispatcher_->dispatchStorageEvent(key, old_value, new_value,
+ origin, dom_storage_type == DOM_STORAGE_LOCAL);
+}
+
void RenderThread::OnExtensionSetL10nMessages(
const std::string& extension_id,
const std::map<std::string, std::string>& l10n_messages) {
@@ -281,6 +295,8 @@
OnExtensionSetAPIPermissions)
IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetHostPermissions,
OnExtensionSetHostPermissions)
+ IPC_MESSAGE_HANDLER(ViewMsg_DOMStorageEvent,
+ OnDOMStorageEvent)
IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetL10nMessages,
OnExtensionSetL10nMessages)
#if defined(IPC_MESSAGE_LOG_ENABLED)
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/renderer_webstoragenamespace_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698