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

Unified Diff: chrome/browser/drive/fake_drive_service.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 months 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/drive/fake_drive_service.cc
diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc
index 6db5b946c2e6a31a4be0bdb1c3c9e355bbd60850..74b8f2be22cb4a5120a8c6e9814a638971d31595 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -183,7 +183,7 @@ bool FakeDriveService::LoadResourceListForWapi(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
scoped_ptr<Value> raw_value = test_util::LoadJSONFile(relative_path);
base::DictionaryValue* as_dict = NULL;
- base::Value* feed = NULL;
+ scoped_ptr<base::Value> feed;
base::DictionaryValue* feed_as_dict = NULL;
// Extract the "feed" from the raw value and take the ownership.
@@ -191,6 +191,7 @@ bool FakeDriveService::LoadResourceListForWapi(
if (raw_value->GetAsDictionary(&as_dict) &&
as_dict->Remove("feed", &feed) &&
feed->GetAsDictionary(&feed_as_dict)) {
+ ignore_result(feed.release());
resource_list_value_.reset(feed_as_dict);
// Go through entries and convert test$data from a string to a binary blob.
@@ -201,8 +202,9 @@ bool FakeDriveService::LoadResourceListForWapi(
std::string content_data;
if (entries->GetDictionary(i, &entry) &&
entry->GetString("test$data", &content_data)) {
- entry->Set("test$data", base::BinaryValue::CreateWithCopiedBuffer(
- content_data.c_str(), content_data.size()));
+ entry->Set("test$data",
+ base::BinaryValue::CreateWithCopiedBuffer(
+ content_data.c_str(), content_data.size()));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698