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

Unified Diff: chrome/browser/dom_ui/dom_ui_host.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_host.cc
diff --git a/chrome/browser/dom_ui/dom_ui_host.cc b/chrome/browser/dom_ui/dom_ui_host.cc
index d9d0333550c1fd08e98acd5c3a3996aa7fe70336..ff2ca1eca50e93454d0de5db260dbfeb0543b7ab 100644
--- a/chrome/browser/dom_ui/dom_ui_host.cc
+++ b/chrome/browser/dom_ui/dom_ui_host.cc
@@ -78,9 +78,10 @@ void DOMUIHost::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();
@@ -89,8 +90,7 @@ void DOMUIHost::ProcessDOMUIMessage(const std::string& message,
}
// Forward this message and content on.
- callback->second->Run(value);
- delete value;
+ callback->second->Run(value.get());
}
WebPreferences DOMUIHost::GetWebkitPrefs() {

Powered by Google App Engine
This is Rietveld 408576698