Chromium Code Reviews| 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..069481b3da21018a17662bcd25d73164449efb47 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,14 @@ base::Closure QuitCurrentMessageLoopClosure() { |
| base::MessageLoop::QuitWhenIdleClosure()); |
| } |
| +net::IPAddress GetListeningIPAddress() { |
|
Wez
2016/08/30 21:42:00
nit: I'd suggest just GetListeningAddress, since I
|
| + if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| + kEngineListenOutside) == "1") { |
|
Wez
2016/08/30 21:42:00
Since this is a Boolean parameter and defaults to
|
| + return net::IPAddress::IPv4AllZeros(); |
| + } |
| + return net::IPAddress::IPv4Localhost(); |
| +} |
| + |
| uint16_t GetListeningPort() { |
| unsigned port_parsed = 0; |
| if (!base::StringToUint( |
| @@ -194,7 +198,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(GetListeningIPAddress(), GetListeningPort()); |
| TCPEngineTransport* transport = new TCPEngineTransport(address, net_log_); |
| connection_manager_->AddTransport(base::WrapUnique(transport)); |