OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/win/elevated_native_messaging_host.h" | 5 #include "remoting/host/win/elevated_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 14 matching lines...) Expand all Loading... |
25 intptr_t parent_window_handle, | 25 intptr_t parent_window_handle, |
26 bool elevate_process, | 26 bool elevate_process, |
27 base::TimeDelta host_timeout, | 27 base::TimeDelta host_timeout, |
28 extensions::NativeMessageHost::Client* client) | 28 extensions::NativeMessageHost::Client* client) |
29 : host_binary_path_(binary_path), | 29 : host_binary_path_(binary_path), |
30 parent_window_handle_(parent_window_handle), | 30 parent_window_handle_(parent_window_handle), |
31 elevate_host_process_(elevate_process), | 31 elevate_host_process_(elevate_process), |
32 host_process_timeout_(host_timeout), | 32 host_process_timeout_(host_timeout), |
33 client_(client) {} | 33 client_(client) {} |
34 | 34 |
35 ElevatedNativeMessagingHost::~ElevatedNativeMessagingHost() {} | 35 ElevatedNativeMessagingHost::~ElevatedNativeMessagingHost() { |
| 36 DCHECK(thread_checker_.CalledOnValidThread()); |
| 37 } |
36 | 38 |
37 void ElevatedNativeMessagingHost::OnMessage( | 39 void ElevatedNativeMessagingHost::OnMessage( |
38 std::unique_ptr<base::Value> message) { | 40 std::unique_ptr<base::Value> message) { |
39 DCHECK(thread_checker_.CalledOnValidThread()); | 41 DCHECK(thread_checker_.CalledOnValidThread()); |
40 | 42 |
41 // Simply pass along the response from the elevated host to the client. | 43 // Simply pass along the response from the elevated host to the client. |
42 std::string message_json; | 44 std::string message_json; |
43 base::JSONWriter::Write(*message, &message_json); | 45 base::JSONWriter::Write(*message, &message_json); |
44 client_->PostMessageFromNativeHost(message_json); | 46 client_->PostMessageFromNativeHost(message_json); |
45 } | 47 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 89 } |
88 | 90 |
89 void ElevatedNativeMessagingHost::DisconnectHost() { | 91 void ElevatedNativeMessagingHost::DisconnectHost() { |
90 DCHECK(thread_checker_.CalledOnValidThread()); | 92 DCHECK(thread_checker_.CalledOnValidThread()); |
91 | 93 |
92 // This will send an EOF to the elevated host, triggering its shutdown. | 94 // This will send an EOF to the elevated host, triggering its shutdown. |
93 elevated_channel_.reset(); | 95 elevated_channel_.reset(); |
94 } | 96 } |
95 | 97 |
96 } // namespace remoting | 98 } // namespace remoting |
OLD | NEW |