[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / mojo / shell / dynamic_service_loader.h
blob72bf093e56e093809a83cd8d3a934f904cf12bca
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_
8 #include <map>
10 #include "base/macros.h"
11 #include "mojo/public/cpp/system/core.h"
12 #include "mojo/service_manager/service_loader.h"
13 #include "mojo/services/public/interfaces/network/network_service.mojom.h"
14 #include "mojo/shell/dynamic_service_runner.h"
15 #include "mojo/shell/keep_alive.h"
16 #include "url/gurl.h"
18 namespace mojo {
19 namespace shell {
21 class Context;
22 class DynamicServiceRunnerFactory;
24 // An implementation of ServiceLoader that retrieves a dynamic library
25 // containing the implementation of the service and loads/runs it (via a
26 // DynamicServiceRunner).
27 class DynamicServiceLoader : public ServiceLoader {
28 public:
29 DynamicServiceLoader(Context* context,
30 scoped_ptr<DynamicServiceRunnerFactory> runner_factory);
31 virtual ~DynamicServiceLoader();
33 // ServiceLoader methods:
34 virtual void LoadService(ServiceManager* manager,
35 const GURL& url,
36 ScopedMessagePipeHandle service_handle) OVERRIDE;
37 virtual void OnServiceError(ServiceManager* manager, const GURL& url)
38 OVERRIDE;
40 private:
41 Context* const context_;
42 scoped_ptr<DynamicServiceRunnerFactory> runner_factory_;
43 NetworkServicePtr network_service_;
45 DISALLOW_COPY_AND_ASSIGN(DynamicServiceLoader);
48 } // namespace shell
49 } // namespace mojo
51 #endif // MOJO_SHELL_DYNAMIC_SERVICE_LOADER_H_