Index: remoting/host/session_manager.cc |
diff --git a/remoting/host/session_manager.cc b/remoting/host/session_manager.cc |
index ebd10614544c4641b3943b1d69751b8b2c479513..c89a48d2495f3e765ac2e7e9b56f46fae71904c7 100644 |
--- a/remoting/host/session_manager.cc |
+++ b/remoting/host/session_manager.cc |
@@ -39,7 +39,7 @@ static const int kSlowDownFactor = 10; |
static const int kRateDividers[] = {1, 2, 4, 8, 16}; |
SessionManager::SessionManager( |
- MessageLoop* capture_loop, |
+ scoped_refptr<base::MessageLoopProxy> capture_loop, |
MessageLoop* encode_loop, |
MessageLoop* network_loop, |
Capturer* capturer, |
@@ -104,7 +104,7 @@ void SessionManager::RemoveAllConnections() { |
// Private accessors ----------------------------------------------------------- |
Capturer* SessionManager::capturer() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
return capturer_.get(); |
} |
@@ -116,7 +116,7 @@ Encoder* SessionManager::encoder() { |
// Capturer thread ------------------------------------------------------------- |
void SessionManager::DoStart() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
if (started_) { |
NOTREACHED() << "Record session already started."; |
@@ -133,7 +133,7 @@ void SessionManager::DoStart() { |
} |
void SessionManager::DoPause() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
if (!started_) { |
NOTREACHED() << "Record session not started."; |
@@ -149,7 +149,7 @@ void SessionManager::DoPause() { |
} |
void SessionManager::DoSetRate(double rate) { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
if (rate == rate_) |
return; |
@@ -163,7 +163,7 @@ void SessionManager::DoSetRate(double rate) { |
} |
void SessionManager::DoSetMaxRate(double max_rate) { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
// TODO(hclam): Should also check for small epsilon. |
if (max_rate != 0) { |
@@ -175,7 +175,7 @@ void SessionManager::DoSetMaxRate(double max_rate) { |
} |
void SessionManager::ScheduleNextCapture() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
ScopedTracer tracer("capture"); |
@@ -193,7 +193,7 @@ void SessionManager::ScheduleNextCapture() { |
} |
void SessionManager::DoCapture() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
// Make sure we have at most two oustanding recordings. We can simply return |
// if we can't make a capture now, the next capture will be started by the |
// end of an encode operation. |
@@ -231,7 +231,7 @@ void SessionManager::CaptureDoneCallback( |
scoped_refptr<CaptureData> capture_data) { |
// TODO(hclam): There is a bug if the capturer doesn't produce any dirty |
// rects. |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
TraceContext::tracer()->PrintString("Capture Done"); |
encode_loop_->PostTask( |
FROM_HERE, |
@@ -239,7 +239,7 @@ void SessionManager::CaptureDoneCallback( |
} |
void SessionManager::DoFinishEncode() { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
// Decrement the number of recording in process since we have completed |
// one cycle. |
@@ -253,7 +253,7 @@ void SessionManager::DoFinishEncode() { |
void SessionManager::DoGetInitInfo( |
scoped_refptr<ConnectionToClient> connection) { |
- DCHECK_EQ(capture_loop_, MessageLoop::current()); |
+ DCHECK(capture_loop_->BelongsToCurrentThread()); |
ScopedTracer tracer("init"); |