| OLD | NEW | 
|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/native_messaging/log_message_handler.h" | 5 #include "remoting/host/native_messaging/log_message_handler.h" | 
| 6 | 6 | 
| 7 #include "base/bind.h" | 7 #include "base/bind.h" | 
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" | 
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" | 
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" | 
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" | 
| 12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" | 
| 13 | 13 | 
| 14 namespace remoting { | 14 namespace remoting { | 
| 15 | 15 | 
| 16 namespace { | 16 namespace { | 
| 17 // Log message handler registration and deregistration is not thread-safe. | 17 // Log message handler registration and deregistration is not thread-safe. | 
| 18 // This lock must be held in order to set or restore a log message handler, | 18 // This lock must be held in order to set or restore a log message handler, | 
| 19 // and when accessing the pointer to the LogMessageHandler instance. | 19 // and when accessing the pointer to the LogMessageHandler instance. | 
| 20 base::LazyInstance<base::Lock>::Leaky g_log_message_handler_lock = | 20 base::LazyInstance<base::Lock>::Leaky g_log_message_handler_lock = | 
| 21     LAZY_INSTANCE_INITIALIZER; | 21     LAZY_INSTANCE_INITIALIZER; | 
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 123   dictionary->SetString("message", message); | 123   dictionary->SetString("message", message); | 
| 124   dictionary->SetString("file", file); | 124   dictionary->SetString("file", file); | 
| 125   dictionary->SetInteger("line", line); | 125   dictionary->SetInteger("line", line); | 
| 126 | 126 | 
| 127   delegate_.Run(std::move(dictionary)); | 127   delegate_.Run(std::move(dictionary)); | 
| 128 | 128 | 
| 129   suppress_logging_ = false; | 129   suppress_logging_ = false; | 
| 130 } | 130 } | 
| 131 | 131 | 
| 132 }  // namespace remoting | 132 }  // namespace remoting | 
| OLD | NEW | 
|---|