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

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: inding on interface_impl, delete only on shutdown 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
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::BindToRequest(
61 ApplicationConnection* connection,
62 InterfaceRequest<NetworkService> request) {
63 BindToRequest(new NetworkServiceImpl(context_.get()), &request);
64 }
65
60 } // namespace shell 66 } // namespace shell
61 } // namespace mojo 67 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698