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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 10694085: Refactor extension event distribution to use Values instead of JSON strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing memory leak in a test. Created 8 years, 4 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
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index f57644eb8c65f9357bbf95b678e28ba3b3fd1f3d..2f9ded3038aecd98d6277107e437aa8347e61a98 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -83,7 +83,7 @@ namespace {
static const int64 kInitialExtensionIdleHandlerDelayMs = 5*1000;
static const int64 kMaxExtensionIdleHandlerDelayMs = 5*60*1000;
-static const char kEventDispatchFunction[] = "Event.dispatchJSON";
+static const char kEventDispatchFunction[] = "Event.dispatchEvent";
static const char kOnUnloadEvent[] = "runtime.onSuspend";
static const char kOnSuspendCanceledEvent[] = "runtime.onSuspendCanceled";
@@ -1023,7 +1023,7 @@ void Dispatcher::OnUnload(const std::string& extension_id) {
// event creates.
ListValue args;
args.Set(0, Value::CreateStringValue(kOnUnloadEvent));
- args.Set(1, Value::CreateStringValue("[]"));
+ args.Set(1, new ListValue());
v8_context_set_.DispatchChromeHiddenMethod(
extension_id, kEventDispatchFunction, args, NULL, GURL());
@@ -1033,7 +1033,7 @@ void Dispatcher::OnUnload(const std::string& extension_id) {
void Dispatcher::OnCancelUnload(const std::string& extension_id) {
ListValue args;
args.Set(0, Value::CreateStringValue(kOnSuspendCanceledEvent));
- args.Set(1, Value::CreateStringValue("[]"));
+ args.Set(1, new ListValue());
v8_context_set_.DispatchChromeHiddenMethod(
extension_id, kEventDispatchFunction, args, NULL, GURL());
}
« no previous file with comments | « chrome/browser/speech/speech_input_extension_manager.cc ('k') | chrome/renderer/resources/extensions/event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698