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

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

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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
« no previous file with comments | « remoting/host/cast_extension_session.cc ('k') | remoting/host/host_config.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gnubby_auth_handler_posix.h" 5 #include "remoting/host/gnubby_auth_handler_posix.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 request.SetString(kMessageType, kDataMessage); 167 request.SetString(kMessageType, kDataMessage);
168 request.SetInteger(kConnectionId, connection_id); 168 request.SetInteger(kConnectionId, connection_id);
169 169
170 base::ListValue* bytes = new base::ListValue(); 170 base::ListValue* bytes = new base::ListValue();
171 for (std::string::const_iterator i = data.begin(); i != data.end(); ++i) { 171 for (std::string::const_iterator i = data.begin(); i != data.end(); ++i) {
172 bytes->AppendInteger(static_cast<unsigned char>(*i)); 172 bytes->AppendInteger(static_cast<unsigned char>(*i));
173 } 173 }
174 request.Set(kDataPayload, bytes); 174 request.Set(kDataPayload, bytes);
175 175
176 std::string request_json; 176 std::string request_json;
177 if (!base::JSONWriter::Write(&request, &request_json)) { 177 if (!base::JSONWriter::Write(request, &request_json)) {
178 LOG(ERROR) << "Failed to create request json"; 178 LOG(ERROR) << "Failed to create request json";
179 return; 179 return;
180 } 180 }
181 181
182 protocol::ExtensionMessage message; 182 protocol::ExtensionMessage message;
183 message.set_type(kGnubbyAuthMessage); 183 message.set_type(kGnubbyAuthMessage);
184 message.set_data(request_json); 184 message.set_data(request_json);
185 185
186 client_stub_->DeliverHostMessage(message); 186 client_stub_->DeliverHostMessage(message);
187 } 187 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 298 }
299 299
300 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) { 300 void GnubbyAuthHandlerPosix::RequestTimedOut(int connection_id) {
301 HOST_LOG << "Gnubby request timed out"; 301 HOST_LOG << "Gnubby request timed out";
302 ActiveSockets::iterator iter = active_sockets_.find(connection_id); 302 ActiveSockets::iterator iter = active_sockets_.find(connection_id);
303 if (iter != active_sockets_.end()) 303 if (iter != active_sockets_.end())
304 SendErrorAndCloseActiveSocket(iter); 304 SendErrorAndCloseActiveSocket(iter);
305 } 305 }
306 306
307 } // namespace remoting 307 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/cast_extension_session.cc ('k') | remoting/host/host_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698