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

Unified Diff: chrome/browser/speech/extension_api/tts_extension_api_controller.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: Rebase and review changes. Created 8 years, 5 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/speech/extension_api/tts_extension_api_controller.cc
diff --git a/chrome/browser/speech/extension_api/tts_extension_api_controller.cc b/chrome/browser/speech/extension_api/tts_extension_api_controller.cc
index 0d2067440f2090ab5e6e772601f0d4710fec22a7..29e42f93471833aea8b4d5263755070d7b7fc19d 100644
--- a/chrome/browser/speech/extension_api/tts_extension_api_controller.cc
+++ b/chrome/browser/speech/extension_api/tts_extension_api_controller.cc
@@ -108,7 +108,6 @@ void Utterance::OnTtsEvent(TtsEventType event_type,
if (src_id_ < 0)
return;
- ListValue args;
DictionaryValue* event = new DictionaryValue();
if (char_index != kInvalidCharIndex)
event->SetInteger(constants::kCharIndexKey, char_index);
@@ -118,14 +117,14 @@ void Utterance::OnTtsEvent(TtsEventType event_type,
}
event->SetInteger(constants::kSrcIdKey, src_id_);
event->SetBoolean(constants::kIsFinalEventKey, finished_);
- args.Set(0, event);
- std::string json_args;
- base::JSONWriter::Write(&args, &json_args);
+
+ ListValue* arguments = new ListValue();
+ arguments->Set(0, event);
profile_->GetExtensionEventRouter()->DispatchEventToExtension(
src_extension_id_,
events::kOnEvent,
- json_args,
+ arguments,
profile_,
src_url_);
}

Powered by Google App Engine
This is Rietveld 408576698