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

Unified Diff: remoting/host/screen_recorder.h

Issue 6282006: Add a done task to ScreenRecorder::Stop() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 9 years, 11 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: remoting/host/screen_recorder.h
diff --git a/remoting/host/screen_recorder.h b/remoting/host/screen_recorder.h
index 3a844eb248b9af68352cea64ac5a0551641ed6ea..cbedd934dbf0c89a8c7b6898e5122428b1cb665f 100644
--- a/remoting/host/screen_recorder.h
+++ b/remoting/host/screen_recorder.h
@@ -76,8 +76,9 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> {
// Start recording.
void Start();
- // Pause the recording session.
- void Pause();
+ // Stop the recording session. |done_task| is executed when recording is fully
+ // stopped. This object cannot be used again after |task| is executed.
+ void Stop(Task* done_task);
// Set the maximum capture rate. This is denoted by number of updates
// in one second. The actual system may run in a slower rate than the maximum
@@ -103,7 +104,8 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> {
// Capturer thread ----------------------------------------------------------
void DoStart();
- void DoPause();
+ void DoStop(Task* done_task);
+ void DoCompleteStop(Task* done_task);
void DoSetMaxRate(double max_rate);
@@ -112,7 +114,7 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> {
void DoCapture();
void CaptureDoneCallback(scoped_refptr<CaptureData> capture_data);
- void DoFinishSend();
+ void DoFinishOneRecording();
// Network thread -----------------------------------------------------------
@@ -127,16 +129,22 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> {
void DoRemoveClient(scoped_refptr<protocol::ConnectionToClient> connection);
void DoRemoveAllClients();
+ // Signal network thread to cease activities.
+ void DoStopOnNetworkThread(Task* done_task);
+
// Callback for the last packet in one update. Deletes |packet| and
// schedules next screen capture.
- void OnFrameSent(VideoPacket* packet);
+ void FrameSentCallback(VideoPacket* packet);
// Encoder thread -----------------------------------------------------------
void DoEncode(scoped_refptr<CaptureData> capture_data);
- // EncodeDataAvailableTask takes ownership of |packet|.
- void EncodeDataAvailableTask(VideoPacket* packet);
+ // Perform stop operations on encode thread.
+ void DoStopOnEncodeThread(Task* done_task);
+
+ // EncodedDataAvailableCallback takes ownership of |packet|.
+ void EncodedDataAvailableCallback(VideoPacket* packet);
void SendVideoPacket(VideoPacket* packet);
// Message loops used by this class.
@@ -160,9 +168,12 @@ class ScreenRecorder : public base::RefCountedThreadSafe<ScreenRecorder> {
ConnectionToClientList;
ConnectionToClientList connections_;
- // The following members are accessed on the capture thread.
+ // Flag that indicates recording has been started.
bool started_;
+ // Flag that indicates network is being stopped.
+ bool network_stopped_;
+
// Timer that calls DoCapture.
base::RepeatingTimer<ScreenRecorder> capture_timer_;

Powered by Google App Engine
This is Rietveld 408576698