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 #include "remoting/host/plugin/daemon_controller.h" | 6 #include "remoting/host/plugin/daemon_controller.h" |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Stops all threads. | 108 // Stops all threads. |
109 host_context_.reset(); | 109 host_context_.reset(); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 bool HostNPScriptObject::Init() { | 113 bool HostNPScriptObject::Init() { |
114 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); | 114 DCHECK(plugin_message_loop_proxy_->BelongsToCurrentThread()); |
115 VLOG(2) << "Init"; | 115 VLOG(2) << "Init"; |
116 | 116 |
117 host_context_.reset(new ChromotingHostContext(plugin_message_loop_proxy_)); | 117 host_context_.reset(new ChromotingHostContext(NULL, |
| 118 plugin_message_loop_proxy_)); |
118 if (!host_context_->Start()) { | 119 if (!host_context_->Start()) { |
119 host_context_.reset(); | 120 host_context_.reset(); |
120 return false; | 121 return false; |
121 } | 122 } |
122 | 123 |
123 nat_policy_.reset( | 124 nat_policy_.reset( |
124 policy_hack::NatPolicy::Create(host_context_->network_message_loop())); | 125 policy_hack::NatPolicy::Create(host_context_->network_message_loop())); |
125 nat_policy_->StartWatching( | 126 nat_policy_->StartWatching( |
126 base::Bind(&HostNPScriptObject::OnNatPolicyUpdate, | 127 base::Bind(&HostNPScriptObject::OnNatPolicyUpdate, |
127 base::Unretained(this))); | 128 base::Unretained(this))); |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 uint32_t argCount) { | 881 uint32_t argCount) { |
881 NPVariant np_result; | 882 NPVariant np_result; |
882 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, | 883 bool is_good = g_npnetscape_funcs->invokeDefault(plugin_, func, args, |
883 argCount, &np_result); | 884 argCount, &np_result); |
884 if (is_good) | 885 if (is_good) |
885 g_npnetscape_funcs->releasevariantvalue(&np_result); | 886 g_npnetscape_funcs->releasevariantvalue(&np_result); |
886 return is_good; | 887 return is_good; |
887 } | 888 } |
888 | 889 |
889 } // namespace remoting | 890 } // namespace remoting |
OLD | NEW |