Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Side by Side Diff: mojo/shell/dynamic_application_loader.h

Issue 687433002: Remove mojo/shell and (most) service implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove mojo/gles2, disable mojo apps in component build Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/desktop/mojo_main.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_APPLICATION_LOADER_H_
6 #define MOJO_SHELL_DYNAMIC_APPLICATION_LOADER_H_
7
8 #include <map>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_vector.h"
13 #include "base/memory/weak_ptr.h"
14 #include "mojo/application_manager/application_loader.h"
15 #include "mojo/public/cpp/system/core.h"
16 #include "mojo/services/public/interfaces/network/network_service.mojom.h"
17 #include "mojo/shell/dynamic_service_runner.h"
18 #include "url/gurl.h"
19
20 namespace mojo {
21 namespace shell {
22
23 class Context;
24 class DynamicServiceRunnerFactory;
25 class DynamicServiceRunner;
26
27 // An implementation of ApplicationLoader that retrieves a dynamic library
28 // containing the implementation of the service and loads/runs it (via a
29 // DynamicServiceRunner).
30 class DynamicApplicationLoader : public ApplicationLoader {
31 public:
32 DynamicApplicationLoader(
33 Context* context,
34 scoped_ptr<DynamicServiceRunnerFactory> runner_factory);
35 ~DynamicApplicationLoader() override;
36
37 void RegisterContentHandler(const std::string& mime_type,
38 const GURL& content_handler_url);
39
40 // ApplicationLoader methods:
41 void Load(ApplicationManager* manager,
42 const GURL& url,
43 scoped_refptr<LoadCallbacks> callbacks) override;
44 void OnApplicationError(ApplicationManager* manager,
45 const GURL& url) override;
46
47 private:
48 class Loader;
49 class LocalLoader;
50 class NetworkLoader;
51
52 typedef std::map<std::string, GURL> MimeTypeToURLMap;
53 typedef base::Callback<void(Loader*)> LoaderCompleteCallback;
54
55 void LoaderComplete(Loader* loader);
56
57 Context* const context_;
58 scoped_ptr<DynamicServiceRunnerFactory> runner_factory_;
59 NetworkServicePtr network_service_;
60 MimeTypeToURLMap mime_type_to_url_;
61 ScopedVector<Loader> loaders_;
62 LoaderCompleteCallback loader_complete_callback_;
63
64 DISALLOW_COPY_AND_ASSIGN(DynamicApplicationLoader);
65 };
66
67 } // namespace shell
68 } // namespace mojo
69
70 #endif // MOJO_SHELL_DYNAMIC_APPLICATION_LOADER_H_
OLDNEW
« no previous file with comments | « mojo/shell/desktop/mojo_main.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698