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

Unified Diff: chrome/browser/extensions/extension_preference_helpers.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/browser/extensions/extension_preference_helpers.cc
diff --git a/chrome/browser/extensions/extension_preference_helpers.cc b/chrome/browser/extensions/extension_preference_helpers.cc
index 4a48fe17e82877b5c788621a3b77386e3e4fe46e..5e5040f7ca18e716f6dd30d9261387361c791790 100644
--- a/chrome/browser/extensions/extension_preference_helpers.cc
+++ b/chrome/browser/extensions/extension_preference_helpers.cc
@@ -104,8 +104,6 @@ void DispatchEventToExtensions(
std::string level_of_control =
GetLevelOfControl(profile, extension_id, browser_pref, incognito);
dict->SetString(kLevelOfControlKey, level_of_control);
- std::string json_args;
- base::JSONWriter::Write(args, &json_args);
// If the extension is in incognito split mode,
// a) incognito pref changes are visible only to the incognito tabs
@@ -126,8 +124,10 @@ void DispatchEventToExtensions(
}
}
+ scoped_ptr<ListValue> args_copy(args->DeepCopy());
router->DispatchEventToExtension(
- extension_id, event_name, json_args, restrict_to_profile, GURL());
+ extension_id, event_name, args_copy.Pass(), restrict_to_profile,
+ GURL());
}
}
}
« no previous file with comments | « chrome/browser/extensions/extension_messages_apitest.cc ('k') | chrome/browser/extensions/extension_processes_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698