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 "mojo/shell/network_service_loader.h" | 5 #include "mojo/shell/network_service_loader.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 apps_.erase(reinterpret_cast<uintptr_t>(manager)); | 46 apps_.erase(reinterpret_cast<uintptr_t>(manager)); |
47 } | 47 } |
48 | 48 |
49 void NetworkServiceLoader::Initialize(ApplicationImpl* app) { | 49 void NetworkServiceLoader::Initialize(ApplicationImpl* app) { |
50 // The context must be created on the same thread as the network service. | 50 // The context must be created on the same thread as the network service. |
51 context_.reset(new NetworkContext(GetBasePath())); | 51 context_.reset(new NetworkContext(GetBasePath())); |
52 } | 52 } |
53 | 53 |
54 bool NetworkServiceLoader::ConfigureIncomingConnection( | 54 bool NetworkServiceLoader::ConfigureIncomingConnection( |
55 ApplicationConnection* connection) { | 55 ApplicationConnection* connection) { |
56 connection->AddService<NetworkServiceImpl>(context_.get()); | 56 connection->AddService(this); |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
| 60 void NetworkServiceLoader::Create(ApplicationConnection* connection, |
| 61 InterfaceRequest<NetworkService> request) { |
| 62 BindToRequest(new NetworkServiceImpl(connection, context_.get()), &request); |
| 63 } |
| 64 |
60 } // namespace shell | 65 } // namespace shell |
61 } // namespace mojo | 66 } // namespace mojo |
OLD | NEW |