OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_ |
| 6 #define MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "mojo/public/system/core_cpp.h" |
| 12 #include "mojo/shell/service_manager.h" |
| 13 #include "url/gurl.h" |
| 14 |
| 15 namespace mojo { |
| 16 namespace shell { |
| 17 |
| 18 class Context; |
| 19 |
| 20 // A subclass of ServiceManager::Loader that loads a dynamic library containing |
| 21 // the implementation of the service. |
| 22 class DynamicServiceLoader : public ServiceManager::Loader { |
| 23 public: |
| 24 explicit DynamicServiceLoader(Context* context); |
| 25 virtual ~DynamicServiceLoader(); |
| 26 |
| 27 private: |
| 28 class LoadContext; |
| 29 |
| 30 // Initiates the dynamic load. If the url is a mojo: scheme then the name |
| 31 // specified will be modified to the platform's naming scheme. Also the |
| 32 // value specified to the --origin command line argument will be used as the |
| 33 // host / port. |
| 34 virtual void Load(const GURL& url, |
| 35 ScopedMessagePipeHandle service_handle) MOJO_OVERRIDE; |
| 36 |
| 37 typedef std::map<GURL, LoadContext*> LoadContextMap; |
| 38 LoadContextMap url_to_load_context_; |
| 39 Context* context_; |
| 40 DISALLOW_COPY_AND_ASSIGN(DynamicServiceLoader); |
| 41 }; |
| 42 |
| 43 } // namespace shell |
| 44 } // namespace mojo |
| 45 |
| 46 #endif // MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_ |
OLD | NEW |