summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 02:49:18 +0000
committeralexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 02:49:18 +0000
commitfa359e46c5c44ecdea2b934ce2c07b918b8ac086 (patch)
tree91a058393af855bee7faa41176a91551458add34
parenteb35a6f50ee6ebe291a9efc94ae4a600bb4b9d59 (diff)
downloadchromium_src-fa359e46c5c44ecdea2b934ce2c07b918b8ac086.zip
chromium_src-fa359e46c5c44ecdea2b934ce2c07b918b8ac086.tar.gz
chromium_src-fa359e46c5c44ecdea2b934ce2c07b918b8ac086.tar.bz2
Call ChromotingClient::Initialize() before any packets can arrive.
This CL introduces new ConnectionToHost::State::AUTHENTICATED that ChromotingClient uses as a signal to initialize video and audio decoders. The new state is reported as 'CONNECTED' to the webapp to avoid changing the interface between the plugin and webapp. BUG=229927 Review URL: https://chromiumcodereview.appspot.com/14109011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194079 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/client/chromoting_client.cc2
-rw-r--r--remoting/client/plugin/chromoting_instance.cc4
-rw-r--r--remoting/protocol/connection_to_host.cc2
-rw-r--r--remoting/protocol/connection_to_host.h1
4 files changed, 8 insertions, 1 deletions
diff --git a/remoting/client/chromoting_client.cc b/remoting/client/chromoting_client.cc
index cf13d13..28d5154 100644
--- a/remoting/client/chromoting_client.cc
+++ b/remoting/client/chromoting_client.cc
@@ -104,7 +104,7 @@ void ChromotingClient::OnConnectionState(
protocol::ErrorCode error) {
DCHECK(task_runner_->BelongsToCurrentThread());
VLOG(1) << "ChromotingClient::OnConnectionState(" << state << ")";
- if (state == protocol::ConnectionToHost::CONNECTED)
+ if (state == protocol::ConnectionToHost::AUTHENTICATED)
Initialize();
user_interface_->OnConnectionState(state, error);
}
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 057c4a1..45671e4 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -73,6 +73,10 @@ std::string ConnectionStateToString(protocol::ConnectionToHost::State state) {
return "INITIALIZING";
case protocol::ConnectionToHost::CONNECTING:
return "CONNECTING";
+ case protocol::ConnectionToHost::AUTHENTICATED:
+ // Report the authenticated state as 'CONNECTING' to avoid changing
+ // the interface between the plugin and webapp.
+ return "CONNECTING";
case protocol::ConnectionToHost::CONNECTED:
return "CONNECTED";
case protocol::ConnectionToHost::CLOSED:
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 105ccba..f778bb0 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -192,6 +192,8 @@ void ConnectionToHost::OnSessionStateChange(
base::Unretained(this)));
audio_reader_->set_audio_stub(audio_stub_);
}
+
+ SetState(AUTHENTICATED, OK);
break;
case Session::CLOSED:
diff --git a/remoting/protocol/connection_to_host.h b/remoting/protocol/connection_to_host.h
index 25d6d89..1c93b5d 100644
--- a/remoting/protocol/connection_to_host.h
+++ b/remoting/protocol/connection_to_host.h
@@ -54,6 +54,7 @@ class ConnectionToHost : public SignalStrategy::Listener,
enum State {
INITIALIZING,
CONNECTING,
+ AUTHENTICATED,
CONNECTED,
FAILED,
CLOSED,