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

Unified Diff: chrome/browser/dom_ui/dom_ui.cc

Issue 16270: Change the signature of JSONReader::Read() and related methods to be more (Closed)
Patch Set: fixens Created 12 years 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/dom_ui/dom_ui.cc
diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc
index 4fe9070e248f5b9b77c5c14e931d043038eb8135..e7f2765b141369ff5e6d3f89a8aed9e31d9e54aa 100644
--- a/chrome/browser/dom_ui/dom_ui.cc
+++ b/chrome/browser/dom_ui/dom_ui.cc
@@ -31,9 +31,10 @@ void DOMUI::ProcessDOMUIMessage(const std::string& message,
return;
// Convert the content JSON into a Value.
- Value* value = NULL;
+ scoped_ptr<Value> value;
if (!content.empty()) {
- if (!JSONReader::Read(content, &value, false)) {
+ value.reset(JSONReader::Read(content, false));
+ if (!value.get()) {
// The page sent us something that we didn't understand.
// This probably indicates a programming error.
NOTREACHED();
@@ -42,8 +43,7 @@ void DOMUI::ProcessDOMUIMessage(const std::string& message,
}
// Forward this message and content on.
- callback->second->Run(value);
- delete value;
+ callback->second->Run(value.get());
}
void DOMUI::CallJavascriptFunction(const std::wstring& function_name,

Powered by Google App Engine
This is Rietveld 408576698