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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // | 57 // |
58 // Example: | 58 // Example: |
59 // dbus:org.chromium.EchoService/org/chromium/MojoImpl | 59 // dbus:org.chromium.EchoService/org/chromium/MojoImpl |
60 // | 60 // |
61 // This will tell DBusServiceLoader to reach out to a service with | 61 // This will tell DBusServiceLoader to reach out to a service with |
62 // the name "org.chromium.EchoService" and invoke the method | 62 // the name "org.chromium.EchoService" and invoke the method |
63 // "org.chromium.Mojo.ConnectChannel" on the object exported at | 63 // "org.chromium.Mojo.ConnectChannel" on the object exported at |
64 // "/org/chromium/MojoImpl". | 64 // "/org/chromium/MojoImpl". |
65 virtual void LoadService(ServiceManager* manager, | 65 virtual void LoadService(ServiceManager* manager, |
66 const GURL& url, | 66 const GURL& url, |
67 ScopedShellHandle service_handle) OVERRIDE; | 67 ScopedMessagePipeHandle service_handle) OVERRIDE; |
68 | 68 |
69 virtual void OnServiceError(ServiceManager* manager, const GURL& url) | 69 virtual void OnServiceError(ServiceManager* manager, const GURL& url) |
70 OVERRIDE; | 70 OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
73 class LoadContext; | 73 class LoadContext; |
74 | 74 |
75 // Tosses out connection-related state to service at given URL. | 75 // Tosses out connection-related state to service at given URL. |
76 void ForgetService(const GURL& url); | 76 void ForgetService(const GURL& url); |
77 | 77 |
78 Context* const context_; | 78 Context* const context_; |
79 scoped_refptr<dbus::Bus> bus_; | 79 scoped_refptr<dbus::Bus> bus_; |
80 | 80 |
81 typedef std::map<GURL, LoadContext*> LoadContextMap; | 81 typedef std::map<GURL, LoadContext*> LoadContextMap; |
82 LoadContextMap url_to_load_context_; | 82 LoadContextMap url_to_load_context_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); | 84 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace shell | 87 } // namespace shell |
88 } // namespace mojo | 88 } // namespace mojo |
89 | 89 |
90 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ | 90 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ |
OLD | NEW |