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.
5 #ifndef MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_
6 #define MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_
10 #include "base/basictypes.h"
11 #include "mojo/public/system/core_cpp.h"
12 #include "mojo/shell/keep_alive.h"
13 #include "mojo/shell/service_manager.h"
14 #include "mojom/shell.h"
22 // A subclass of ServiceManager::Loader that loads a dynamic library containing
23 // the implementation of the service.
24 class DynamicServiceLoader : public ServiceManager::Loader {
26 explicit DynamicServiceLoader(Context* context);
27 virtual ~DynamicServiceLoader();
29 // Initiates the dynamic load. If the url is a mojo: scheme then the name
30 // specified will be modified to the platform's naming scheme. Also the
31 // value specified to the --origin command line argument will be used as the
33 virtual void Load(const GURL& url,
34 ScopedShellHandle service_handle) MOJO_OVERRIDE;
39 void AppCompleted(const GURL& url);
41 typedef std::map<GURL, LoadContext*> LoadContextMap;
42 LoadContextMap url_to_load_context_;
45 DISALLOW_COPY_AND_ASSIGN(DynamicServiceLoader);
51 #endif // MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_