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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } else { | 367 } else { |
368 rectangle_decoder_->SetScaleRatios(1.0, 1.0); | 368 rectangle_decoder_->SetScaleRatios(1.0, 1.0); |
369 } | 369 } |
370 rectangle_decoder_->RefreshFullFrame(); | 370 rectangle_decoder_->RefreshFullFrame(); |
371 } | 371 } |
372 | 372 |
373 // static | 373 // static |
374 void ChromotingInstance::RegisterLogMessageHandler() { | 374 void ChromotingInstance::RegisterLogMessageHandler() { |
375 base::AutoLock lock(g_logging_lock); | 375 base::AutoLock lock(g_logging_lock); |
376 | 376 |
377 LOG(INFO) << "Registering global log handler"; | 377 VLOG(1) << "Registering global log handler"; |
378 | 378 |
379 // Record previous handler so we can call it in a chain. | 379 // Record previous handler so we can call it in a chain. |
380 g_logging_old_handler = logging::GetLogMessageHandler(); | 380 g_logging_old_handler = logging::GetLogMessageHandler(); |
381 | 381 |
382 // Set up log message handler. | 382 // Set up log message handler. |
383 // This is not thread-safe so we need it within our lock. | 383 // This is not thread-safe so we need it within our lock. |
384 logging::SetLogMessageHandler(&LogToUI); | 384 logging::SetLogMessageHandler(&LogToUI); |
385 } | 385 } |
386 | 386 |
387 void ChromotingInstance::RegisterLoggingInstance() { | 387 void ChromotingInstance::RegisterLoggingInstance() { |
(...skipping 11 matching lines...) Expand all Loading... |
399 base::AutoLock lock(g_logging_lock); | 399 base::AutoLock lock(g_logging_lock); |
400 | 400 |
401 // Don't unregister unless we're the currently registered instance. | 401 // Don't unregister unless we're the currently registered instance. |
402 if (this != g_logging_instance) | 402 if (this != g_logging_instance) |
403 return; | 403 return; |
404 | 404 |
405 // Unregister this instance for logging. | 405 // Unregister this instance for logging. |
406 g_has_logging_instance = false; | 406 g_has_logging_instance = false; |
407 g_logging_instance = NULL; | 407 g_logging_instance = NULL; |
408 | 408 |
409 LOG(INFO) << "Unregistering global log handler"; | 409 VLOG(1) << "Unregistering global log handler"; |
410 } | 410 } |
411 | 411 |
412 // static | 412 // static |
413 bool ChromotingInstance::LogToUI(int severity, const char* file, int line, | 413 bool ChromotingInstance::LogToUI(int severity, const char* file, int line, |
414 size_t message_start, | 414 size_t message_start, |
415 const std::string& str) { | 415 const std::string& str) { |
416 // Note that we're reading |g_has_logging_instance| outside of a lock. | 416 // Note that we're reading |g_has_logging_instance| outside of a lock. |
417 // This lockless read is done so that we don't needlessly slow down global | 417 // This lockless read is done so that we don't needlessly slow down global |
418 // logging with a lock for each log message. | 418 // logging with a lock for each log message. |
419 // | 419 // |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 } | 547 } |
548 | 548 |
549 initial_policy_received_ = true; | 549 initial_policy_received_ = true; |
550 enable_client_nat_traversal_ = traversal_policy; | 550 enable_client_nat_traversal_ = traversal_policy; |
551 | 551 |
552 if (delayed_connect_.get()) | 552 if (delayed_connect_.get()) |
553 plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); | 553 plugin_message_loop_->PostTask(FROM_HERE, delayed_connect_.release()); |
554 } | 554 } |
555 | 555 |
556 } // namespace remoting | 556 } // namespace remoting |
OLD | NEW |