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 08ad2439b0774b0f1ebb26aaf81fc1aa55bf104d..a56208f38aa1fac4fada467d6c43e788d2f207c0 100644 |
--- a/content/browser/media/capture/aura_window_capture_machine.cc |
+++ b/content/browser/media/capture/aura_window_capture_machine.cc |
@@ -9,7 +9,6 @@ |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
-#include "base/timer/timer.h" |
#include "cc/output/copy_output_request.h" |
#include "cc/output/copy_output_result.h" |
#include "content/browser/compositor/gl_helper.h" |
@@ -39,7 +38,6 @@ namespace content { |
AuraWindowCaptureMachine::AuraWindowCaptureMachine() |
: desktop_window_(NULL), |
- timer_(true, true), |
screen_capture_(false), |
weak_factory_(this) {} |
@@ -91,14 +89,6 @@ bool AuraWindowCaptureMachine::InternalStart( |
PowerSaveBlocker::kReasonOther, |
"DesktopCaptureDevice is running").release()); |
- // Starts timer. |
- timer_.Start(FROM_HERE, |
- std::max(oracle_proxy_->min_capture_period(), |
- base::TimeDelta::FromMilliseconds(media:: |
- VideoCaptureOracle::kMinTimerPollPeriodMillis)), |
- base::Bind(&AuraWindowCaptureMachine::Capture, |
- base::Unretained(this), false)); |
- |
return true; |
} |
@@ -130,12 +120,14 @@ void AuraWindowCaptureMachine::InternalStop(const base::Closure& callback) { |
cursor_renderer_.reset(); |
} |
- // Stop timer. |
- timer_.Stop(); |
- |
callback.Run(); |
} |
+void AuraWindowCaptureMachine::MaybeCaptureForRefresh() { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ Capture(false); |
+} |
+ |
void AuraWindowCaptureMachine::SetWindow(aura::Window* window) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
@@ -179,7 +171,7 @@ void AuraWindowCaptureMachine::Capture(bool dirty) { |
const base::TimeTicks start_time = base::TimeTicks::Now(); |
const media::VideoCaptureOracle::Event event = |
dirty ? media::VideoCaptureOracle::kCompositorUpdate |
- : media::VideoCaptureOracle::kTimerPoll; |
+ : media::VideoCaptureOracle::kActiveRefreshRequest; |
if (oracle_proxy_->ObserveEventAndDecideCapture( |
event, gfx::Rect(), start_time, &frame, &capture_frame_cb)) { |
scoped_ptr<cc::CopyOutputRequest> request = |