OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/profiler.h" | 8 #include "base/debug/profiler.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return; | 44 return; |
45 } | 45 } |
46 base::StringToUint(app->args()[1], &command_port_); | 46 base::StringToUint(app->args()[1], &command_port_); |
47 http_server::HttpServerFactoryPtr http_server_factory; | 47 http_server::HttpServerFactoryPtr http_server_factory; |
48 app->ConnectToService("mojo:http_server", &http_server_factory); | 48 app->ConnectToService("mojo:http_server", &http_server_factory); |
49 | 49 |
50 mojo::NetAddressPtr local_address(mojo::NetAddress::New()); | 50 mojo::NetAddressPtr local_address(mojo::NetAddress::New()); |
51 local_address->family = mojo::NET_ADDRESS_FAMILY_IPV4; | 51 local_address->family = mojo::NET_ADDRESS_FAMILY_IPV4; |
52 local_address->ipv4 = mojo::NetAddressIPv4::New(); | 52 local_address->ipv4 = mojo::NetAddressIPv4::New(); |
53 local_address->ipv4->addr.resize(4); | 53 local_address->ipv4->addr.resize(4); |
54 local_address->ipv4->addr[0] = 0; | 54 local_address->ipv4->addr[0] = 127; |
55 local_address->ipv4->addr[1] = 0; | 55 local_address->ipv4->addr[1] = 0; |
56 local_address->ipv4->addr[2] = 0; | 56 local_address->ipv4->addr[2] = 0; |
57 local_address->ipv4->addr[3] = 0; | 57 local_address->ipv4->addr[3] = 1; |
58 local_address->ipv4->port = command_port_; | 58 local_address->ipv4->port = command_port_; |
59 http_server_factory->CreateHttpServer(GetProxy(&http_server_).Pass(), | 59 http_server_factory->CreateHttpServer(GetProxy(&http_server_).Pass(), |
60 local_address.Pass()); | 60 local_address.Pass()); |
61 | 61 |
62 http_server::HttpHandlerPtr handler_ptr; | 62 http_server::HttpHandlerPtr handler_ptr; |
63 handler_binding_.Bind(GetProxy(&handler_ptr).Pass()); | 63 handler_binding_.Bind(GetProxy(&handler_ptr).Pass()); |
64 http_server_->SetHandler(".*", handler_ptr.Pass(), | 64 http_server_->SetHandler(".*", handler_ptr.Pass(), |
65 [](bool result) { DCHECK(result); }); | 65 [](bool result) { DCHECK(result); }); |
66 } | 66 } |
67 | 67 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 }; | 199 }; |
200 | 200 |
201 } // namespace debugger | 201 } // namespace debugger |
202 } // namespace sky | 202 } // namespace sky |
203 | 203 |
204 MojoResult MojoMain(MojoHandle shell_handle) { | 204 MojoResult MojoMain(MojoHandle shell_handle) { |
205 mojo::ApplicationRunnerChromium runner(new sky::debugger::SkyDebugger); | 205 mojo::ApplicationRunnerChromium runner(new sky::debugger::SkyDebugger); |
206 runner.set_message_loop_type(base::MessageLoop::TYPE_IO); | 206 runner.set_message_loop_type(base::MessageLoop::TYPE_IO); |
207 return runner.Run(shell_handle); | 207 return runner.Run(shell_handle); |
208 } | 208 } |
OLD | NEW |