| Index: chrome/browser/history/history_extension_api.cc
|
| diff --git a/chrome/browser/history/history_extension_api.cc b/chrome/browser/history/history_extension_api.cc
|
| index a55d0958cc4ee55c105bdb4c47ef8852a0df3aab..6f05b573f0abe28782fc03dc011dc9a64a7b2a4e 100644
|
| --- a/chrome/browser/history/history_extension_api.cc
|
| +++ b/chrome/browser/history/history_extension_api.cc
|
| @@ -129,20 +129,18 @@ void HistoryExtensionEventRouter::Observe(
|
| void HistoryExtensionEventRouter::HistoryUrlVisited(
|
| Profile* profile,
|
| const history::URLVisitedDetails* details) {
|
| - ListValue args;
|
| + ListValue* args = new ListValue();
|
| DictionaryValue* dict = new DictionaryValue();
|
| GetHistoryItemDictionary(details->row, dict);
|
| - args.Append(dict);
|
| + args->Append(dict);
|
|
|
| - std::string json_args;
|
| - base::JSONWriter::Write(&args, &json_args);
|
| - DispatchEvent(profile, kOnVisited, json_args);
|
| + DispatchEvent(profile, kOnVisited, args);
|
| }
|
|
|
| void HistoryExtensionEventRouter::HistoryUrlsRemoved(
|
| Profile* profile,
|
| const history::URLsDeletedDetails* details) {
|
| - ListValue args;
|
| + ListValue* args = new ListValue();
|
| DictionaryValue* dict = new DictionaryValue();
|
| dict->SetBoolean(kAllHistoryKey, details->all_history);
|
| ListValue* urls = new ListValue();
|
| @@ -151,19 +149,17 @@ void HistoryExtensionEventRouter::HistoryUrlsRemoved(
|
| urls->Append(new StringValue(iterator->url().spec()));
|
| }
|
| dict->Set(kUrlsKey, urls);
|
| - args.Append(dict);
|
| + args->Append(dict);
|
|
|
| - std::string json_args;
|
| - base::JSONWriter::Write(&args, &json_args);
|
| - DispatchEvent(profile, kOnVisitRemoved, json_args);
|
| + DispatchEvent(profile, kOnVisitRemoved, args);
|
| }
|
|
|
| void HistoryExtensionEventRouter::DispatchEvent(Profile* profile,
|
| const char* event_name,
|
| - const std::string& json_args) {
|
| + ListValue* event_args) {
|
| if (profile && profile->GetExtensionEventRouter()) {
|
| profile->GetExtensionEventRouter()->DispatchEventToRenderers(
|
| - event_name, json_args, profile, GURL(),
|
| + event_name, event_args, profile, GURL(),
|
| extensions::EventFilteringInfo());
|
| }
|
| }
|
|
|