| Index: blimp/engine/session/blimp_engine_session.cc
|
| diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
|
| index 9029e8de941b580274a98a9b0c5eed7ad3f75b5a..309360033b242f1d5270f28f513af9bbd5d4c73b 100644
|
| --- a/blimp/engine/session/blimp_engine_session.cc
|
| +++ b/blimp/engine/session/blimp_engine_session.cc
|
| @@ -87,10 +87,6 @@ class FocusRulesImpl : public wm::BaseFocusRules {
|
| DISALLOW_COPY_AND_ASSIGN(FocusRulesImpl);
|
| };
|
|
|
| -net::IPAddress GetIPv4AnyAddress() {
|
| - return net::IPAddress(0, 0, 0, 0);
|
| -}
|
| -
|
| // Proxies calls to TaskRunner::PostTask while stripping the return value,
|
| // which provides a suitable function prototype for binding a base::Closure.
|
| void PostTask(const scoped_refptr<base::TaskRunner>& task_runner,
|
| @@ -104,6 +100,13 @@ base::Closure QuitCurrentMessageLoopClosure() {
|
| base::MessageLoop::QuitWhenIdleClosure());
|
| }
|
|
|
| +net::IPAddress GetListeningAddress() {
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(kAllowNonLocalhost)) {
|
| + return net::IPAddress::IPv4AllZeros();
|
| + }
|
| + return net::IPAddress::IPv4Localhost();
|
| +}
|
| +
|
| uint16_t GetListeningPort() {
|
| unsigned port_parsed = 0;
|
| if (!base::StringToUint(
|
| @@ -194,7 +197,7 @@ void EngineNetworkComponents::Initialize(
|
| base::MakeUnique<BlobChannelService>(blob_channel_sender, ui_task_runner);
|
|
|
| // Adds BlimpTransports to connection_manager_.
|
| - net::IPEndPoint address(GetIPv4AnyAddress(), GetListeningPort());
|
| + net::IPEndPoint address(GetListeningAddress(), GetListeningPort());
|
| TCPEngineTransport* transport = new TCPEngineTransport(address, net_log_);
|
| connection_manager_->AddTransport(base::WrapUnique(transport));
|
|
|
|
|