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

Side by Side Diff: remoting/host/service_client.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/server_log_entry.cc ('k') | remoting/host/setup/daemon_controller_linux.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 "remoting/host/service_client.h" 5 #include "remoting/host/service_client.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const std::string& oauth_access_token, 71 const std::string& oauth_access_token,
72 Delegate* delegate) { 72 Delegate* delegate) {
73 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE); 73 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE);
74 pending_request_type_ = PENDING_REQUEST_REGISTER_HOST; 74 pending_request_type_ = PENDING_REQUEST_REGISTER_HOST;
75 base::DictionaryValue post_body; 75 base::DictionaryValue post_body;
76 post_body.SetString("data.hostId", host_id); 76 post_body.SetString("data.hostId", host_id);
77 post_body.SetString("data.hostName", host_name); 77 post_body.SetString("data.hostName", host_name);
78 post_body.SetString("data.publicKey", public_key); 78 post_body.SetString("data.publicKey", public_key);
79 std::string post_body_str; 79 std::string post_body_str;
80 base::JSONWriter::Write(&post_body, &post_body_str); 80 base::JSONWriter::Write(&post_body, &post_body_str);
81 MakeGaiaRequest(net::URLFetcher::POST, "", post_body_str, oauth_access_token, 81 MakeGaiaRequest(net::URLFetcher::POST,
82 std::string(),
83 post_body_str,
84 oauth_access_token,
82 delegate); 85 delegate);
83 } 86 }
84 87
85 void ServiceClient::Core::UnregisterHost( 88 void ServiceClient::Core::UnregisterHost(
86 const std::string& host_id, 89 const std::string& host_id,
87 const std::string& oauth_access_token, 90 const std::string& oauth_access_token,
88 Delegate* delegate) { 91 Delegate* delegate) {
89 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE); 92 DCHECK(pending_request_type_ == PENDING_REQUEST_NONE);
90 pending_request_type_ = PENDING_REQUEST_UNREGISTER_HOST; 93 pending_request_type_ = PENDING_REQUEST_UNREGISTER_HOST;
91 MakeGaiaRequest(net::URLFetcher::DELETE_REQUEST, host_id, "", 94 MakeGaiaRequest(net::URLFetcher::DELETE_REQUEST,
92 oauth_access_token, delegate); 95 host_id,
96 std::string(),
97 oauth_access_token,
98 delegate);
93 } 99 }
94 100
95 void ServiceClient::Core::MakeGaiaRequest( 101 void ServiceClient::Core::MakeGaiaRequest(
96 net::URLFetcher::RequestType request_type, 102 net::URLFetcher::RequestType request_type,
97 const std::string& url_suffix, 103 const std::string& url_suffix,
98 const std::string& request_body, 104 const std::string& request_body,
99 const std::string& oauth_access_token, 105 const std::string& oauth_access_token,
100 ServiceClient::Delegate* delegate) { 106 ServiceClient::Delegate* delegate) {
101 delegate_ = delegate; 107 delegate_ = delegate;
102 request_.reset(net::URLFetcher::Create( 108 request_.reset(net::URLFetcher::Create(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 163 }
158 164
159 void ServiceClient::UnregisterHost( 165 void ServiceClient::UnregisterHost(
160 const std::string& host_id, 166 const std::string& host_id,
161 const std::string& oauth_access_token, 167 const std::string& oauth_access_token,
162 Delegate* delegate) { 168 Delegate* delegate) {
163 return core_->UnregisterHost(host_id, oauth_access_token, delegate); 169 return core_->UnregisterHost(host_id, oauth_access_token, delegate);
164 } 170 }
165 171
166 } // namespace gaia 172 } // namespace gaia
OLDNEW
« no previous file with comments | « remoting/host/server_log_entry.cc ('k') | remoting/host/setup/daemon_controller_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698