| 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/base_paths.h" | 6 #include "base/base_paths.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "mojo/public/cpp/application/application_connection.h" | 11 #include "mojo/public/cpp/application/application_connection.h" |
| 12 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 13 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 14 #include "mojo/public/cpp/application/interface_factory.h" | 14 #include "mojo/public/cpp/application/interface_factory.h" |
| 15 #include "mojo/public/cpp/bindings/interface_ptr.h" | 15 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 16 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" | |
| 17 #include "mojo/services/network/network_context.h" | 16 #include "mojo/services/network/network_context.h" |
| 18 #include "mojo/services/network/network_service_impl.h" | 17 #include "mojo/services/network/network_service_impl.h" |
| 19 | 18 |
| 20 class Delegate : public mojo::ApplicationDelegate, | 19 class Delegate : public mojo::ApplicationDelegate, |
| 21 public mojo::InterfaceFactory<mojo::NetworkService> { | 20 public mojo::InterfaceFactory<mojo::NetworkService> { |
| 22 public: | 21 public: |
| 23 Delegate() {} | 22 Delegate() {} |
| 24 | 23 |
| 25 virtual void Initialize(mojo::ApplicationImpl* app) OVERRIDE { | 24 virtual void Initialize(mojo::ApplicationImpl* app) OVERRIDE { |
| 26 base::FilePath base_path; | 25 base::FilePath base_path; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 base::MessageLoopForIO loop; | 67 base::MessageLoopForIO loop; |
| 69 | 68 |
| 70 mojo::ApplicationImpl app( | 69 mojo::ApplicationImpl app( |
| 71 &delegate, | 70 &delegate, |
| 72 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle))); | 71 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle))); |
| 73 | 72 |
| 74 loop.Run(); | 73 loop.Run(); |
| 75 } | 74 } |
| 76 return MOJO_RESULT_OK; | 75 return MOJO_RESULT_OK; |
| 77 } | 76 } |
| OLD | NEW |