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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_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/web_request/web_request_api.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc
index 2d8d8ad862d2cb5c7d27b3f3f3187f1bb5cf37b6..e8b5d91f71175c1782cd43709a5b467dc9384fe5 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api.cc
@@ -917,8 +917,6 @@ bool ExtensionWebRequestEventRouter::DispatchEvent(
net::URLRequest* request,
const std::vector<const EventListener*>& listeners,
const ListValue& args) {
- std::string json_args;
-
// TODO(mpcomplete): Consider consolidating common (extension_id,json_args)
// pairs into a single message sent to a list of sub_event_names.
int num_handlers_blocking = 0;
@@ -933,11 +931,10 @@ bool ExtensionWebRequestEventRouter::DispatchEvent(
if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS))
dict->Remove(keys::kResponseHeadersKey, NULL);
- base::JSONWriter::Write(args_filtered.get(), &json_args);
-
extensions::EventRouter::DispatchEvent(
(*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name,
- json_args, GURL(), extensions::EventRouter::USER_GESTURE_UNKNOWN,
+ args_filtered.Pass(), GURL(),
+ extensions::EventRouter::USER_GESTURE_UNKNOWN,
extensions::EventFilteringInfo());
if ((*it)->extra_info_spec &
(ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) {

Powered by Google App Engine
This is Rietveld 408576698