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

Side by Side Diff: media/base/user_input_monitor.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: android Created 4 years, 7 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
« no previous file with comments | « media/base/user_input_monitor.h ('k') | media/base/user_input_monitor_linux.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/base/user_input_monitor.h" 5 #include "media/base/user_input_monitor.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 #ifdef DISABLE_USER_INPUT_MONITOR 11 #ifdef DISABLE_USER_INPUT_MONITOR
12 scoped_ptr<UserInputMonitor> UserInputMonitor::Create( 12 std::unique_ptr<UserInputMonitor> UserInputMonitor::Create(
13 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 13 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
14 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { 14 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) {
15 return scoped_ptr<UserInputMonitor>(); 15 return nullptr;
16 } 16 }
17 #endif // DISABLE_USER_INPUT_MONITOR 17 #endif // DISABLE_USER_INPUT_MONITOR
18 18
19 UserInputMonitor::UserInputMonitor() 19 UserInputMonitor::UserInputMonitor()
20 : key_press_counter_references_(0), 20 : key_press_counter_references_(0),
21 mouse_listeners_count_(0), 21 mouse_listeners_count_(0),
22 mouse_listeners_(new MouseListenerList()) {} 22 mouse_listeners_(new MouseListenerList()) {}
23 23
24 UserInputMonitor::~UserInputMonitor() { 24 UserInputMonitor::~UserInputMonitor() {
25 DCHECK_EQ(0u, key_press_counter_references_); 25 DCHECK_EQ(0u, key_press_counter_references_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 base::AutoLock auto_lock(lock_); 64 base::AutoLock auto_lock(lock_);
65 DCHECK_NE(key_press_counter_references_, 0u); 65 DCHECK_NE(key_press_counter_references_, 0u);
66 --key_press_counter_references_; 66 --key_press_counter_references_;
67 if (key_press_counter_references_ == 0) { 67 if (key_press_counter_references_ == 0) {
68 StopKeyboardMonitoring(); 68 StopKeyboardMonitoring();
69 DVLOG(2) << "Stopped keyboard monitoring."; 69 DVLOG(2) << "Stopped keyboard monitoring.";
70 } 70 }
71 } 71 }
72 72
73 } // namespace media 73 } // namespace media
OLDNEW
« no previous file with comments | « media/base/user_input_monitor.h ('k') | media/base/user_input_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698