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

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

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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/fake_host_extension.cc ('k') | remoting/host/gcd_rest_client.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/fake_mouse_cursor_monitor.h" 5 #include "remoting/host/fake_mouse_cursor_monitor.h"
6 6
7 #include <memory>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 10 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
11 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" 12 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h"
12 13
13 namespace remoting { 14 namespace remoting {
14 15
15 FakeMouseCursorMonitor::FakeMouseCursorMonitor() : callback_(nullptr) {} 16 FakeMouseCursorMonitor::FakeMouseCursorMonitor() : callback_(nullptr) {}
16 17
17 FakeMouseCursorMonitor::~FakeMouseCursorMonitor() {} 18 FakeMouseCursorMonitor::~FakeMouseCursorMonitor() {}
18 19
19 void FakeMouseCursorMonitor::Init( 20 void FakeMouseCursorMonitor::Init(
20 webrtc::MouseCursorMonitor::Callback* callback, 21 webrtc::MouseCursorMonitor::Callback* callback,
21 webrtc::MouseCursorMonitor::Mode mode) { 22 webrtc::MouseCursorMonitor::Mode mode) {
22 DCHECK(!callback_); 23 DCHECK(!callback_);
23 DCHECK(callback); 24 DCHECK(callback);
24 25
25 // Only shapes supported right now. 26 // Only shapes supported right now.
26 CHECK(mode == SHAPE_ONLY); 27 CHECK(mode == SHAPE_ONLY);
27 28
28 callback_ = callback; 29 callback_ = callback;
29 } 30 }
30 31
31 void FakeMouseCursorMonitor::Capture() { 32 void FakeMouseCursorMonitor::Capture() {
32 DCHECK(callback_); 33 DCHECK(callback_);
33 34
34 const int kWidth = 32; 35 const int kWidth = 32;
35 const int kHeight = 32; 36 const int kHeight = 32;
36 37
37 scoped_ptr<webrtc::DesktopFrame> desktop_frame( 38 std::unique_ptr<webrtc::DesktopFrame> desktop_frame(
38 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight))); 39 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight)));
39 memset(desktop_frame->data(), 0xFF, 40 memset(desktop_frame->data(), 0xFF,
40 webrtc::DesktopFrame::kBytesPerPixel * kWidth * kHeight); 41 webrtc::DesktopFrame::kBytesPerPixel * kWidth * kHeight);
41 42
42 scoped_ptr<webrtc::MouseCursor> mouse_cursor( 43 std::unique_ptr<webrtc::MouseCursor> mouse_cursor(new webrtc::MouseCursor(
43 new webrtc::MouseCursor(desktop_frame.release(), 44 desktop_frame.release(), webrtc::DesktopVector()));
44 webrtc::DesktopVector()));
45 45
46 callback_->OnMouseCursor(mouse_cursor.release()); 46 callback_->OnMouseCursor(mouse_cursor.release());
47 } 47 }
48 48
49 } // namespace remoting 49 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/fake_host_extension.cc ('k') | remoting/host/gcd_rest_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698