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

Unified Diff: remoting/host/screen_recorder.cc

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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
« no previous file with comments | « remoting/host/screen_recorder.h ('k') | remoting/host/screen_recorder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/screen_recorder.cc
diff --git a/remoting/host/screen_recorder.cc b/remoting/host/screen_recorder.cc
index 1a05797f8faa7e1631b8cf7dbec23f8f38fc8dfe..38d93df0d9dc97628525af97c454545e4e2c49d3 100644
--- a/remoting/host/screen_recorder.cc
+++ b/remoting/host/screen_recorder.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop_proxy.h"
#include "base/stl_util.h"
#include "base/task.h"
#include "base/time.h"
@@ -37,7 +38,7 @@ static const int kMaxRecordings = 2;
ScreenRecorder::ScreenRecorder(
MessageLoop* capture_loop,
MessageLoop* encode_loop,
- MessageLoop* network_loop,
+ base::MessageLoopProxy* network_loop,
Capturer* capturer,
Encoder* encoder)
: capture_loop_(capture_loop),
@@ -274,7 +275,7 @@ void ScreenRecorder::DoInvalidateFullScreen() {
// Network thread --------------------------------------------------------------
void ScreenRecorder::DoSendVideoPacket(VideoPacket* packet) {
- DCHECK_EQ(network_loop_, MessageLoop::current());
+ DCHECK(network_loop_->BelongsToCurrentThread());
TraceContext::tracer()->PrintString("DoSendVideoPacket");
@@ -318,14 +319,14 @@ void ScreenRecorder::FrameSentCallback(VideoPacket* packet) {
void ScreenRecorder::DoAddConnection(
scoped_refptr<ConnectionToClient> connection) {
- DCHECK_EQ(network_loop_, MessageLoop::current());
+ DCHECK(network_loop_->BelongsToCurrentThread());
connections_.push_back(connection);
}
void ScreenRecorder::DoRemoveClient(
scoped_refptr<ConnectionToClient> connection) {
- DCHECK_EQ(network_loop_, MessageLoop::current());
+ DCHECK(network_loop_->BelongsToCurrentThread());
ConnectionToClientList::iterator it =
std::find(connections_.begin(), connections_.end(), connection);
@@ -335,14 +336,14 @@ void ScreenRecorder::DoRemoveClient(
}
void ScreenRecorder::DoRemoveAllClients() {
- DCHECK_EQ(network_loop_, MessageLoop::current());
+ DCHECK(network_loop_->BelongsToCurrentThread());
// Clear the list of connections.
connections_.clear();
}
void ScreenRecorder::DoStopOnNetworkThread(Task* done_task) {
- DCHECK_EQ(network_loop_, MessageLoop::current());
+ DCHECK(network_loop_->BelongsToCurrentThread());
// There could be tasks on the network thread when this method is being
// executed. By setting the flag we'll not post anymore tasks from network
« no previous file with comments | « remoting/host/screen_recorder.h ('k') | remoting/host/screen_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698