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

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: Accidental inclusion of adb_run change 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
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 "base/synchronization/lock.h"
abarth-chromium 2013/12/15 22:54:10 This header doesn't appear to be used.
DaveMoore 2013/12/16 17:40:22 Done.
12 #include "mojo/public/system/core_cpp.h"
13 #include "url/gurl.h"
14
15 namespace mojo {
16 namespace shell {
17
18 class Context;
19
20 class ServiceManager {
21 public:
22 class Loader {
23 public:
24 virtual ~Loader();
25 virtual void Load(const GURL& url,
26 ServiceManager* manager,
27 ScopedMessagePipeHandle service_handle) = 0;
28 protected:
29 Loader();
30 };
31
32 explicit ServiceManager(Context* context);
33 ~ServiceManager();
34
35 void SetLoaderForURL(Loader* loader, const GURL& gurl);
36 Loader* GetLoaderForURL(const GURL& gurl);
37 void Connect(const GURL& url, ScopedMessagePipeHandle client_handle);
38
39 private:
40 class Service;
41 class DynamicLoader;
42
43 Context* context_;
44 scoped_ptr<Loader> default_loader_;
45 typedef std::map<GURL, Service*> ServiceMap;
46 ServiceMap url_to_service_;
47 typedef std::map<GURL, Loader*> LoaderMap;
48 LoaderMap url_to_loader_;
49 DISALLOW_COPY_AND_ASSIGN(ServiceManager);
50 };
51
52 } // namespace shell
53 } // namespace mojo
54
55 #endif // MOJO_SHELL_SERVICE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698