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

Side by Side Diff: remoting/host/session_manager.cc

Issue 3320003: Allows chromoting host to be connected again after connection drops. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/session_manager.h" 5 #include "remoting/host/session_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 DCHECK_EQ(encode_loop_, MessageLoop::current()); 104 DCHECK_EQ(encode_loop_, MessageLoop::current());
105 return encoder_.get(); 105 return encoder_.get();
106 } 106 }
107 107
108 // Capturer thread ------------------------------------------------------------- 108 // Capturer thread -------------------------------------------------------------
109 109
110 void SessionManager::DoStart() { 110 void SessionManager::DoStart() {
111 DCHECK_EQ(capture_loop_, MessageLoop::current()); 111 DCHECK_EQ(capture_loop_, MessageLoop::current());
112 112
113 if (started_) { 113 if (started_) {
114 NOTREACHED() << "Record session already started"; 114 NOTREACHED() << "Record session already started.";
115 return; 115 return;
116 } 116 }
117 117
118 started_ = true; 118 started_ = true;
119 DoCapture(); 119 DoCapture();
120 120
121 // Starts the rate regulation. 121 // Starts the rate regulation.
122 network_loop_->PostTask( 122 network_loop_->PostTask(
123 FROM_HERE, 123 FROM_HERE,
124 NewRunnableMethod(this, &SessionManager::DoStartRateControl)); 124 NewRunnableMethod(this, &SessionManager::DoStartRateControl));
125 } 125 }
126 126
127 void SessionManager::DoPause() { 127 void SessionManager::DoPause() {
128 DCHECK_EQ(capture_loop_, MessageLoop::current()); 128 DCHECK_EQ(capture_loop_, MessageLoop::current());
129 129
130 if (!started_) { 130 if (!started_) {
131 NOTREACHED() << "Record session not started"; 131 NOTREACHED() << "Record session not started.";
132 return; 132 return;
133 } 133 }
134 134
135 started_ = false; 135 started_ = false;
136 136
137 // Pause the rate regulation. 137 // Pause the rate regulation.
138 network_loop_->PostTask( 138 network_loop_->PostTask(
139 FROM_HERE, 139 FROM_HERE,
140 NewRunnableMethod(this, &SessionManager::DoPauseRateControl)); 140 NewRunnableMethod(this, &SessionManager::DoPauseRateControl));
141 } 141 }
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 FROM_HERE, 405 FROM_HERE,
406 NewRunnableMethod(this, &SessionManager::DoSendUpdate, message, state)); 406 NewRunnableMethod(this, &SessionManager::DoSendUpdate, message, state));
407 407
408 if (state & Encoder::EncodingEnded) { 408 if (state & Encoder::EncodingEnded) {
409 capture_loop_->PostTask( 409 capture_loop_->PostTask(
410 FROM_HERE, NewRunnableMethod(this, &SessionManager::DoFinishEncode)); 410 FROM_HERE, NewRunnableMethod(this, &SessionManager::DoFinishEncode));
411 } 411 }
412 } 412 }
413 413
414 } // namespace remoting 414 } // namespace remoting
OLDNEW
« remoting/host/chromoting_host.cc ('K') | « remoting/host/chromoting_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698