OLD | NEW |
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 #ifndef MOJO_SHELL_DBUS_SERVICE_LOADER_H_ | 5 #ifndef MOJO_SHELL_DBUS_SERVICE_LOADER_H_ |
6 #define MOJO_SHELL_DBUS_SERVICE_LOADER_H_ | 6 #define MOJO_SHELL_DBUS_SERVICE_LOADER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // by the DBus object path of an object that implements the org.chromium.Mojo | 54 // by the DBus object path of an object that implements the org.chromium.Mojo |
55 // interface as discussed above. | 55 // interface as discussed above. |
56 // | 56 // |
57 // Example: | 57 // Example: |
58 // dbus:org.chromium.EchoService/org/chromium/MojoImpl | 58 // dbus:org.chromium.EchoService/org/chromium/MojoImpl |
59 // | 59 // |
60 // This will tell DBusServiceLoader to reach out to a service with | 60 // This will tell DBusServiceLoader to reach out to a service with |
61 // the name "org.chromium.EchoService" and invoke the method | 61 // the name "org.chromium.EchoService" and invoke the method |
62 // "org.chromium.Mojo.ConnectChannel" on the object exported at | 62 // "org.chromium.Mojo.ConnectChannel" on the object exported at |
63 // "/org/chromium/MojoImpl". | 63 // "/org/chromium/MojoImpl". |
64 virtual void LoadService(ServiceManager* manager, | 64 virtual void Load(ServiceManager* manager, |
65 const GURL& url, | 65 const GURL& url, |
66 ScopedMessagePipeHandle shell_handle) OVERRIDE; | 66 scoped_refptr<LoadCallbacks> callbacks) OVERRIDE; |
67 | 67 |
68 virtual void OnServiceError(ServiceManager* manager, const GURL& url) | 68 virtual void OnServiceError(ServiceManager* manager, const GURL& url) |
69 OVERRIDE; | 69 OVERRIDE; |
70 | 70 |
71 private: | 71 private: |
72 class LoadContext; | 72 class LoadContext; |
73 | 73 |
74 // Tosses out connection-related state to service at given URL. | 74 // Tosses out connection-related state to service at given URL. |
75 void ForgetService(const GURL& url); | 75 void ForgetService(const GURL& url); |
76 | 76 |
77 Context* const context_; | 77 Context* const context_; |
78 scoped_refptr<dbus::Bus> bus_; | 78 scoped_refptr<dbus::Bus> bus_; |
79 | 79 |
80 typedef std::map<GURL, LoadContext*> LoadContextMap; | 80 typedef std::map<GURL, LoadContext*> LoadContextMap; |
81 LoadContextMap url_to_load_context_; | 81 LoadContextMap url_to_load_context_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); | 83 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace shell | 86 } // namespace shell |
87 } // namespace mojo | 87 } // namespace mojo |
88 | 88 |
89 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ | 89 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ |
OLD | NEW |