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

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

Issue 2837863004: Use base::OneShotTimer instead of base::Timer(false, false)
Patch Set: rebase Created 3 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 | « remoting/host/mouse_shape_pump.h ('k') | remoting/host/security_key/security_key_socket.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 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/mouse_shape_pump.h" 5 #include "remoting/host/mouse_shape_pump.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/timer/timer.h" 11 #include "base/timer/timer.h"
12 #include "remoting/proto/control.pb.h" 12 #include "remoting/proto/control.pb.h"
13 #include "remoting/protocol/cursor_shape_stub.h" 13 #include "remoting/protocol/cursor_shape_stub.h"
14 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 14 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
15 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" 15 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h"
16 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" 16 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h"
17 17
18 namespace remoting { 18 namespace remoting {
19 19
20 // Poll mouse shape 10 times a second. 20 // Poll mouse shape 10 times a second.
21 static const int kCursorCaptureIntervalMs = 100; 21 static const int kCursorCaptureIntervalMs = 100;
22 22
23 MouseShapePump::MouseShapePump( 23 MouseShapePump::MouseShapePump(
24 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor, 24 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor,
25 protocol::CursorShapeStub* cursor_shape_stub) 25 protocol::CursorShapeStub* cursor_shape_stub)
26 : mouse_cursor_monitor_(std::move(mouse_cursor_monitor)), 26 : mouse_cursor_monitor_(std::move(mouse_cursor_monitor)),
27 cursor_shape_stub_(cursor_shape_stub), 27 cursor_shape_stub_(cursor_shape_stub) {
28 capture_timer_(true, true) {
29 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY); 28 mouse_cursor_monitor_->Init(this, webrtc::MouseCursorMonitor::SHAPE_ONLY);
30 capture_timer_.Start( 29 capture_timer_.Start(
31 FROM_HERE, base::TimeDelta::FromMilliseconds(kCursorCaptureIntervalMs), 30 FROM_HERE, base::TimeDelta::FromMilliseconds(kCursorCaptureIntervalMs),
32 base::Bind(&MouseShapePump::Capture, base::Unretained(this))); 31 base::Bind(&MouseShapePump::Capture, base::Unretained(this)));
33 } 32 }
34 33
35 MouseShapePump::~MouseShapePump() {} 34 MouseShapePump::~MouseShapePump() {}
36 35
37 void MouseShapePump::Capture() { 36 void MouseShapePump::Capture() {
38 DCHECK(thread_checker_.CalledOnValidThread()); 37 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 27 matching lines...) Expand all
66 } 65 }
67 66
68 void MouseShapePump::OnMouseCursorPosition( 67 void MouseShapePump::OnMouseCursorPosition(
69 webrtc::MouseCursorMonitor::CursorState state, 68 webrtc::MouseCursorMonitor::CursorState state,
70 const webrtc::DesktopVector& position) { 69 const webrtc::DesktopVector& position) {
71 // We're not subscribing to mouse position changes. 70 // We're not subscribing to mouse position changes.
72 NOTREACHED(); 71 NOTREACHED();
73 } 72 }
74 73
75 } // namespace remoting 74 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/mouse_shape_pump.h ('k') | remoting/host/security_key/security_key_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698