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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host.cc

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 11 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 <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 ProcessIncomingIq(std::move(message_dict), std::move(response)); 152 ProcessIncomingIq(std::move(message_dict), std::move(response));
153 } else { 153 } else {
154 SendErrorAndExit(std::move(response), "Unsupported request type: " + type); 154 SendErrorAndExit(std::move(response), "Unsupported request type: " + type);
155 } 155 }
156 } 156 }
157 157
158 void It2MeNativeMessagingHost::Start(Client* client) { 158 void It2MeNativeMessagingHost::Start(Client* client) {
159 DCHECK(task_runner()->BelongsToCurrentThread()); 159 DCHECK(task_runner()->BelongsToCurrentThread());
160 client_ = client; 160 client_ = client;
161 #if !defined(OS_CHROMEOS) 161 #if !defined(OS_CHROMEOS)
162 log_message_handler_.reset( 162 log_message_listener_.reset(new LogMessageListener(base::Bind(
163 new LogMessageHandler( 163 &It2MeNativeMessagingHost::SendMessageToClient, base::Unretained(this))));
164 base::Bind(&It2MeNativeMessagingHost::SendMessageToClient,
165 base::Unretained(this))));
166 #endif // !defined(OS_CHROMEOS) 164 #endif // !defined(OS_CHROMEOS)
167 } 165 }
168 166
169 void It2MeNativeMessagingHost::SendMessageToClient( 167 void It2MeNativeMessagingHost::SendMessageToClient(
170 std::unique_ptr<base::Value> message) const { 168 std::unique_ptr<base::Value> message) const {
171 DCHECK(task_runner()->BelongsToCurrentThread()); 169 DCHECK(task_runner()->BelongsToCurrentThread());
172 std::string message_json; 170 std::string message_json;
173 base::JSONWriter::Write(*message, &message_json); 171 base::JSONWriter::Write(*message, &message_json);
174 client_->PostMessageFromNativeHost(message_json); 172 client_->PostMessageFromNativeHost(message_json);
175 } 173 }
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 526
529 bool It2MeNativeMessagingHost::DelegateToElevatedHost( 527 bool It2MeNativeMessagingHost::DelegateToElevatedHost(
530 std::unique_ptr<base::DictionaryValue> message) { 528 std::unique_ptr<base::DictionaryValue> message) {
531 NOTREACHED(); 529 NOTREACHED();
532 return false; 530 return false;
533 } 531 }
534 532
535 #endif // !defined(OS_WIN) 533 #endif // !defined(OS_WIN)
536 534
537 } // namespace remoting 535 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.h ('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