summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/automation
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 20:19:11 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-03 20:19:11 +0000
commitc4aae8eab78e3b234d26e3b1dfc9cc0f4cd98861 (patch)
treece143c9c4372367f78666b9bfe14324e2f81d50d /chrome/renderer/automation
parent8536dcada5501d93a684f00a9a6bf831abc81ef5 (diff)
downloadchromium_src-c4aae8eab78e3b234d26e3b1dfc9cc0f4cd98861.zip
chromium_src-c4aae8eab78e3b234d26e3b1dfc9cc0f4cd98861.tar.gz
chromium_src-c4aae8eab78e3b234d26e3b1dfc9cc0f4cd98861.tar.bz2
Fix memory leak.
Bug=6535 Review URL: http://codereview.chromium.org/20009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/automation')
-rw-r--r--chrome/renderer/automation/dom_automation_controller.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/renderer/automation/dom_automation_controller.cc b/chrome/renderer/automation/dom_automation_controller.cc
index ba06b28..56aea6e 100644
--- a/chrome/renderer/automation/dom_automation_controller.cc
+++ b/chrome/renderer/automation/dom_automation_controller.cc
@@ -31,7 +31,7 @@ void DomAutomationController::send(const CppArgumentList& args,
std::string json;
JSONStringValueSerializer serializer(&json);
- Value* value = NULL;
+ scoped_ptr<Value> value;
// Warning: note that JSON officially requires the root-level object to be
// an object (e.g. {foo:3}) or an array, while here we're serializing
@@ -41,15 +41,15 @@ void DomAutomationController::send(const CppArgumentList& args,
// grabbing the 0th element to get the value out.
switch(args[0].type) {
case NPVariantType_String: {
- value = Value::CreateStringValue(args[0].ToString());
+ value.reset(Value::CreateStringValue(args[0].ToString()));
break;
}
case NPVariantType_Bool: {
- value = Value::CreateBooleanValue(args[0].ToBoolean());
+ value.reset(Value::CreateBooleanValue(args[0].ToBoolean()));
break;
}
case NPVariantType_Int32: {
- value = Value::CreateIntegerValue(args[0].ToInt32());
+ value.reset(Value::CreateIntegerValue(args[0].ToInt32()));
break;
}
case NPVariantType_Double: {
@@ -57,7 +57,7 @@ void DomAutomationController::send(const CppArgumentList& args,
// as a double in this binding. The reason being that KJS treats
// any number value as a double. Refer for more details,
// chrome/third_party/webkit/src/JavaScriptCore/bindings/c/c_utility.cpp
- value = Value::CreateIntegerValue(args[0].ToInt32());
+ value.reset(Value::CreateIntegerValue(args[0].ToInt32()));
break;
}
default: {