| 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 LoadService( |
| 65 const GURL& url, | 65 ServiceManager* manager, |
| 66 ScopedMessagePipeHandle shell_handle) OVERRIDE; | 66 const GURL& url, |
| 67 scoped_refptr<LoadServiceCallbacks> callbacks) OVERRIDE; |
| 67 | 68 |
| 68 virtual void OnServiceError(ServiceManager* manager, const GURL& url) | 69 virtual void OnServiceError(ServiceManager* manager, const GURL& url) |
| 69 OVERRIDE; | 70 OVERRIDE; |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 class LoadContext; | 73 class LoadContext; |
| 73 | 74 |
| 74 // Tosses out connection-related state to service at given URL. | 75 // Tosses out connection-related state to service at given URL. |
| 75 void ForgetService(const GURL& url); | 76 void ForgetService(const GURL& url); |
| 76 | 77 |
| 77 Context* const context_; | 78 Context* const context_; |
| 78 scoped_refptr<dbus::Bus> bus_; | 79 scoped_refptr<dbus::Bus> bus_; |
| 79 | 80 |
| 80 typedef std::map<GURL, LoadContext*> LoadContextMap; | 81 typedef std::map<GURL, LoadContext*> LoadContextMap; |
| 81 LoadContextMap url_to_load_context_; | 82 LoadContextMap url_to_load_context_; |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); | 84 DISALLOW_COPY_AND_ASSIGN(DBusServiceLoader); |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace shell | 87 } // namespace shell |
| 87 } // namespace mojo | 88 } // namespace mojo |
| 88 | 89 |
| 89 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ | 90 #endif // MOJO_SHELL_DBUS_SERVICE_LOADER_H_ |
| OLD | NEW |