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

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

Issue 395163002: Bundle the network service in the shell on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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/profile_service_loader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/shell/profile_service_loader.h"
6
7 #include "mojo/public/cpp/application/application_connection.h"
8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/services/profile/profile_service_impl.h"
11
12 namespace mojo {
13 namespace shell {
14
15 ProfileServiceLoader::ProfileServiceLoader() {
16 }
17
18 ProfileServiceLoader::~ProfileServiceLoader() {
19 }
20
21 void ProfileServiceLoader::LoadService(
22 ServiceManager* manager,
23 const GURL& url,
24 ScopedMessagePipeHandle shell_handle) {
25 uintptr_t key = reinterpret_cast<uintptr_t>(manager);
26 if (apps_.find(key) == apps_.end()) {
27 scoped_ptr<ApplicationImpl> app(
28 new ApplicationImpl(this, shell_handle.Pass()));
29 apps_.add(key, app.Pass());
30 }
31 }
32
33 void ProfileServiceLoader::OnServiceError(ServiceManager* manager,
34 const GURL& url) {
35 apps_.erase(reinterpret_cast<uintptr_t>(manager));
36 }
37
38 bool ProfileServiceLoader::ConfigureIncomingConnection(
39 ApplicationConnection* connection) {
40 connection->AddService<ProfileServiceImpl>();
41 return true;
42 }
43
44 } // namespace shell
45 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/profile_service_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698