Chromium Code Reviews| Index: remoting/host/desktop_capturer_proxy.h |
| diff --git a/remoting/host/desktop_capturer_proxy.h b/remoting/host/desktop_capturer_proxy.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1e8303a08557cd7868cd6169177e6dd946dbe721 |
| --- /dev/null |
| +++ b/remoting/host/desktop_capturer_proxy.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
| +#define REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "base/threading/non_thread_safe.h" |
| +#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} // namespace base |
| + |
| +namespace remoting { |
| + |
| +namespace protocol { |
| +class CursorShapeInfo; |
| +} // namespace protocol |
| + |
| +// DesktopCapturerProxy is responsible for calling webrtc::DesktopCapturer on |
| +// the capturer thread and then returning results to the caller's thread. |
| +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
|
| + public webrtc::DesktopCapturer { |
|
Wez
2015/02/12 21:59:15
nit: Indentation
Sergey Ulanov
2015/02/13 08:39:44
Done.
|
| + public: |
| + DesktopCapturerProxy( |
| + scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| + scoped_ptr<webrtc::DesktopCapturer> capturer); |
| + ~DesktopCapturerProxy(); |
| + |
| + // webrtc::DesktopCapturer interface. |
| + void Start(Callback* callback) override; |
| + void Capture(const webrtc::DesktopRegion& rect) override; |
| + |
| + private: |
| + class Core; |
| + |
| + void OnFrameCaptured(scoped_ptr<webrtc::DesktopFrame> frame); |
| + |
| + scoped_ptr<Core> core_; |
| + scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
| + webrtc::DesktopCapturer::Callback* callback_; |
| + |
| + base::WeakPtrFactory<DesktopCapturerProxy> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DesktopCapturerProxy); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_DESKTOP_CAPTURER_PROXY_H_ |