Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: mojo/shell/network_service_loader.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/shell/network_service_loader.h ('k') | mojo/shell/view_manager_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mojo/shell/network_service_loader.h ('k') | mojo/shell/view_manager_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698