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

Unified Diff: content/browser/media/capture/aura_window_capture_machine.h

Issue 2364413002: Screen Video Capture: Implement suspend optimization. (Closed)
Patch Set: Unwind ScreenCaptureMachineAndroid changes. Created 4 years, 3 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: content/browser/media/capture/aura_window_capture_machine.h
diff --git a/content/browser/media/capture/aura_window_capture_machine.h b/content/browser/media/capture/aura_window_capture_machine.h
index 848c3251de8fd35497f52e36c0fe63ec5f27940d..ff2334398dbc580dfe8f6cb3eba52242951cb511 100644
--- a/content/browser/media/capture/aura_window_capture_machine.h
+++ b/content/browser/media/capture/aura_window_capture_machine.h
@@ -43,6 +43,8 @@ class AuraWindowCaptureMachine
void Start(const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
const media::VideoCaptureParams& params,
const base::Callback<void(bool)> callback) override;
+ void Suspend() override;
+ void Resume() override;
void Stop(const base::Closure& callback) override;
void MaybeCaptureForRefresh() override;
@@ -66,6 +68,8 @@ class AuraWindowCaptureMachine
bool InternalStart(
const scoped_refptr<media::ThreadSafeCaptureOracle>& oracle_proxy,
const media::VideoCaptureParams& params);
+ void InternalSuspend();
+ void InternalResume();
void InternalStop(const base::Closure& callback);
// Captures a frame. |event_time| is provided by the compositor, or is null
@@ -126,6 +130,10 @@ class AuraWindowCaptureMachine
// screen from sleeping for the drive-by web.
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
+ // False while frame capture has been suspended. All other aspects of the
+ // machine are maintained.
+ bool frame_capture_active_;
+
// WeakPtrs are used for the asynchronous capture callbacks passed to external
// modules. They are only valid on the UI thread and become invalidated
// immediately when InternalStop() is called to ensure that no more captured

Powered by Google App Engine
This is Rietveld 408576698