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

Unified Diff: chrome/test/ui/ui_test.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/test/ui/ui_test.cc
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 4d58e6a316632599b23df95229660c354cbcfb1e..e1bea1b30ccfa2fbe7cf58140e60e277b522b786 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() {
« chrome/common/json_value_serializer.cc ('K') | « chrome/test/automation/tab_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698