diff options
author | estade <estade@chromium.org> | 2015-05-15 18:02:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-16 01:02:46 +0000 |
commit | 8d04646294767ea1f3a7da596547b465d50cb4d1 (patch) | |
tree | 6bd6194b6fe2ac226114f9125570bd605e9b6d42 /google_apis | |
parent | f39e5aff5aae8451a7ef190a2fc822bf80c4e30d (diff) | |
download | chromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.zip chromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.tar.gz chromium_src-8d04646294767ea1f3a7da596547b465d50cb4d1.tar.bz2 |
Convert JsonWriter::Write to taking a const ref for the in-param
Clearer API; flushes out a lot of unnecessary heap allocations.
depends on https://codereview.chromium.org/1129083003/
BUG=none
Review URL: https://codereview.chromium.org/1131113004
Cr-Commit-Position: refs/heads/master@{#330255}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/drive/drive_api_requests.cc | 16 | ||||
-rw-r--r-- | google_apis/gaia/fake_gaia.cc | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc index 5cd289a..57a3ec1 100644 --- a/google_apis/drive/drive_api_requests.cc +++ b/google_apis/drive/drive_api_requests.cc @@ -130,7 +130,7 @@ std::string CreateMultipartUploadMetadataJson( AttachProperties(properties, &root); std::string json_string; - base::JSONWriter::Write(&root, &json_string); + base::JSONWriter::Write(root, &json_string); return json_string; } @@ -417,7 +417,7 @@ bool FilesInsertRequest::GetContentData(std::string* upload_content_type, root.SetString("title", title_); AttachProperties(properties_, &root); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "FilesInsert data: " << *upload_content_type << ", [" << *upload_content << "]"; @@ -491,7 +491,7 @@ bool FilesPatchRequest::GetContentData(std::string* upload_content_type, } AttachProperties(properties_, &root); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "FilesPatch data: " << *upload_content_type << ", [" << *upload_content << "]"; @@ -545,7 +545,7 @@ bool FilesCopyRequest::GetContentData(std::string* upload_content_type, if (!title_.empty()) root.SetString("title", title_); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "FilesCopy data: " << *upload_content_type << ", [" << *upload_content << "]"; return true; @@ -755,7 +755,7 @@ bool ChildrenInsertRequest::GetContentData(std::string* upload_content_type, base::DictionaryValue root; root.SetString("id", id_); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "InsertResource data: " << *upload_content_type << ", [" << *upload_content << "]"; return true; @@ -834,7 +834,7 @@ bool InitiateUploadNewFileRequest::GetContentData( } AttachProperties(properties_, &root); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "InitiateUploadNewFile data: " << *upload_content_type << ", [" << *upload_content << "]"; @@ -906,7 +906,7 @@ bool InitiateUploadExistingFileRequest::GetContentData( return false; *upload_content_type = util::kContentTypeApplicationJson; - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); DVLOG(1) << "InitiateUploadExistingFile data: " << *upload_content_type << ", [" << *upload_content << "]"; return true; @@ -1158,7 +1158,7 @@ bool PermissionsInsertRequest::GetContentData(std::string* upload_content_type, break; } root.SetString("value", value_); - base::JSONWriter::Write(&root, upload_content); + base::JSONWriter::Write(root, upload_content); return true; } diff --git a/google_apis/gaia/fake_gaia.cc b/google_apis/gaia/fake_gaia.cc index bf2331d..1bf87ca 100644 --- a/google_apis/gaia/fake_gaia.cc +++ b/google_apis/gaia/fake_gaia.cc @@ -390,7 +390,7 @@ void FakeGaia::HandleProgramaticAuth( void FakeGaia::FormatJSONResponse(const base::DictionaryValue& response_dict, BasicHttpResponse* http_response) { std::string response_json; - base::JSONWriter::Write(&response_dict, &response_json); + base::JSONWriter::Write(response_dict, &response_json); http_response->set_content(response_json); http_response->set_code(net::HTTP_OK); } |