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

Unified Diff: chrome/browser/extensions/api/debugger/debugger_api.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/api/debugger/debugger_api.cc
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index 02884c922131fd2d640f195bc7379c380f180389..c24dc92f4fd2d538d411bda0ec5a20a2f58d59d9 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -254,9 +254,9 @@ void ExtensionDevToolsClientHost::SendDetachedEvent() {
Debuggee debuggee;
debuggee.tab_id = tab_id_;
- std::string json_args = OnDetach::ToJson(debuggee);
+ scoped_ptr<base::ListValue> args(OnDetach::Create(debuggee));
profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id_, keys::kOnDetach, json_args, profile, GURL());
+ extension_id_, keys::kOnDetach, args.Pass(), profile, GURL());
}
}
@@ -307,10 +307,9 @@ void ExtensionDevToolsClientHost::DispatchOnInspectorFrontend(
if (dictionary->GetDictionary("params", &params_value))
params.additional_properties.Swap(params_value);
- std::string json_args = OnEvent::ToJson(debuggee, method_name, params);
-
+ scoped_ptr<ListValue> args(OnEvent::Create(debuggee, method_name, params));
profile->GetExtensionEventRouter()->DispatchEventToExtension(
- extension_id_, keys::kOnEvent, json_args, profile, GURL());
+ extension_id_, keys::kOnEvent, args.Pass(), profile, GURL());
} else {
SendCommandDebuggerFunction* function = pending_requests_[id];
if (!function)
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_api.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698