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 b020762eb14f104f537fc4afc491ed4253aac069..f500179773de0fdb808d5bcdc976d34f18256318 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()); |
} |
} |