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

Unified Diff: google_apis/drive/drive_api_requests.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: google_apis/drive/drive_api_requests.cc
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc
index f931e9c94e723489a1d04099ecf132adf0fc559e..2e30a9a4df056e485a2cc85d09674fabd4c4abf3 100644
--- a/google_apis/drive/drive_api_requests.cc
+++ b/google_apis/drive/drive_api_requests.cc
@@ -125,8 +125,7 @@ std::string CreateMultipartUploadMetadataJson(
// Fill parent link.
if (!parent_resource_id.empty()) {
std::unique_ptr<base::ListValue> parents(new base::ListValue);
- parents->Append(
- google_apis::util::CreateParentValue(parent_resource_id).release());
+ parents->Append(google_apis::util::CreateParentValue(parent_resource_id));
root.Set("parents", parents.release());
}
@@ -833,7 +832,7 @@ bool InitiateUploadNewFileRequest::GetContentData(
// Fill parent link.
std::unique_ptr<base::ListValue> parents(new base::ListValue);
- parents->Append(util::CreateParentValue(parent_resource_id_).release());
+ parents->Append(util::CreateParentValue(parent_resource_id_));
root.Set("parents", parents.release());
if (!modified_date_.is_null())
@@ -893,7 +892,7 @@ bool InitiateUploadExistingFileRequest::GetContentData(
base::DictionaryValue root;
if (!parent_resource_id_.empty()) {
std::unique_ptr<base::ListValue> parents(new base::ListValue);
- parents->Append(util::CreateParentValue(parent_resource_id_).release());
+ parents->Append(util::CreateParentValue(parent_resource_id_));
root.Set("parents", parents.release());
}

Powered by Google App Engine
This is Rietveld 408576698