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

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

Issue 7617001: Fix a weeny leak in the Host plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | no next file » | 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/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/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/threading/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "remoting/base/auth_token_util.h" 10 #include "remoting/base/auth_token_util.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return; 555 return;
556 556
557 if (!host_context_.IsUIThread()) { 557 if (!host_context_.IsUIThread()) {
558 host_context_.PostTaskToUIThread( 558 host_context_.PostTaskToUIThread(
559 FROM_HERE, base::Bind(&HostNPScriptObject::LogDebugInfo, 559 FROM_HERE, base::Bind(&HostNPScriptObject::LogDebugInfo,
560 base::Unretained(this), message)); 560 base::Unretained(this), message));
561 return; 561 return;
562 } 562 }
563 563
564 if (log_debug_info_func_) { 564 if (log_debug_info_func_) {
565 NPVariant* arg = new NPVariant(); 565 NPVariant log_message;
566 STRINGZ_TO_NPVARIANT(message.c_str(), *arg); 566 STRINGZ_TO_NPVARIANT(message.c_str(), log_message);
567 bool is_good = InvokeAndIgnoreResult(log_debug_info_func_, arg, 1); 567 bool is_good = InvokeAndIgnoreResult(log_debug_info_func_,
568 &log_message, 1);
568 LOG_IF(ERROR, !is_good) << "LogDebugInfo failed"; 569 LOG_IF(ERROR, !is_good) << "LogDebugInfo failed";
569 } 570 }
570 } 571 }
571 572
572 void HostNPScriptObject::SetException(const std::string& exception_string) { 573 void HostNPScriptObject::SetException(const std::string& exception_string) {
573 CHECK_EQ(base::PlatformThread::CurrentId(), np_thread_id_); 574 CHECK_EQ(base::PlatformThread::CurrentId(), np_thread_id_);
574 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); 575 g_npnetscape_funcs->setexception(parent_, exception_string.c_str());
575 LOG(INFO) << exception_string; 576 LOG(INFO) << exception_string;
576 } 577 }
577 578
(...skipping 23 matching lines...) Expand all
601 } 602 }
602 603
603 // static 604 // static
604 void HostNPScriptObject::NPTaskSpringboard(void* task) { 605 void HostNPScriptObject::NPTaskSpringboard(void* task) {
605 base::Closure* real_task = reinterpret_cast<base::Closure*>(task); 606 base::Closure* real_task = reinterpret_cast<base::Closure*>(task);
606 real_task->Run(); 607 real_task->Run();
607 delete real_task; 608 delete real_task;
608 } 609 }
609 610
610 } // namespace remoting 611 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698