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

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

Issue 7134023: Notify calling web-app when Host plugin becomes connected to a client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove blank line from rebase. Created 9 years, 6 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/host_script_object.h ('k') | remoting/host/host_status_observer.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/host_script_object.h" 5 #include "remoting/host/host_script_object.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 void HostNPScriptObject::OnAccessDenied() { 278 void HostNPScriptObject::OnAccessDenied() {
279 DCHECK_EQ(MessageLoop::current(), host_context_.network_message_loop()); 279 DCHECK_EQ(MessageLoop::current(), host_context_.network_message_loop());
280 280
281 ++failed_login_attempts_; 281 ++failed_login_attempts_;
282 if (failed_login_attempts_ == kMaxLoginAttempts) 282 if (failed_login_attempts_ == kMaxLoginAttempts)
283 DisconnectInternal(); 283 DisconnectInternal();
284 } 284 }
285 285
286 void HostNPScriptObject::OnAuthenticatedClientsChanged(int clients_connected) {
287 DCHECK_NE(base::PlatformThread::CurrentId(), np_thread_id_);
288 OnStateChanged(clients_connected ? kConnected : kDisconnected);
289 }
290
286 void HostNPScriptObject::OnShutdown() { 291 void HostNPScriptObject::OnShutdown() {
287 DCHECK_EQ(MessageLoop::current(), host_context_.main_message_loop()); 292 DCHECK_EQ(MessageLoop::current(), host_context_.main_message_loop());
288 293
289 OnStateChanged(kDisconnected); 294 OnStateChanged(kDisconnected);
290 } 295 }
291 296
292 // string uid, string auth_token 297 // string uid, string auth_token
293 bool HostNPScriptObject::Connect(const NPVariant* args, 298 bool HostNPScriptObject::Connect(const NPVariant* args,
294 uint32_t arg_count, 299 uint32_t arg_count,
295 NPVariant* result) { 300 NPVariant* result) {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 task); 519 task);
515 } 520 }
516 521
517 void HostNPScriptObject::NPTaskSpringboard(void* task) { 522 void HostNPScriptObject::NPTaskSpringboard(void* task) {
518 Task* real_task = reinterpret_cast<Task*>(task); 523 Task* real_task = reinterpret_cast<Task*>(task);
519 real_task->Run(); 524 real_task->Run();
520 delete real_task; 525 delete real_task;
521 } 526 }
522 527
523 } // namespace remoting 528 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_script_object.h ('k') | remoting/host/host_status_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698