Chromium Code Reviews| Index: webrtc/modules/desktop_capture/desktop_capturer.h |
| diff --git a/webrtc/modules/desktop_capture/desktop_capturer.h b/webrtc/modules/desktop_capture/desktop_capturer.h |
| index 778c93c63a0e638d75a110be7fa57c237f565a29..26d3b7f8d0c9e27a876ea7e286d275190c5e9112 100644 |
| --- a/webrtc/modules/desktop_capture/desktop_capturer.h |
| +++ b/webrtc/modules/desktop_capture/desktop_capturer.h |
| @@ -15,6 +15,7 @@ |
| #include <memory> |
| +#include "webrtc/base/checks.h" |
| #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| #include "webrtc/modules/desktop_capture/desktop_capture_types.h" |
| #include "webrtc/modules/desktop_capture/shared_memory.h" |
| @@ -49,6 +50,22 @@ class DesktopCapturer { |
| virtual void OnCaptureResult(Result result, |
| std::unique_ptr<DesktopFrame> frame) = 0; |
| + // A shortcut to return a temporary error. |
| + void OnTemporaryError() { |
|
Sergey Ulanov
2016/07/08 22:36:53
Please don't add these methods here. Callback is a
Hzj_jie
2016/07/11 00:54:59
Done.
|
| + OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); |
| + } |
| + |
| + // A shortcut to return a permanent error. |
| + void OnPermanentError() { |
| + OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
| + } |
| + |
| + // A shortcut to return a capture result. |
| + void OnCaptureSucceeded(std::unique_ptr<DesktopFrame> frame) { |
| + RTC_DCHECK(frame); |
| + OnCaptureResult(Result::SUCCESS, std::move(frame)); |
| + } |
| + |
| protected: |
| virtual ~Callback() {} |
| }; |