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

Side by Side Diff: mojo/shell/service_manager.h

Issue 93793009: Implement ServiceManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow Android to be built Created 7 years 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/run.cc ('k') | mojo/shell/service_manager.cc » ('j') | 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 2013 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 #ifndef MOJO_SHELL_SERVICE_MANAGER_H_
6 #define MOJO_SHELL_SERVICE_MANAGER_H_
7
8 #include <map>
9
10 #include "base/callback.h"
11 #include "mojo/public/system/core_cpp.h"
12 #include "url/gurl.h"
13
14 namespace mojo {
15 namespace shell {
16
17 class Context;
18
19 class ServiceManager {
20 public:
21 class Loader {
22 public:
23 virtual ~Loader();
24 virtual void Load(const GURL& url,
25 ServiceManager* manager,
26 ScopedMessagePipeHandle service_handle) = 0;
27 protected:
28 Loader();
29 };
30
31 explicit ServiceManager(Context* context);
32 ~ServiceManager();
33
34 void SetLoaderForURL(Loader* loader, const GURL& gurl);
35 Loader* GetLoaderForURL(const GURL& gurl);
36 void Connect(const GURL& url, ScopedMessagePipeHandle client_handle);
37
38 private:
39 class Service;
40 class DynamicLoader;
41
42 Context* context_;
43 scoped_ptr<Loader> default_loader_;
44 typedef std::map<GURL, Service*> ServiceMap;
45 ServiceMap url_to_service_;
46 typedef std::map<GURL, Loader*> LoaderMap;
47 LoaderMap url_to_loader_;
48 DISALLOW_COPY_AND_ASSIGN(ServiceManager);
49 };
50
51 } // namespace shell
52 } // namespace mojo
53
54 #endif // MOJO_SHELL_SERVICE_MANAGER_H_
OLDNEW
« no previous file with comments | « mojo/shell/run.cc ('k') | mojo/shell/service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698