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

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

Issue 9117038: Convert all remaining explicit LeakyLazyInstanceTraits users to ::Leaky (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 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/local_input_monitor_mac.mm ('k') | remoting/host/plugin/host_log_handler.cc » ('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) 2012 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/local_input_monitor_thread_win.h" 5 #include "remoting/host/local_input_monitor_thread_win.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 11
12 using namespace remoting; 12 using namespace remoting;
13 13
14 namespace { 14 namespace {
15 LocalInputMonitorThread* g_local_input_monitor_thread = NULL; 15 LocalInputMonitorThread* g_local_input_monitor_thread = NULL;
16 base::LazyInstance<base::Lock, 16 base::LazyInstance<base::Lock>::Leaky g_thread_lock = LAZY_INSTANCE_INITIALIZER;
17 base::LeakyLazyInstanceTraits<base::Lock> >
18 g_thread_lock = LAZY_INSTANCE_INITIALIZER;
19 } // namespace 17 } // namespace
20 18
21 19
22 LocalInputMonitorThread::LocalInputMonitorThread() 20 LocalInputMonitorThread::LocalInputMonitorThread()
23 : base::SimpleThread("LocalInputMonitor") { 21 : base::SimpleThread("LocalInputMonitor") {
24 } 22 }
25 23
26 LocalInputMonitorThread::~LocalInputMonitorThread() { 24 LocalInputMonitorThread::~LocalInputMonitorThread() {
27 DCHECK(hosts_.empty()); 25 DCHECK(hosts_.empty());
28 } 26 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 105
108 void LocalInputMonitorThread::RemoveHostFromInputMonitor(ChromotingHost* host) { 106 void LocalInputMonitorThread::RemoveHostFromInputMonitor(ChromotingHost* host) {
109 DCHECK(g_local_input_monitor_thread); 107 DCHECK(g_local_input_monitor_thread);
110 base::AutoLock lock(g_thread_lock.Get()); 108 base::AutoLock lock(g_thread_lock.Get());
111 if (g_local_input_monitor_thread->RemoveHost(host)) { 109 if (g_local_input_monitor_thread->RemoveHost(host)) {
112 g_local_input_monitor_thread->Stop(); 110 g_local_input_monitor_thread->Stop();
113 delete g_local_input_monitor_thread; 111 delete g_local_input_monitor_thread;
114 g_local_input_monitor_thread = NULL; 112 g_local_input_monitor_thread = NULL;
115 } 113 }
116 } 114 }
OLDNEW
« no previous file with comments | « remoting/host/local_input_monitor_mac.mm ('k') | remoting/host/plugin/host_log_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698