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

Side by Side Diff: google_apis/drive/request_util.cc

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/drive/request_util.h" 5 #include "google_apis/drive/request_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/values.h" 8 #include "base/values.h"
9 9
10 namespace google_apis { 10 namespace google_apis {
11 namespace util { 11 namespace util {
12 12
13 namespace { 13 namespace {
14 14
15 // etag matching header. 15 // etag matching header.
16 const char kIfMatchHeaderPrefix[] = "If-Match: "; 16 const char kIfMatchHeaderPrefix[] = "If-Match: ";
17 const char kParentLinkKind[] = "drive#fileLink"; 17 const char kParentLinkKind[] = "drive#fileLink";
18 18
19 } // namespace 19 } // namespace
20 20
21 const char kIfMatchAllHeader[] = "If-Match: *"; 21 const char kIfMatchAllHeader[] = "If-Match: *";
22 const char kContentTypeApplicationJson[] = "application/json"; 22 const char kContentTypeApplicationJson[] = "application/json";
23 23
24 std::string GenerateIfMatchHeader(const std::string& etag) { 24 std::string GenerateIfMatchHeader(const std::string& etag) {
25 return etag.empty() ? kIfMatchAllHeader : (kIfMatchHeaderPrefix + etag); 25 return etag.empty() ? kIfMatchAllHeader : (kIfMatchHeaderPrefix + etag);
26 } 26 }
27 27
28 scoped_ptr<base::DictionaryValue> CreateParentValue( 28 std::unique_ptr<base::DictionaryValue> CreateParentValue(
29 const std::string& file_id) { 29 const std::string& file_id) {
30 scoped_ptr<base::DictionaryValue> parent(new base::DictionaryValue); 30 std::unique_ptr<base::DictionaryValue> parent(new base::DictionaryValue);
31 parent->SetString("kind", kParentLinkKind); 31 parent->SetString("kind", kParentLinkKind);
32 parent->SetString("id", file_id); 32 parent->SetString("id", file_id);
33 return parent; 33 return parent;
34 } 34 }
35 35
36 } // namespace util 36 } // namespace util
37 } // namespace google_apis 37 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698