OLD | NEW |
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/plugin/host_script_object.h" | 5 #include "remoting/host/plugin/host_script_object.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 host_context_.reset(); | 127 host_context_.reset(); |
128 } | 128 } |
129 | 129 |
130 worker_thread_.Stop(); | 130 worker_thread_.Stop(); |
131 } | 131 } |
132 | 132 |
133 bool HostNPScriptObject::Init() { | 133 bool HostNPScriptObject::Init() { |
134 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 134 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
135 VLOG(2) << "Init"; | 135 VLOG(2) << "Init"; |
136 | 136 |
137 host_context_.reset(new ChromotingHostContext(NULL, | 137 host_context_.reset(new ChromotingHostContext(plugin_message_loop_proxy_)); |
138 plugin_message_loop_proxy_)); | |
139 if (!host_context_->Start()) { | 138 if (!host_context_->Start()) { |
140 host_context_.reset(); | 139 host_context_.reset(); |
141 return false; | 140 return false; |
142 } | 141 } |
143 | 142 |
144 nat_policy_.reset( | 143 nat_policy_.reset( |
145 policy_hack::NatPolicy::Create(host_context_->network_message_loop())); | 144 policy_hack::NatPolicy::Create(host_context_->network_message_loop())); |
146 nat_policy_->StartWatching( | 145 nat_policy_->StartWatching( |
147 base::Bind(&HostNPScriptObject::OnNatPolicyUpdate, | 146 base::Bind(&HostNPScriptObject::OnNatPolicyUpdate, |
148 base::Unretained(this))); | 147 base::Unretained(this))); |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 return is_good; | 1119 return is_good; |
1121 } | 1120 } |
1122 | 1121 |
1123 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1122 void HostNPScriptObject::SetException(const std::string& exception_string) { |
1124 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 1123 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
1125 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1124 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
1126 LOG(INFO) << exception_string; | 1125 LOG(INFO) << exception_string; |
1127 } | 1126 } |
1128 | 1127 |
1129 } // namespace remoting | 1128 } // namespace remoting |
OLD | NEW |