| Index: remoting/host/chromoting_host.cc
|
| diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
|
| index e8b2cccd6912dc854024e91db28bb5c6513146ad..eb4ebf93191808389de1529446edb9b27d5f65c1 100644
|
| --- a/remoting/host/chromoting_host.cc
|
| +++ b/remoting/host/chromoting_host.cc
|
| @@ -25,7 +25,7 @@
|
| #include "remoting/host/chromoting_host_context.h"
|
| #include "remoting/host/host_config.h"
|
| #include "remoting/host/host_stub_fake.h"
|
| -#include "remoting/host/session_manager.h"
|
| +#include "remoting/host/screen_recorder.h"
|
| #include "remoting/protocol/connection_to_client.h"
|
| #include "remoting/protocol/host_stub.h"
|
| #include "remoting/protocol/input_stub.h"
|
| @@ -42,19 +42,19 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context,
|
| config_(config),
|
| #if defined(OS_WIN)
|
| capturer_(new remoting::CapturerGdi(
|
| - context->capture_message_loop())),
|
| + context->main_message_loop())),
|
| input_stub_(new remoting::EventExecutorWin(
|
| - context->capture_message_loop(), capturer_.get())),
|
| + context->main_message_loop(), capturer_.get())),
|
| #elif defined(OS_LINUX)
|
| capturer_(new remoting::CapturerLinux(
|
| - context->capture_message_loop())),
|
| + context->main_message_loop())),
|
| input_stub_(new remoting::EventExecutorLinux(
|
| - context->capture_message_loop(), capturer_.get())),
|
| + context->main_message_loop(), capturer_.get())),
|
| #elif defined(OS_MACOSX)
|
| capturer_(new remoting::CapturerMac(
|
| - context->capture_message_loop())),
|
| + context->main_message_loop())),
|
| input_stub_(new remoting::EventExecutorMac(
|
| - context->capture_message_loop(), capturer_.get())),
|
| + context->main_message_loop(), capturer_.get())),
|
| #endif
|
| host_stub_(new HostStubFake()),
|
| state_(kInitial) {
|
| @@ -67,13 +67,13 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context,
|
| capturer_(capturer),
|
| #if defined(OS_WIN)
|
| input_stub_(new remoting::EventExecutorWin(
|
| - context->capture_message_loop(), capturer)),
|
| + context->main_message_loop(), capturer)),
|
| #elif defined(OS_LINUX)
|
| input_stub_(new remoting::EventExecutorLinux(
|
| - context->capture_message_loop(), capturer)),
|
| + context->main_message_loop(), capturer)),
|
| #elif defined(OS_MACOSX)
|
| input_stub_(new remoting::EventExecutorMac(
|
| - context->capture_message_loop(), capturer)),
|
| + context->main_message_loop(), capturer)),
|
| #endif
|
| host_stub_(new HostStubFake()),
|
| state_(kInitial) {
|
| @@ -147,9 +147,9 @@ void ChromotingHost::Shutdown() {
|
| }
|
|
|
| // Tell the session to pause and then disconnect all clients.
|
| - if (session_.get()) {
|
| - session_->Pause();
|
| - session_->RemoveAllConnections();
|
| + if (recorder_.get()) {
|
| + recorder_->Pause();
|
| + recorder_->RemoveAllConnections();
|
| }
|
|
|
| // Disconnect the client.
|
| @@ -184,23 +184,23 @@ void ChromotingHost::OnClientConnected(ConnectionToClient* connection) {
|
| DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
|
|
|
| // Create a new RecordSession if there was none.
|
| - if (!session_.get()) {
|
| - // Then we create a SessionManager passing the message loops that
|
| + if (!recorder_.get()) {
|
| + // Then we create a ScreenRecorder passing the message loops that
|
| // it should run on.
|
| DCHECK(capturer_.get());
|
|
|
| Encoder* encoder = CreateEncoder(connection->session()->config());
|
|
|
| - session_ = new SessionManager(context_->capture_message_loop(),
|
| - context_->encode_message_loop(),
|
| - context_->main_message_loop(),
|
| - capturer_.release(),
|
| - encoder);
|
| + recorder_ = new ScreenRecorder(context_->main_message_loop(),
|
| + context_->encode_message_loop(),
|
| + context_->network_message_loop(),
|
| + capturer_.release(),
|
| + encoder);
|
| }
|
|
|
| // Immediately add the connection and start the session.
|
| - session_->AddConnection(connection);
|
| - session_->Start();
|
| + recorder_->AddConnection(connection);
|
| + recorder_->Start();
|
| VLOG(1) << "Session manager started";
|
| }
|
|
|
| @@ -209,9 +209,9 @@ void ChromotingHost::OnClientDisconnected(ConnectionToClient* connection) {
|
|
|
| // Remove the connection from the session manager and pause the session.
|
| // TODO(hclam): Pause only if the last connection disconnected.
|
| - if (session_.get()) {
|
| - session_->RemoveConnection(connection);
|
| - session_->Pause();
|
| + if (recorder_.get()) {
|
| + recorder_->RemoveConnection(connection);
|
| + recorder_->Pause();
|
| }
|
|
|
| // Close the connection to connection just to be safe.
|
|
|