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

Side by Side Diff: chrome/common/cloud_print/cloud_print_helpers.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/renderer/app_categorizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/common/cloud_print/cloud_print_helpers.h" 5 #include "chrome/common/cloud_print/cloud_print_helpers.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 values_list.append(it->first); 44 values_list.append(it->first);
45 values_list.append(it->second); 45 values_list.append(it->second);
46 } 46 }
47 return base::MD5String(values_list); 47 return base::MD5String(values_list);
48 } 48 }
49 49
50 } // namespace 50 } // namespace
51 51
52 std::string AppendPathToUrl(const GURL& url, const std::string& path) { 52 std::string AppendPathToUrl(const GURL& url, const std::string& path) {
53 DCHECK_NE(path[0], '/'); 53 DCHECK_NE(path[0], '/');
54 std::string ret = url.path(); 54 std::string ret = url.path().as_string();
55 if (url.has_path() && (ret.back() != '/')) 55 if (url.has_path() && (ret.back() != '/'))
56 ret += '/'; 56 ret += '/';
57 ret += path; 57 ret += path;
58 return ret; 58 return ret;
59 } 59 }
60 60
61 GURL GetUrlForSearch(const GURL& cloud_print_server_url) { 61 GURL GetUrlForSearch(const GURL& cloud_print_server_url) {
62 std::string path(AppendPathToUrl(cloud_print_server_url, "search")); 62 std::string path(AppendPathToUrl(cloud_print_server_url, "search"));
63 GURL::Replacements replacements; 63 GURL::Replacements replacements;
64 replacements.SetPathStr(path); 64 replacements.SetPathStr(path);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 net::AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg, 238 net::AddMultipartValueForUpload(kPrinterTagValue, tags_hash_msg,
239 mime_boundary, std::string(), &post_data); 239 mime_boundary, std::string(), &post_data);
240 return post_data; 240 return post_data;
241 } 241 }
242 242
243 std::string GetCloudPrintAuthHeader(const std::string& auth_token) { 243 std::string GetCloudPrintAuthHeader(const std::string& auth_token) {
244 return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str()); 244 return base::StringPrintf("Authorization: OAuth %s", auth_token.c_str());
245 } 245 }
246 246
247 } // namespace cloud_print 247 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/renderer/app_categorizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698