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

Unified Diff: webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc

Issue 2030333003: Revert of Use std::unique_ptr<> to pass frame ownership in DesktopCapturer impls. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
diff --git a/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc b/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
index 9e89439b6fd233ba590538f1207ac34301e38bf4..6652a1af71e1125e02bfca000539cbdf2a45e971 100644
--- a/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
+++ b/webrtc/modules/desktop_capture/desktop_and_cursor_composer_unittest.cc
@@ -78,17 +78,15 @@
void Start(Callback* callback) override { callback_ = callback; }
void Capture(const DesktopRegion& region) override {
- callback_->OnCaptureResult(
- next_frame_ ? Result::SUCCESS : Result::ERROR_TEMPORARY,
- std::move(next_frame_));
- }
-
- void SetNextFrame(std::unique_ptr<DesktopFrame> next_frame) {
- next_frame_ = std::move(next_frame);
+ callback_->OnCaptureCompleted(next_frame_.release());
+ }
+
+ void SetNextFrame(DesktopFrame* next_frame) {
+ next_frame_.reset(next_frame);
}
private:
- Callback* callback_ = nullptr;
+ Callback* callback_;
std::unique_ptr<DesktopFrame> next_frame_;
};
@@ -167,13 +165,11 @@
DesktopAndCursorComposerTest()
: fake_screen_(new FakeScreenCapturer()),
fake_cursor_(new FakeMouseMonitor()),
- blender_(fake_screen_, fake_cursor_) {}
+ blender_(fake_screen_, fake_cursor_) {
+ }
// DesktopCapturer::Callback interface
- void OnCaptureResult(DesktopCapturer::Result result,
- std::unique_ptr<DesktopFrame> frame) override {
- frame_ = std::move(frame);
- }
+ void OnCaptureCompleted(DesktopFrame* frame) override { frame_.reset(frame); }
protected:
// Owned by |blender_|.
@@ -191,7 +187,7 @@
fake_cursor_->SetHotspot(DesktopVector());
fake_cursor_->SetState(MouseCursorMonitor::INSIDE, DesktopVector());
- fake_screen_->SetNextFrame(nullptr);
+ fake_screen_->SetNextFrame(NULL);
blender_.Capture(DesktopRegion());
« no previous file with comments | « webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc ('k') | webrtc/modules/desktop_capture/desktop_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698