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

Unified Diff: webrtc/modules/desktop_capture/fake_desktop_capturer.h

Issue 2697453002: [DesktopCapturer] FallbackDesktopCapturerWrapper and its tests (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/fake_desktop_capturer.h
diff --git a/webrtc/modules/desktop_capture/fake_desktop_capturer.h b/webrtc/modules/desktop_capture/fake_desktop_capturer.h
index 33073a00f7d59df834894cf7b348d0ccbdd19a2e..607549f3fc729af3af264f2c5c4947391f71b6ba 100644
--- a/webrtc/modules/desktop_capture/fake_desktop_capturer.h
+++ b/webrtc/modules/desktop_capture/fake_desktop_capturer.h
@@ -43,6 +43,14 @@ class FakeDesktopCapturer : public DesktopCapturer {
// does not take the ownership of |generator|.
void set_frame_generator(DesktopFrameGenerator* generator);
+ // Count of DesktopFrame(s) have been returned by this instance. This field
+ // would never be negative.
Jamie 2017/02/15 18:43:48 Can you make the return type unsigned to signify t
Hzj_jie 2017/02/15 21:20:36 In coding style, https://google.github.io/stylegui
+ int frame_captured() const;
+
+ // Count of CaptureFrame() calls have been made. This field would never be
+ // negative.
+ int capture_attempts() const;
+
// DesktopCapturer interface
void Start(DesktopCapturer::Callback* callback) override;
void CaptureFrame() override;
@@ -55,10 +63,12 @@ class FakeDesktopCapturer : public DesktopCapturer {
static constexpr DesktopCapturer::SourceId kWindowId = 1378277495;
static constexpr DesktopCapturer::SourceId kScreenId = 1378277496;
- DesktopCapturer::Callback* callback_;
+ DesktopCapturer::Callback* callback_ = nullptr;
std::unique_ptr<SharedMemoryFactory> shared_memory_factory_;
- DesktopCapturer::Result result_;
- DesktopFrameGenerator* generator_;
+ DesktopCapturer::Result result_ = Result::SUCCESS;
+ DesktopFrameGenerator* generator_ = nullptr;
+ int frame_captured_ = 0;
+ int capture_attempts_ = 0;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698