OLD | NEW |
---|---|
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/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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 std::string message = remoting::GetTimestampString(); | 431 std::string message = remoting::GetTimestampString(); |
432 message += (str.c_str() + message_start); | 432 message += (str.c_str() + message_start); |
433 // |log_proxy_| is safe to use here because we detach the proxy before | 433 // |log_proxy_| is safe to use here because we detach the proxy before |
434 // tearing down the |g_logging_instance|. | 434 // tearing down the |g_logging_instance|. |
435 g_logging_instance->log_proxy_->Call( | 435 g_logging_instance->log_proxy_->Call( |
436 base::Bind(&ChromotingInstance::ProcessLogToUI, | 436 base::Bind(&ChromotingInstance::ProcessLogToUI, |
437 base::Unretained(g_logging_instance), message)); | 437 base::Unretained(g_logging_instance), message)); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 // Call the next log handler in the chain. | |
441 if (g_logging_old_handler) | 442 if (g_logging_old_handler) |
442 return (g_logging_old_handler)(severity, file, line, message_start, str); | 443 return (g_logging_old_handler)(severity, file, line, message_start, str); |
443 return false; | 444 return false; |
444 } | 445 } |
445 | 446 |
446 void ChromotingInstance::ProcessLogToUI(const std::string& message) { | 447 void ChromotingInstance::ProcessLogToUI(const std::string& message) { |
448 // |g_logging_to_plugin| is only referenced in this method and only on the | |
Wez
2011/08/30 05:20:02
nit: It's not relevant that it's only referenced h
garykac
2011/08/31 00:59:00
Actually, |g_logging_to_plugin| doesn't work as in
| |
449 // main plugin thread, so we don't need a lock to access to it. | |
447 if (!g_logging_to_plugin) { | 450 if (!g_logging_to_plugin) { |
448 ChromotingScriptableObject* cso = GetScriptableObject(); | 451 ChromotingScriptableObject* cso = GetScriptableObject(); |
449 if (cso) { | 452 if (cso) { |
450 g_logging_to_plugin = true; | 453 g_logging_to_plugin = true; |
451 cso->LogDebugInfo(message); | 454 cso->LogDebugInfo(message); |
452 g_logging_to_plugin = false; | 455 g_logging_to_plugin = false; |
453 } | 456 } |
454 } | 457 } |
455 } | 458 } |
456 | 459 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
547 } | 550 } |
548 | 551 |
549 initial_policy_received_ = true; | 552 initial_policy_received_ = true; |
550 enable_client_nat_traversal_ = traversal_policy; | 553 enable_client_nat_traversal_ = traversal_policy; |
551 | 554 |
552 if (delayed_connect_.get()) | 555 if (delayed_connect_.get()) |
553 plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); | 556 plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); |
554 } | 557 } |
555 | 558 |
556 } // namespace remoting | 559 } // namespace remoting |
OLD | NEW |