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

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

Issue 1140113002: Implement screen capture for android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ScreenCaptureMachineAndroid which inherited from content::VideoCaptureMachine Created 5 years, 7 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.cc
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc
index d398c6d756b86feb5baf7dc12e67eb36c9265ddb..f8cd0e7c88974e2bde62930d1d47549dc024437c 100644
--- a/content/browser/media/capture/aura_window_capture_machine.cc
+++ b/content/browser/media/capture/aura_window_capture_machine.cc
@@ -117,11 +117,25 @@ AuraWindowCaptureMachine::AuraWindowCaptureMachine()
AuraWindowCaptureMachine::~AuraWindowCaptureMachine() {}
-bool AuraWindowCaptureMachine::Start(
+void AuraWindowCaptureMachine::Start(
+ const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy,
+ const media::VideoCaptureParams& params,
+ const base::Callback<void(bool)> callback) {
+ // Starts the capture machine asynchronously.
+ BrowserThread::PostTaskAndReplyWithResult(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&AuraWindowCaptureMachine::InternalStart,
+ base::Unretained(this),
+ oracle_proxy,
+ params),
+ callback);
+}
+
+bool AuraWindowCaptureMachine::InternalStart(
const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy,
const media::VideoCaptureParams& params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
// The window might be destroyed between SetWindow() and Start().
if (!desktop_window_)
return false;
@@ -157,6 +171,15 @@ bool AuraWindowCaptureMachine::Start(
}
void AuraWindowCaptureMachine::Stop(const base::Closure& callback) {
+ // Stops the capture machine asynchronously.
+ BrowserThread::PostTask(
whywhat 2015/08/17 13:58:46 This refactoring (changing a sync method to async)
+ BrowserThread::UI, FROM_HERE, base::Bind(
+ &AuraWindowCaptureMachine::InternalStop,
+ base::Unretained(this),
+ callback));
+}
+
+void AuraWindowCaptureMachine::InternalStop(const base::Closure& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
power_save_blocker_.reset();

Powered by Google App Engine
This is Rietveld 408576698