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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host.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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "remoting/host/it2me/it2me_native_messaging_host.h" 5 #include "remoting/host/it2me/it2me_native_messaging_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 void It2MeNativeMessagingHost::Start(Client* client) { 115 void It2MeNativeMessagingHost::Start(Client* client) {
116 DCHECK(task_runner()->BelongsToCurrentThread()); 116 DCHECK(task_runner()->BelongsToCurrentThread());
117 client_ = client; 117 client_ = client;
118 } 118 }
119 119
120 void It2MeNativeMessagingHost::SendMessageToClient( 120 void It2MeNativeMessagingHost::SendMessageToClient(
121 scoped_ptr<base::DictionaryValue> message) const { 121 scoped_ptr<base::DictionaryValue> message) const {
122 DCHECK(task_runner()->BelongsToCurrentThread()); 122 DCHECK(task_runner()->BelongsToCurrentThread());
123 std::string message_json; 123 std::string message_json;
124 base::JSONWriter::Write(message.get(), &message_json); 124 base::JSONWriter::Write(*message, &message_json);
125 client_->PostMessageFromNativeHost(message_json); 125 client_->PostMessageFromNativeHost(message_json);
126 } 126 }
127 127
128 void It2MeNativeMessagingHost::ProcessHello( 128 void It2MeNativeMessagingHost::ProcessHello(
129 const base::DictionaryValue& message, 129 const base::DictionaryValue& message,
130 scoped_ptr<base::DictionaryValue> response) const { 130 scoped_ptr<base::DictionaryValue> response) const {
131 DCHECK(task_runner()->BelongsToCurrentThread()); 131 DCHECK(task_runner()->BelongsToCurrentThread());
132 132
133 response->SetString("version", STRINGIZE(VERSION)); 133 response->SetString("version", STRINGIZE(VERSION));
134 134
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 } 309 }
310 310
311 /* static */ 311 /* static */
312 std::string It2MeNativeMessagingHost::HostStateToString( 312 std::string It2MeNativeMessagingHost::HostStateToString(
313 It2MeHostState host_state) { 313 It2MeHostState host_state) {
314 return ValueToName(kIt2MeHostStates, host_state); 314 return ValueToName(kIt2MeHostStates, host_state);
315 } 315 }
316 316
317 } // namespace remoting 317 } // namespace remoting
318 318
OLDNEW
« no previous file with comments | « remoting/host/host_config.cc ('k') | remoting/host/it2me/it2me_native_messaging_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698