OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | |
6 #define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "base/threading/non_thread_safe.h" | |
12 #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" | |
13 | |
14 namespace base { | |
15 class SingleThreadTaskRunner; | |
16 } // namespace base | |
17 | |
18 namespace remoting { | |
19 | |
20 namespace protocol { | |
21 class CursorShapeInfo; | |
22 } // namespace protocol | |
23 | |
24 // DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on | |
25 // the capturer thread and then returning results to the caller's thread. | |
26 class DesktopCapturerProxy : public base::NonThreadSafe, | |
Wez
2015/02/12 21:59:15
According to Lukasz, ThreadChecker member is prefe
Sergey Ulanov
2015/02/13 08:39:44
Done, though I think NonThreadSafe is better for r
| |
27 public webrtc::DesktopCapturer { | |
Wez
2015/02/12 21:59:15
nit: Indentation
Sergey Ulanov
2015/02/13 08:39:44
Done.
| |
28 public: | |
29 DesktopCapturerProxy( | |
30 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | |
31 scoped_ptr<webrtc::DesktopCapturer> capturer); | |
32 ~DesktopCapturerProxy(); | |
33 | |
34 // webrtc::DesktopCapturer interface. | |
35 void Start(Callback* callback) override; | |
36 void Capture(const webrtc::DesktopRegion& rect) override; | |
37 | |
38 private: | |
39 class Core; | |
40 | |
41 void OnFrameCaptured(scoped_ptr<webrtc::DesktopFrame> frame); | |
42 | |
43 scoped_ptr<Core> core_; | |
44 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | |
45 webrtc::DesktopCapturer::Callback* callback_; | |
46 | |
47 base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); | |
50 }; | |
51 | |
52 } // namespace remoting | |
53 | |
54 #endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ | |
OLD | NEW |