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

Unified Diff: chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_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/offscreen_tabs/offscreen_tabs_api.cc
diff --git a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
index 5f084dba02805680df44f1872bf7990947ba2f9f..2d83b42484b2bc702a3011147c098af7516f3231 100644
--- a/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
+++ b/chrome/browser/extensions/api/offscreen_tabs/offscreen_tabs_api.cc
@@ -264,19 +264,17 @@ void OffscreenTab::Observe(int type,
changed_properties->SetString(
tabs_keys::kUrlKey, web_contents()->GetURL().spec());
- ListValue args;
- args.Append(Value::CreateIntegerValue(
+ scoped_ptr<ListValue> args(new ListValue());
+ args->Append(Value::CreateIntegerValue(
ExtensionTabUtil::GetTabId(web_contents())));
- args.Append(changed_properties);
- args.Append(CreateValue());
- std::string json_args;
- base::JSONWriter::Write(&args, &json_args);
+ args->Append(changed_properties);
+ args->Append(CreateValue());
// The event router only dispatches the event to renderers listening for the
// event.
Profile* profile = parent_tab_->tab_contents()->profile();
profile->GetExtensionEventRouter()->DispatchEventToRenderers(
- events::kOnOffscreenTabUpdated, json_args, profile, GURL(),
+ events::kOnOffscreenTabUpdated, args.Pass(), profile, GURL(),
extensions::EventFilteringInfo());
}
« no previous file with comments | « chrome/browser/extensions/api/management/management_api.cc ('k') | chrome/browser/extensions/api/omnibox/omnibox_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698