| 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/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <nacl_io/nacl_io.h> | 10 #include <nacl_io/nacl_io.h> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 PP_Instance g_logging_instance = 0; | 131 PP_Instance g_logging_instance = 0; |
| 132 base::LazyInstance<base::Lock>::Leaky g_logging_lock = | 132 base::LazyInstance<base::Lock>::Leaky g_logging_lock = |
| 133 LAZY_INSTANCE_INITIALIZER; | 133 LAZY_INSTANCE_INITIALIZER; |
| 134 | 134 |
| 135 } // namespace | 135 } // namespace |
| 136 | 136 |
| 137 ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) | 137 ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) |
| 138 : pp::Instance(pp_instance), | 138 : pp::Instance(pp_instance), |
| 139 initialized_(false), | 139 initialized_(false), |
| 140 plugin_task_runner_(new PluginThreadTaskRunner(&plugin_thread_delegate_)), | 140 plugin_task_runner_(new MainPluginThreadTaskRunner()), |
| 141 context_(plugin_task_runner_.get()), | 141 context_(plugin_task_runner_.get()), |
| 142 input_tracker_(&mouse_input_filter_), | 142 input_tracker_(&mouse_input_filter_), |
| 143 touch_input_scaler_(&input_tracker_), | 143 touch_input_scaler_(&input_tracker_), |
| 144 key_mapper_(&touch_input_scaler_), | 144 key_mapper_(&touch_input_scaler_), |
| 145 input_handler_(&input_tracker_), | 145 input_handler_(&input_tracker_), |
| 146 cursor_setter_(this), | 146 cursor_setter_(this), |
| 147 empty_cursor_filter_(&cursor_setter_), | 147 empty_cursor_filter_(&cursor_setter_), |
| 148 text_input_controller_(this), | 148 text_input_controller_(this), |
| 149 use_async_pin_dialog_(false), | 149 use_async_pin_dialog_(false), |
| 150 weak_factory_(this) { | 150 weak_factory_(this) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 ChromotingInstance::~ChromotingInstance() { | 185 ChromotingInstance::~ChromotingInstance() { |
| 186 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 186 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
| 187 | 187 |
| 188 // Disconnect the client. | 188 // Disconnect the client. |
| 189 Disconnect(); | 189 Disconnect(); |
| 190 | 190 |
| 191 // Unregister this instance so that debug log messages will no longer be sent | 191 // Unregister this instance so that debug log messages will no longer be sent |
| 192 // to it. This will stop all logging in all Chromoting instances. | 192 // to it. This will stop all logging in all Chromoting instances. |
| 193 UnregisterLoggingInstance(); | 193 UnregisterLoggingInstance(); |
| 194 | 194 |
| 195 plugin_task_runner_->Quit(); | |
| 196 | |
| 197 // Ensure that nothing touches the plugin thread delegate after this point. | |
| 198 plugin_task_runner_->DetachAndRunShutdownLoop(); | |
| 199 | |
| 200 // Stopping the context shuts down all chromoting threads. | 195 // Stopping the context shuts down all chromoting threads. |
| 201 context_.Stop(); | 196 context_.Stop(); |
| 202 } | 197 } |
| 203 | 198 |
| 204 bool ChromotingInstance::Init(uint32_t argc, | 199 bool ChromotingInstance::Init(uint32_t argc, |
| 205 const char* argn[], | 200 const char* argn[], |
| 206 const char* argv[]) { | 201 const char* argv[]) { |
| 207 CHECK(!initialized_); | 202 CHECK(!initialized_); |
| 208 initialized_ = true; | 203 initialized_ = true; |
| 209 | 204 |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 if (is_custom_counts_histogram) { | 1140 if (is_custom_counts_histogram) { |
| 1146 uma.HistogramCustomCounts(histogram_name, value, histogram_min, | 1141 uma.HistogramCustomCounts(histogram_name, value, histogram_min, |
| 1147 histogram_max, histogram_buckets); | 1142 histogram_max, histogram_buckets); |
| 1148 } else { | 1143 } else { |
| 1149 uma.HistogramCustomTimes(histogram_name, value, histogram_min, | 1144 uma.HistogramCustomTimes(histogram_name, value, histogram_min, |
| 1150 histogram_max, histogram_buckets); | 1145 histogram_max, histogram_buckets); |
| 1151 } | 1146 } |
| 1152 } | 1147 } |
| 1153 | 1148 |
| 1154 } // namespace remoting | 1149 } // namespace remoting |
| OLD | NEW |