diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-29 19:59:08 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-29 19:59:08 +0000 |
commit | b4cebf87816cde49f6d4991ffa254e5ead97703b (patch) | |
tree | fb12e4b464a43af846f30bbd0dbe9484150373b0 /chrome/test | |
parent | 45ce59f19161b517c04a4e3bcd0890b938382b06 (diff) | |
download | chromium_src-b4cebf87816cde49f6d4991ffa254e5ead97703b.zip chromium_src-b4cebf87816cde49f6d4991ffa254e5ead97703b.tar.gz chromium_src-b4cebf87816cde49f6d4991ffa254e5ead97703b.tar.bz2 |
Change the signature of JSONReader::Read() and related
methods to be more friendly to use with scoped_ptr. Change
all the callsites.
Review URL: http://codereview.chromium.org/16270
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 4 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.cc | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index f17a35de..07a3488 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -555,10 +555,10 @@ bool TabProxy::ExecuteAndExtractValue(const std::wstring& frame_xpath, json.append("]"); JSONStringValueSerializer deserializer(json); - succeeded = deserializer.Deserialize(value, NULL); + *value = deserializer.Deserialize(NULL); delete response; - return succeeded; + return *value != NULL; } bool TabProxy::GetConstrainedWindowCount(int* count) const { diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 4d58e6a..e1bea1b 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -497,13 +497,11 @@ static DictionaryValue* LoadDictionaryValueFromPath(const std::wstring& path) { return NULL; JSONFileValueSerializer serializer(path); - Value* root_value = NULL; - if (serializer.Deserialize(&root_value, NULL) && - root_value->GetType() != Value::TYPE_DICTIONARY) { - delete root_value; + scoped_ptr<Value> root_value(serializer.Deserialize(NULL)); + if (!root_value.get() || root_value->GetType() != Value::TYPE_DICTIONARY) return NULL; - } - return static_cast<DictionaryValue*>(root_value); + + return static_cast<DictionaryValue*>(root_value.release()); } DictionaryValue* UITest::GetLocalState() { |