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

Side by Side Diff: remoting/host/desktop_capturer_proxy.h

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/daemon_process_win.cc ('k') | remoting/host/desktop_capturer_proxy.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 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ 5 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_
6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ 6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_
7 7
8 #include <memory>
9
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
13 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 14 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
14 15
15 namespace base { 16 namespace base {
16 class SingleThreadTaskRunner; 17 class SingleThreadTaskRunner;
17 } // namespace base 18 } // namespace base
18 19
19 namespace remoting { 20 namespace remoting {
20 21
21 namespace protocol { 22 namespace protocol {
22 class CursorShapeInfo; 23 class CursorShapeInfo;
23 } // namespace protocol 24 } // namespace protocol
24 25
25 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on 26 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on
26 // the capturer thread and then returning results to the caller's thread. 27 // the capturer thread and then returning results to the caller's thread.
27 class DesktopCapturerProxy : public webrtc::DesktopCapturer { 28 class DesktopCapturerProxy : public webrtc::DesktopCapturer {
28 public: 29 public:
29 DesktopCapturerProxy( 30 DesktopCapturerProxy(
30 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, 31 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
31 scoped_ptr<webrtc::DesktopCapturer> capturer); 32 std::unique_ptr<webrtc::DesktopCapturer> capturer);
32 ~DesktopCapturerProxy() override; 33 ~DesktopCapturerProxy() override;
33 34
34 // webrtc::DesktopCapturer interface. 35 // webrtc::DesktopCapturer interface.
35 void Start(Callback* callback) override; 36 void Start(Callback* callback) override;
36 void SetSharedMemoryFactory(rtc::scoped_ptr<webrtc::SharedMemoryFactory> 37 void SetSharedMemoryFactory(rtc::scoped_ptr<webrtc::SharedMemoryFactory>
37 shared_memory_factory) override; 38 shared_memory_factory) override;
38 void Capture(const webrtc::DesktopRegion& rect) override; 39 void Capture(const webrtc::DesktopRegion& rect) override;
39 40
40 private: 41 private:
41 class Core; 42 class Core;
42 43
43 void OnFrameCaptured(scoped_ptr<webrtc::DesktopFrame> frame); 44 void OnFrameCaptured(std::unique_ptr<webrtc::DesktopFrame> frame);
44 45
45 base::ThreadChecker thread_checker_; 46 base::ThreadChecker thread_checker_;
46 47
47 scoped_ptr<Core> core_; 48 std::unique_ptr<Core> core_;
48 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; 49 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
49 webrtc::DesktopCapturer::Callback* callback_; 50 webrtc::DesktopCapturer::Callback* callback_;
50 51
51 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; 52 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); 54 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy);
54 }; 55 };
55 56
56 } // namespace remoting 57 } // namespace remoting
57 58
58 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ 59 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_
OLDNEW
« no previous file with comments | « remoting/host/daemon_process_win.cc ('k') | remoting/host/desktop_capturer_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698