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

Unified Diff: remoting/host/desktop_capturer_proxy.cc

Issue 2050353002: Update webrtc::DesktopCapturer clients to implement OnCaptureResult(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos 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
« no previous file with comments | « remoting/host/desktop_capturer_proxy.h ('k') | remoting/host/desktop_session_agent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_capturer_proxy.cc
diff --git a/remoting/host/desktop_capturer_proxy.cc b/remoting/host/desktop_capturer_proxy.cc
index 0a7307b446493e0178bd0dd08cf75caeec29645a..af9f1629402968ca0a4a4030adefa807128ea379 100644
--- a/remoting/host/desktop_capturer_proxy.cc
+++ b/remoting/host/desktop_capturer_proxy.cc
@@ -40,7 +40,8 @@ class DesktopCapturerProxy::Core : public webrtc::DesktopCapturer::Callback {
private:
// webrtc::DesktopCapturer::Callback implementation.
- void OnCaptureCompleted(webrtc::DesktopFrame* frame) override;
+ void OnCaptureResult(webrtc::DesktopCapturer::Result result,
+ std::unique_ptr<webrtc::DesktopFrame> frame) override;
base::ThreadChecker thread_checker_;
@@ -93,17 +94,18 @@ void DesktopCapturerProxy::Core::Capture(const webrtc::DesktopRegion& rect) {
if (capturer_) {
capturer_->Capture(rect);
} else {
- OnCaptureCompleted(nullptr);
+ OnCaptureResult(webrtc::DesktopCapturer::Result::ERROR_PERMANENT, nullptr);
}
}
-void DesktopCapturerProxy::Core::OnCaptureCompleted(
- webrtc::DesktopFrame* frame) {
+void DesktopCapturerProxy::Core::OnCaptureResult(
+ webrtc::DesktopCapturer::Result result,
+ std::unique_ptr<webrtc::DesktopFrame> frame) {
DCHECK(thread_checker_.CalledOnValidThread());
caller_task_runner_->PostTask(
FROM_HERE, base::Bind(&DesktopCapturerProxy::OnFrameCaptured, proxy_,
- base::Passed(base::WrapUnique(frame))));
+ result, base::Passed(&frame)));
}
DesktopCapturerProxy::DesktopCapturerProxy(
@@ -152,10 +154,11 @@ void DesktopCapturerProxy::Capture(const webrtc::DesktopRegion& rect) {
}
void DesktopCapturerProxy::OnFrameCaptured(
+ webrtc::DesktopCapturer::Result result,
std::unique_ptr<webrtc::DesktopFrame> frame) {
DCHECK(thread_checker_.CalledOnValidThread());
- callback_->OnCaptureCompleted(frame.release());
+ callback_->OnCaptureResult(result, std::move(frame));
}
} // namespace remoting
« no previous file with comments | « remoting/host/desktop_capturer_proxy.h ('k') | remoting/host/desktop_session_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698