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

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

Issue 2080723008: [Chromoting] Use device::PowerSaveBlocker to block screen saver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "device/power_save_blocker/power_save_blocker.h"
14 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" 15 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
15 16
16 namespace base { 17 namespace base {
18 class SequencedTaskRunner;
17 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
18 } // namespace base 20 } // namespace base
19 21
20 namespace webrtc { 22 namespace webrtc {
21 class DesktopCaptureOptions; 23 class DesktopCaptureOptions;
22 } // namespace webrtc 24 } // namespace webrtc
23 25
24 namespace remoting { 26 namespace remoting {
25 27
26 namespace protocol { 28 namespace protocol {
27 class CursorShapeInfo; 29 class CursorShapeInfo;
28 } // namespace protocol 30 } // namespace protocol
29 31
30 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on 32 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on
31 // the capturer thread and then returning results to the caller's thread. 33 // the capturer thread and then returning results to the caller's thread.
32 class DesktopCapturerProxy : public webrtc::DesktopCapturer { 34 class DesktopCapturerProxy : public webrtc::DesktopCapturer {
33 public: 35 public:
34 DesktopCapturerProxy( 36 DesktopCapturerProxy(
35 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, 37 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
38 scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
39 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner,
36 const webrtc::DesktopCaptureOptions& options); 40 const webrtc::DesktopCaptureOptions& options);
37 ~DesktopCapturerProxy() override; 41 ~DesktopCapturerProxy() override;
38 42
39 // webrtc::DesktopCapturer interface. 43 // webrtc::DesktopCapturer interface.
40 void Start(Callback* callback) override; 44 void Start(Callback* callback) override;
41 void SetSharedMemoryFactory(std::unique_ptr<webrtc::SharedMemoryFactory> 45 void SetSharedMemoryFactory(std::unique_ptr<webrtc::SharedMemoryFactory>
42 shared_memory_factory) override; 46 shared_memory_factory) override;
43 void Capture(const webrtc::DesktopRegion& rect) override; 47 void Capture(const webrtc::DesktopRegion& rect) override;
44 48
45 private: 49 private:
46 class Core; 50 class Core;
47 51
48 void OnFrameCaptured(webrtc::DesktopCapturer::Result result, 52 void OnFrameCaptured(webrtc::DesktopCapturer::Result result,
49 std::unique_ptr<webrtc::DesktopFrame> frame); 53 std::unique_ptr<webrtc::DesktopFrame> frame);
50 54
51 base::ThreadChecker thread_checker_; 55 base::ThreadChecker thread_checker_;
52 56
53 std::unique_ptr<Core> core_; 57 std::unique_ptr<Core> core_;
54 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; 58 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_;
55 webrtc::DesktopCapturer::Callback* callback_; 59 webrtc::DesktopCapturer::Callback* callback_;
56 60
61 device::PowerSaveBlocker power_save_blocker_;
Sergey Ulanov 2016/06/22 19:05:37 Power-blocking isn't related to screen capturing,
Hzj_jie 2016/06/24 19:14:29 Done.
62
57 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; 63 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_;
58 64
59 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); 65 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy);
60 }; 66 };
61 67
62 } // namespace remoting 68 } // namespace remoting
63 69
64 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ 70 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698