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, |