Commit c3c43e87 authored by sergeyu's avatar sergeyu Committed by Commit bot

Use UrlRequest in PortAllocator.

PepperPortAllocator and ChromiumPortAllocator were different only in
how they were sending HTTP requests to allocate relay session. They were
using pp::URLLoader and net::URLFetcher respectively, but otherwise
contained largely the same logic. Now URL request logic is abstracted
with remoting::UrlRequest interface and so a single PortAllocator
implementation can be used in all cases.

BUG=577954

Review URL: https://codereview.chromium.org/1681393006

Cr-Commit-Position: refs/heads/master@{#375042}
parent cb092cd9
......@@ -13,6 +13,7 @@
#include "base/logging.h"
#include "jingle/glue/thread_wrapper.h"
#include "net/socket/client_socket_factory.h"
#include "remoting/base/chromium_url_request.h"
#include "remoting/base/service_urls.h"
#include "remoting/client/audio_player.h"
#include "remoting/client/client_status_logger.h"
......@@ -21,7 +22,7 @@
#include "remoting/client/jni/jni_frame_consumer.h"
#include "remoting/client/software_video_renderer.h"
#include "remoting/client/token_fetcher_proxy.h"
#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/chromium_socket_factory.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/negotiating_client_authenticator.h"
......@@ -424,17 +425,14 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() {
signaling_.get(),
ServiceUrls::GetInstance()->directory_bot_jid()));
protocol::NetworkSettings network_settings(
protocol::NetworkSettings::NAT_TRAVERSAL_FULL);
// Use Chrome's network stack to allocate ports for peer-to-peer channels.
scoped_ptr<protocol::ChromiumPortAllocatorFactory> port_allocator_factory(
new protocol::ChromiumPortAllocatorFactory(
jni_runtime_->url_requester()));
scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signaling_.get(), std::move(port_allocator_factory), network_settings,
signaling_.get(),
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
make_scoped_ptr(
new ChromiumUrlRequestFactory(jni_runtime_->url_requester())),
protocol::NetworkSettings(
protocol::NetworkSettings::NAT_TRAVERSAL_FULL),
protocol::TransportRole::CLIENT);
if (flags_.find("useWebrtc") != std::string::npos) {
......
......@@ -46,7 +46,8 @@
#include "remoting/client/plugin/pepper_audio_player.h"
#include "remoting/client/plugin/pepper_main_thread_task_runner.h"
#include "remoting/client/plugin/pepper_mouse_locker.h"
#include "remoting/client/plugin/pepper_port_allocator.h"
#include "remoting/client/plugin/pepper_port_allocator_factory.h"
#include "remoting/client/plugin/pepper_url_request.h"
#include "remoting/client/plugin/pepper_video_renderer_2d.h"
#include "remoting/client/plugin/pepper_video_renderer_3d.h"
#include "remoting/client/software_video_renderer.h"
......@@ -55,6 +56,7 @@
#include "remoting/protocol/connection_to_host.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/transport_context.h"
#include "third_party/webrtc/base/helpers.h"
#include "url/gurl.h"
namespace remoting {
......@@ -690,6 +692,7 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) {
new protocol::TransportContext(
signal_strategy_.get(),
make_scoped_ptr(new PepperPortAllocatorFactory(this)),
make_scoped_ptr(new PepperUrlRequestFactory(this)),
protocol::NetworkSettings(
protocol::NetworkSettings::NAT_TRAVERSAL_FULL),
protocol::TransportRole::CLIENT));
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/client/plugin/pepper_port_allocator.h"
#include <stdint.h>
#include <utility>
#include "base/bind.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "net/base/net_util.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/url_loader.h"
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/url_response_info.h"
#include "ppapi/utility/completion_callback_factory.h"
#include "remoting/client/plugin/pepper_network_manager.h"
#include "remoting/client/plugin/pepper_packet_socket_factory.h"
#include "remoting/client/plugin/pepper_util.h"
#include "remoting/protocol/transport_context.h"
namespace remoting {
namespace {
// Read buffer we allocate per read when reading response from
// URLLoader. Normally the response from URL loader is smaller than 1kB.
const int kReadSize = 1024;
class PepperPortAllocatorSession : public protocol::PortAllocatorSessionBase {
public:
PepperPortAllocatorSession(
PepperPortAllocator* allocator,
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password);
~PepperPortAllocatorSession() override;
// PortAllocatorBase overrides.
void SendSessionRequest(const std::string& host) override;
private:
void OnUrlOpened(int32_t result);
void ReadResponseBody();
void OnResponseBodyRead(int32_t result);
pp::InstanceHandle pp_instance_;
cricket::ServerAddresses stun_hosts_;
scoped_ptr<pp::URLLoader> relay_url_loader_;
std::vector<char> relay_response_body_;
bool relay_response_received_ = false;
pp::CompletionCallbackFactory<PepperPortAllocatorSession> callback_factory_;
DISALLOW_COPY_AND_ASSIGN(PepperPortAllocatorSession);
};
PepperPortAllocatorSession::PepperPortAllocatorSession(
PepperPortAllocator* allocator,
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password)
: PortAllocatorSessionBase(allocator,
content_name,
component,
ice_username_fragment,
ice_password),
pp_instance_(allocator->pp_instance()),
callback_factory_(this) {}
PepperPortAllocatorSession::~PepperPortAllocatorSession() {}
void PepperPortAllocatorSession::SendSessionRequest(const std::string& host) {
relay_url_loader_.reset(new pp::URLLoader(pp_instance_));
pp::URLRequestInfo request_info(pp_instance_);
std::string url = "https://" + host + GetSessionRequestUrl() + "&sn=1";
request_info.SetURL(url);
request_info.SetMethod("GET");
std::stringstream headers;
headers << "X-Talk-Google-Relay-Auth: " << relay_token() << "\n\r";
headers << "X-Google-Relay-Auth: " << relay_token() << "\n\r";
headers << "X-Stream-Type: " << "chromoting" << "\n\r";
request_info.SetHeaders(headers.str());
pp::CompletionCallback callback =
callback_factory_.NewCallback(&PepperPortAllocatorSession::OnUrlOpened);
int result = relay_url_loader_->Open(request_info, callback);
DCHECK_EQ(result, PP_OK_COMPLETIONPENDING);
}
void PepperPortAllocatorSession::OnUrlOpened(int32_t result) {
if (result == PP_ERROR_ABORTED) {
return;
}
if (result < 0) {
LOG(WARNING) << "URLLoader failed: " << result;
// Retry creating session.
TryCreateRelaySession();
return;
}
pp::URLResponseInfo response = relay_url_loader_->GetResponseInfo();
DCHECK(!response.is_null());
if (response.GetStatusCode() != 200) {
LOG(WARNING) << "Received HTTP status code " << response.GetStatusCode();
// Retry creating session.
TryCreateRelaySession();
return;
}
relay_response_body_.clear();
ReadResponseBody();
}
void PepperPortAllocatorSession::ReadResponseBody() {
int pos = relay_response_body_.size();
relay_response_body_.resize(pos + kReadSize);
pp::CompletionCallback callback = callback_factory_.NewCallback(
&PepperPortAllocatorSession::OnResponseBodyRead);
int result = relay_url_loader_->ReadResponseBody(&relay_response_body_[pos],
kReadSize,
callback);
DCHECK_EQ(result, PP_OK_COMPLETIONPENDING);
}
void PepperPortAllocatorSession::OnResponseBodyRead(int32_t result) {
if (result == PP_ERROR_ABORTED) {
return;
}
if (result < 0) {
LOG(WARNING) << "Failed to read HTTP response body when "
"creating relay session: " << result;
// Retry creating session.
TryCreateRelaySession();
return;
}
// Resize the buffer in case we've read less than was requested.
CHECK_LE(result, kReadSize);
CHECK_GE(static_cast<int>(relay_response_body_.size()), kReadSize);
relay_response_body_.resize(relay_response_body_.size() - kReadSize + result);
if (result == 0) {
relay_response_received_ = true;
ReceiveSessionResponse(std::string(relay_response_body_.begin(),
relay_response_body_.end()));
return;
}
ReadResponseBody();
}
} // namespace
PepperPortAllocator::PepperPortAllocator(
scoped_refptr<protocol::TransportContext> transport_context,
pp::InstanceHandle pp_instance)
: PortAllocatorBase(
make_scoped_ptr(new PepperNetworkManager(pp_instance)),
make_scoped_ptr(new PepperPacketSocketFactory(pp_instance)),
transport_context),
pp_instance_(pp_instance) {}
PepperPortAllocator::~PepperPortAllocator() {}
cricket::PortAllocatorSession* PepperPortAllocator::CreateSessionInternal(
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password) {
return new PepperPortAllocatorSession(this, content_name, component,
ice_username_fragment, ice_password);
}
PepperPortAllocatorFactory::PepperPortAllocatorFactory(
pp::InstanceHandle pp_instance)
: pp_instance_(pp_instance) {}
PepperPortAllocatorFactory::~PepperPortAllocatorFactory() {}
scoped_ptr<cricket::PortAllocator>
PepperPortAllocatorFactory::CreatePortAllocator(
scoped_refptr<protocol::TransportContext> transport_context) {
return make_scoped_ptr(
new PepperPortAllocator(transport_context, pp_instance_));
}
} // namespace remoting
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/client/plugin/pepper_port_allocator_factory.h"
#include "remoting/client/plugin/pepper_network_manager.h"
#include "remoting/client/plugin/pepper_packet_socket_factory.h"
#include "remoting/protocol/port_allocator.h"
#include "remoting/protocol/transport_context.h"
namespace remoting {
PepperPortAllocatorFactory::PepperPortAllocatorFactory(
pp::InstanceHandle pp_instance)
: pp_instance_(pp_instance) {}
PepperPortAllocatorFactory::~PepperPortAllocatorFactory() {}
scoped_ptr<cricket::PortAllocator>
PepperPortAllocatorFactory::CreatePortAllocator(
scoped_refptr<protocol::TransportContext> transport_context) {
return make_scoped_ptr(new protocol::PortAllocator(
make_scoped_ptr(new PepperNetworkManager(pp_instance_)),
make_scoped_ptr(new PepperPacketSocketFactory(pp_instance_)),
transport_context));
}
} // namespace remoting
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_
#define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_
#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_FACTORY_H_
#define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_FACTORY_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "ppapi/cpp/instance_handle.h"
#include "remoting/protocol/port_allocator_base.h"
#include "remoting/protocol/port_allocator_factory.h"
namespace remoting {
// An implementation of cricket::PortAllocator for libjingle that is used by the
// client plugin. It uses Pepper URLLoader API when creating relay sessions.
class PepperPortAllocator : public protocol::PortAllocatorBase {
public:
PepperPortAllocator(
scoped_refptr<protocol::TransportContext> transport_context,
pp::InstanceHandle pp_instance);
~PepperPortAllocator() override;
pp::InstanceHandle pp_instance() { return pp_instance_; }
// PortAllocatorBase overrides.
cricket::PortAllocatorSession* CreateSessionInternal(
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password) override;
private:
pp::InstanceHandle pp_instance_;
scoped_ptr<rtc::NetworkManager> network_manager_;
scoped_ptr<rtc::PacketSocketFactory> socket_factory_;
DISALLOW_COPY_AND_ASSIGN(PepperPortAllocator);
};
class PepperPortAllocatorFactory : public protocol::PortAllocatorFactory {
public:
PepperPortAllocatorFactory(pp::InstanceHandle pp_instance);
......@@ -57,4 +30,4 @@ class PepperPortAllocatorFactory : public protocol::PortAllocatorFactory {
} // namespace remoting
#endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_H_
#endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_FACTORY_H_
......@@ -16,6 +16,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "policy/policy_constants.h"
#include "remoting/base/auto_thread.h"
#include "remoting/base/chromium_url_request.h"
#include "remoting/base/logging.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/host/chromoting_host.h"
......@@ -27,7 +28,7 @@
#include "remoting/host/it2me_desktop_environment.h"
#include "remoting/host/policy_watcher.h"
#include "remoting/host/register_support_host_request.h"
#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/ice_transport.h"
#include "remoting/protocol/it2me_host_authenticator_factory.h"
#include "remoting/protocol/jingle_session_manager.h"
......@@ -238,7 +239,8 @@ void It2MeHost::FinishConnect() {
scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signal_strategy_.get(),
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory(
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
make_scoped_ptr(new ChromiumUrlRequestFactory(
host_context_->url_request_context_getter())),
network_settings, protocol::TransportRole::SERVER);
......
......@@ -38,6 +38,7 @@
#include "policy/policy_constants.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/base/breakpad.h"
#include "remoting/base/chromium_url_request.h"
#include "remoting/base/constants.h"
#include "remoting/base/logging.h"
#include "remoting/base/rsa_key_pair.h"
......@@ -80,7 +81,7 @@
#include "remoting/host/video_frame_recorder_host_extension.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/channel_authenticator.h"
#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/me2me_host_authenticator_factory.h"
#include "remoting/protocol/network_settings.h"
......@@ -1522,7 +1523,8 @@ void HostProcess::StartHost() {
scoped_refptr<protocol::TransportContext> transport_context =
new protocol::TransportContext(
signal_strategy_.get(),
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory(
make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory()),
make_scoped_ptr(new ChromiumUrlRequestFactory(
context_->url_request_context_getter())),
network_settings, protocol::TransportRole::SERVER);
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/protocol/chromium_port_allocator.h"
#include <utility>
#include "base/bind.h"
#include "base/macros.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/protocol/chromium_socket_factory.h"
#include "remoting/protocol/transport_context.h"
#include "url/gurl.h"
namespace remoting {
namespace protocol {
namespace {
class ChromiumPortAllocatorSession : public PortAllocatorSessionBase,
public net::URLFetcherDelegate {
public:
ChromiumPortAllocatorSession(ChromiumPortAllocator* allocator,
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password);
~ChromiumPortAllocatorSession() override;
// PortAllocatorBase overrides.
void SendSessionRequest(const std::string& host) override;
// net::URLFetcherDelegate interface.
void OnURLFetchComplete(const net::URLFetcher* url_fetcher) override;
private:
scoped_refptr<net::URLRequestContextGetter> url_context_;
std::set<const net::URLFetcher*> url_fetchers_;
DISALLOW_COPY_AND_ASSIGN(ChromiumPortAllocatorSession);
};
ChromiumPortAllocatorSession::ChromiumPortAllocatorSession(
ChromiumPortAllocator* allocator,
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password)
: PortAllocatorSessionBase(allocator,
content_name,
component,
ice_username_fragment,
ice_password),
url_context_(allocator->url_context()) {}
ChromiumPortAllocatorSession::~ChromiumPortAllocatorSession() {
STLDeleteElements(&url_fetchers_);
}
void ChromiumPortAllocatorSession::SendSessionRequest(const std::string& host) {
GURL url("https://" + host + GetSessionRequestUrl() + "&sn=1");
scoped_ptr<net::URLFetcher> url_fetcher =
net::URLFetcher::Create(url, net::URLFetcher::GET, this);
url_fetcher->SetRequestContext(url_context_.get());
url_fetcher->AddExtraRequestHeader("X-Talk-Google-Relay-Auth: " +
relay_token());
url_fetcher->AddExtraRequestHeader("X-Google-Relay-Auth: " + relay_token());
url_fetcher->AddExtraRequestHeader("X-Stream-Type: chromoting");
url_fetcher->Start();
url_fetchers_.insert(url_fetcher.release());
}
void ChromiumPortAllocatorSession::OnURLFetchComplete(
const net::URLFetcher* source) {
int response_code = source->GetResponseCode();
std::string response;
source->GetResponseAsString(&response);
url_fetchers_.erase(source);
delete source;
if (response_code != net::HTTP_OK) {
LOG(WARNING) << "Received error when allocating relay session: "
<< response_code;
TryCreateRelaySession();
return;
}
ReceiveSessionResponse(response);
}
} // namespace
ChromiumPortAllocator::ChromiumPortAllocator(
scoped_ptr<rtc::NetworkManager> network_manager,
scoped_ptr<rtc::PacketSocketFactory> socket_factory,
scoped_refptr<TransportContext> transport_context,
scoped_refptr<net::URLRequestContextGetter> url_context)
: PortAllocatorBase(std::move(network_manager),
std::move(socket_factory),
transport_context),
url_context_(url_context) {}
ChromiumPortAllocator::~ChromiumPortAllocator() {}
cricket::PortAllocatorSession* ChromiumPortAllocator::CreateSessionInternal(
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password) {
return new ChromiumPortAllocatorSession(this, content_name, component,
ice_username_fragment, ice_password);
}
ChromiumPortAllocatorFactory::ChromiumPortAllocatorFactory(
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter)
: url_request_context_getter_(url_request_context_getter) {}
ChromiumPortAllocatorFactory::~ChromiumPortAllocatorFactory() {}
scoped_ptr<cricket::PortAllocator>
ChromiumPortAllocatorFactory::CreatePortAllocator(
scoped_refptr<TransportContext> transport_context) {
scoped_ptr<rtc::NetworkManager> network_manager(
new rtc::BasicNetworkManager());
scoped_ptr<rtc::PacketSocketFactory> socket_factory(
new ChromiumPacketSocketFactory());
return make_scoped_ptr(new ChromiumPortAllocator(
std::move(network_manager), std::move(socket_factory), transport_context,
url_request_context_getter_));
}
} // namespace protocol
} // namespace remoting
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/chromium_socket_factory.h"
#include "remoting/protocol/port_allocator.h"
#include "remoting/protocol/transport_context.h"
namespace remoting {
namespace protocol {
ChromiumPortAllocatorFactory::ChromiumPortAllocatorFactory() {}
ChromiumPortAllocatorFactory::~ChromiumPortAllocatorFactory() {}
scoped_ptr<cricket::PortAllocator>
ChromiumPortAllocatorFactory::CreatePortAllocator(
scoped_refptr<TransportContext> transport_context) {
return make_scoped_ptr(new PortAllocator(
make_scoped_ptr(new rtc::BasicNetworkManager()),
make_scoped_ptr(new ChromiumPacketSocketFactory()), transport_context));
}
} // namespace protocol
} // namespace remoting
// Copyright 2014 The Chromium Authors. All rights reserved.
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_PROTOCOL_CHROMIUM_PORT_ALLOCATOR_H_
#define REMOTING_PROTOCOL_CHROMIUM_PORT_ALLOCATOR_H_
#ifndef REMOTING_PROTOCOL_CHROMIUM_PORT_ALLOCATOR_FACTORY_H_
#define REMOTING_PROTOCOL_CHROMIUM_PORT_ALLOCATOR_FACTORY_H_
#include <set>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "remoting/protocol/port_allocator_base.h"
#include "remoting/protocol/port_allocator_factory.h"
namespace net {
class URLRequestContextGetter;
} // namespace net
namespace remoting {
namespace protocol {
struct NetworkSettings;
// An implementation of cricket::PortAllocator that uses Chromium's network
// stack.
class ChromiumPortAllocator : public PortAllocatorBase {
public:
ChromiumPortAllocator(
scoped_ptr<rtc::NetworkManager> network_manager,
scoped_ptr<rtc::PacketSocketFactory> socket_factory,
scoped_refptr<TransportContext> transport_context,
scoped_refptr<net::URLRequestContextGetter> url_context);
~ChromiumPortAllocator() override;
scoped_refptr<net::URLRequestContextGetter> url_context() {
return url_context_;
}
// PortAllocatorBase overrides.
cricket::PortAllocatorSession* CreateSessionInternal(
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password) override;
private:
scoped_refptr<net::URLRequestContextGetter> url_context_;
DISALLOW_COPY_AND_ASSIGN(ChromiumPortAllocator);
};
class ChromiumPortAllocatorFactory : public PortAllocatorFactory {
public:
ChromiumPortAllocatorFactory(
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter);
ChromiumPortAllocatorFactory();
~ChromiumPortAllocatorFactory() override;
// PortAllocatorFactory interface.
......@@ -61,12 +25,10 @@ class ChromiumPortAllocatorFactory : public PortAllocatorFactory {
scoped_refptr<TransportContext> transport_context) override;
private:
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
DISALLOW_COPY_AND_ASSIGN(ChromiumPortAllocatorFactory);
};
} // namespace protocol
} // namespace remoting
#endif // REMOTING_HOST_HOST_PORT_ALLOCATOR_H_
#endif // REMOTING_PROTOCOL_CHROMIUM_PORT_ALLOCATOR_FACTORY_H_
......@@ -15,7 +15,8 @@
#include "base/thread_task_runner_handle.h"
#include "jingle/glue/thread_wrapper.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/base/url_request.h"
#include "remoting/protocol/chromium_port_allocator_factory.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/fake_authenticator.h"
#include "remoting/protocol/message_channel_factory.h"
......@@ -117,8 +118,8 @@ class IceTransportTest : public testing::Test {
host_transport_.reset(new IceTransport(
new TransportContext(
nullptr, make_scoped_ptr(new ChromiumPortAllocatorFactory(nullptr)),
network_settings_, TransportRole::SERVER),
nullptr, make_scoped_ptr(new ChromiumPortAllocatorFactory()),
nullptr, network_settings_, TransportRole::SERVER),
&host_event_handler_));
if (!host_authenticator_) {
host_authenticator_.reset(new FakeAuthenticator(
......@@ -127,8 +128,8 @@ class IceTransportTest : public testing::Test {
client_transport_.reset(new IceTransport(
new TransportContext<