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

Side by Side Diff: content/child/process_control_impl.h

Issue 1889253002: Remove uses of shell::Loader from content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 | « content/browser/webui/web_ui_mojo_browsertest.cc ('k') | content/child/process_control_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ 5 #ifndef CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_
6 #define CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ 6 #define CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_
7 7
8 #include <map> 8 #include <memory>
9 #include <unordered_map>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "content/common/mojo/embedded_application_runner.h"
11 #include "content/common/process_control.mojom.h" 13 #include "content/common/process_control.mojom.h"
12 #include "mojo/public/cpp/bindings/interface_request.h"
13 #include "services/shell/public/interfaces/shell_client.mojom.h" 14 #include "services/shell/public/interfaces/shell_client.mojom.h"
14 15
15 namespace shell {
16 class Loader;
17 } // namespace shell
18
19 namespace content { 16 namespace content {
20 17
21 // Default implementation of the mojom::ProcessControl interface. 18 // Default implementation of the mojom::ProcessControl interface.
22 class ProcessControlImpl : public mojom::ProcessControl { 19 class ProcessControlImpl : public mojom::ProcessControl {
23 public: 20 public:
21 using ApplicationFactoryMap =
22 std::unordered_map<std::string,
23 EmbeddedApplicationRunner::FactoryCallback>;
24
24 ProcessControlImpl(); 25 ProcessControlImpl();
25 ~ProcessControlImpl() override; 26 ~ProcessControlImpl() override;
26 27
27 using NameToLoaderMap = std::map<std::string, shell::Loader*>; 28 virtual void RegisterApplicationFactories(
28 29 ApplicationFactoryMap* factories) = 0;
29 // Registers Mojo loaders for names. 30 virtual void OnApplicationQuit() {}
30 virtual void RegisterLoaders(NameToLoaderMap* name_to_loader_map) = 0;
31 31
32 // ProcessControl: 32 // ProcessControl:
33 void LoadApplication( 33 void LoadApplication(const mojo::String& name,
34 const mojo::String& name, 34 shell::mojom::ShellClientRequest request,
35 mojo::InterfaceRequest<shell::mojom::ShellClient> request, 35 const LoadApplicationCallback& callback) override;
36 const LoadApplicationCallback& callback) override;
37 36
38 private: 37 private:
39 // Called if a LoadApplication request fails. 38 // Called if a LoadApplication request fails.
40 virtual void OnLoadFailed() {} 39 virtual void OnLoadFailed() {}
41 40
42 bool has_registered_loaders_ = false; 41 bool has_registered_apps_ = false;
43 NameToLoaderMap name_to_loader_map_; 42 std::unordered_map<std::string, std::unique_ptr<EmbeddedApplicationRunner>>
43 apps_;
44 44
45 DISALLOW_COPY_AND_ASSIGN(ProcessControlImpl); 45 DISALLOW_COPY_AND_ASSIGN(ProcessControlImpl);
46 }; 46 };
47 47
48 } // namespace content 48 } // namespace content
49 49
50 #endif // CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ 50 #endif // CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_mojo_browsertest.cc ('k') | content/child/process_control_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698