diff options
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 39 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.h | 2 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_scriptable_object.cc | 12 | ||||
-rw-r--r-- | remoting/webapp/me2mom/client_session.js | 9 | ||||
-rw-r--r-- | remoting/webapp/me2mom/remoting.js | 19 |
5 files changed, 9 insertions, 72 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 98c87d4..40bf1ec 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -156,7 +156,7 @@ bool ChromotingInstance::Init(uint32_t argc, return true; } -void ChromotingInstance::Connect(const ClientConfig& config, bool use_p2p_api) { +void ChromotingInstance::Connect(const ClientConfig& config) { DCHECK(plugin_message_loop_->BelongsToCurrentThread()); // This can only happen at initialization if the Javascript connect call @@ -165,42 +165,13 @@ void ChromotingInstance::Connect(const ClientConfig& config, bool use_p2p_api) { if (!initial_policy_received_) { LOG(INFO) << "Delaying connect until initial policy is read."; delayed_connect_.reset( - task_factory_.NewRunnableMethod(&ChromotingInstance::Connect, - config, use_p2p_api)); + task_factory_.NewRunnableMethod(&ChromotingInstance::Connect, config)); return; } - webkit::ppapi::PluginInstance* plugin_instance = - webkit::ppapi::ResourceTracker::Get()->GetInstance(pp_instance()); - - if (use_p2p_api) { - host_connection_.reset(new protocol::ConnectionToHost( - context_.network_message_loop(), this, NULL, NULL, NULL, NULL, - enable_client_nat_traversal_)); - } else { - content::P2PSocketDispatcher* socket_dispatcher = - plugin_instance->delegate()->GetP2PSocketDispatcher(); - - content::IpcNetworkManager* network_manager = NULL; - content::IpcPacketSocketFactory* socket_factory = NULL; - HostResolverFactory* host_resolver_factory = NULL; - PortAllocatorSessionFactory* session_factory = - CreatePepperPortAllocatorSessionFactory( - this, plugin_message_loop_, context_.network_message_loop()); - - // If we don't have socket dispatcher for IPC (e.g. P2P API is - // disabled), then JingleSessionManager will try to use physical sockets. - if (socket_dispatcher) { - VLOG(1) << "Creating IpcNetworkManager and IpcPacketSocketFactory."; - network_manager = new content::IpcNetworkManager(socket_dispatcher); - socket_factory = new content::IpcPacketSocketFactory(socket_dispatcher); - host_resolver_factory = new IpcHostResolverFactory(socket_dispatcher); - } - - host_connection_.reset(new protocol::ConnectionToHost( - context_.network_message_loop(), NULL, network_manager, socket_factory, - host_resolver_factory, session_factory, enable_client_nat_traversal_)); - } + host_connection_.reset(new protocol::ConnectionToHost( + context_.network_message_loop(), this, NULL, NULL, NULL, NULL, + enable_client_nat_traversal_)); input_handler_.reset(new PepperInputHandler(&context_, host_connection_.get(), diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h index 981e082..e1b62cc 100644 --- a/remoting/client/plugin/chromoting_instance.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -77,7 +77,7 @@ class ChromotingInstance : public pp::InstancePrivate { ChromotingScriptableObject* GetScriptableObject(); // Initiates and cancels connections. - void Connect(const ClientConfig& config, bool use_p2p_api); + void Connect(const ClientConfig& config); void Disconnect(); // Called by ChromotingScriptableObject to provide username and password. diff --git a/remoting/client/plugin/chromoting_scriptable_object.cc b/remoting/client/plugin/chromoting_scriptable_object.cc index ce63288..28c6303 100644 --- a/remoting/client/plugin/chromoting_scriptable_object.cc +++ b/remoting/client/plugin/chromoting_scriptable_object.cc @@ -365,7 +365,6 @@ Var ChromotingScriptableObject::DoConnect(const std::vector<Var>& args, // host_public_key // client_jid // access_code (optional) - // use_p2p_api (optional) unsigned int arg = 0; if (!args[arg].is_string()) { *exception = Var("The host_jid must be a string."); @@ -394,15 +393,6 @@ Var ChromotingScriptableObject::DoConnect(const std::vector<Var>& args, access_code = args[arg++].AsString(); } - bool use_p2p_api = false; - if (args.size() > arg) { - if (!args[arg].is_bool()) { - *exception = Var("The use_p2p_api parameter must be a boolean."); - return Var(); - } - use_p2p_api = args[arg++].AsBool(); - } - if (args.size() != arg) { *exception = Var("Too many agruments passed to connect()."); return Var(); @@ -416,7 +406,7 @@ Var ChromotingScriptableObject::DoConnect(const std::vector<Var>& args, config.host_jid = host_jid; config.host_public_key = host_public_key; config.access_code = access_code; - instance_->Connect(config, use_p2p_api); + instance_->Connect(config); return Var(); } diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js index 4940ed8..ec15ed6 100644 --- a/remoting/webapp/me2mom/client_session.js +++ b/remoting/webapp/me2mom/client_session.js @@ -254,13 +254,8 @@ remoting.ClientSession.prototype.connectPluginToWcs_ = remoting.debug.log('Receiving Iq: ' + stanza); that.plugin.onIq(stanza); }); - if (remoting.useP2pApi) { - this.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, - this.accessCode, remoting.useP2pApi); - } else { - that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, - this.accessCode); - } + that.plugin.connect(this.hostJid, this.hostPublicKey, this.clientJid, + this.accessCode); }; /** diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js index 9110d4a..2d3fe00 100644 --- a/remoting/webapp/me2mom/remoting.js +++ b/remoting/webapp/me2mom/remoting.js @@ -54,14 +54,6 @@ remoting.ClientError = { */ remoting.scaleToFit = false; -/** - * Whether or not the P2P Transport API should be used. This flag is an interim - * measure to allow testing by early adopters, and will be removed when P2P API - * is enabled by default. See http://crbug.com/51198 for details. - * @type {boolean} - */ -remoting.useP2pApi = false; - // Constants representing keys used for storing persistent application state. var KEY_APP_MODE_ = 'remoting-app-mode'; var KEY_EMAIL_ = 'remoting-email'; @@ -180,8 +172,6 @@ remoting.init = function() { document.getElementById('client-footer-text-cros').id = 'client-footer-text'; } - - remoting.useP2pApi = !(window.localStorage.getItem(KEY_USE_P2P_API_) == null); } /** @@ -729,15 +719,6 @@ remoting.checkHotkeys = function(event) { } } -remoting.setUseP2pApi = function(use) { - remoting.useP2pApi = use; - if (use) { - window.localStorage.setItem(KEY_USE_P2P_API_, 'true'); - } else { - window.localStorage.removeItem(KEY_USE_P2P_API_); - } -} - function recenterToolbar_() { var toolbar = document.getElementById('session-toolbar'); var toolbarX = (window.innerWidth - toolbar.clientWidth) / 2; |