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

Side by Side Diff: remoting/host/plugin/host_script_object.cc

Issue 10830016: Replace PluginMessageLoopProxy with PluginThreadTaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/plugin/host_script_object.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // We may need to have more than one task running at the same time 72 // We may need to have more than one task running at the same time
73 // (e.g. key generation and status update), yet unlikely to ever need 73 // (e.g. key generation and status update), yet unlikely to ever need
74 // more than 2 threads. 74 // more than 2 threads.
75 const int kMaxWorkerPoolThreads = 2; 75 const int kMaxWorkerPoolThreads = 2;
76 76
77 } // namespace 77 } // namespace
78 78
79 HostNPScriptObject::HostNPScriptObject( 79 HostNPScriptObject::HostNPScriptObject(
80 NPP plugin, 80 NPP plugin,
81 NPObject* parent, 81 NPObject* parent,
82 PluginMessageLoopProxy::Delegate* plugin_thread_delegate) 82 PluginThreadTaskRunner::Delegate* plugin_thread_delegate)
83 : plugin_(plugin), 83 : plugin_(plugin),
84 parent_(parent), 84 parent_(parent),
85 am_currently_logging_(false), 85 am_currently_logging_(false),
86 state_(kDisconnected), 86 state_(kDisconnected),
87 np_thread_id_(base::PlatformThread::CurrentId()), 87 np_thread_id_(base::PlatformThread::CurrentId()),
88 plugin_task_runner_( 88 plugin_task_runner_(
89 new PluginMessageLoopProxy(plugin_thread_delegate)), 89 new PluginThreadTaskRunner(plugin_thread_delegate)),
90 failed_login_attempts_(0), 90 failed_login_attempts_(0),
91 disconnected_event_(true, false), 91 disconnected_event_(true, false),
92 nat_traversal_enabled_(false), 92 nat_traversal_enabled_(false),
93 policy_received_(false), 93 policy_received_(false),
94 daemon_controller_(DaemonController::Create()), 94 daemon_controller_(DaemonController::Create()),
95 worker_thread_("RemotingHostPlugin") { 95 worker_thread_("RemotingHostPlugin") {
96 worker_thread_.Start(); 96 worker_thread_.Start();
97 } 97 }
98 98
99 HostNPScriptObject::~HostNPScriptObject() { 99 HostNPScriptObject::~HostNPScriptObject() {
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 return is_good; 1256 return is_good;
1257 } 1257 }
1258 1258
1259 void HostNPScriptObject::SetException(const std::string& exception_string) { 1259 void HostNPScriptObject::SetException(const std::string& exception_string) {
1260 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); 1260 DCHECK(plugin_task_runner_->BelongsToCurrentThread());
1261 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); 1261 g_npnetscape_funcs->setexception(parent_, exception_string.c_str());
1262 LOG(INFO) << exception_string; 1262 LOG(INFO) << exception_string;
1263 } 1263 }
1264 1264
1265 } // namespace remoting 1265 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/plugin/host_script_object.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698