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

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

Issue 1743473002: Change Mojo URLs to structured names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@18collapse
Patch Set: . Created 4 years, 10 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
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 <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/common/process_control.mojom.h" 11 #include "content/common/process_control.mojom.h"
12 #include "mojo/public/cpp/bindings/interface_request.h" 12 #include "mojo/public/cpp/bindings/interface_request.h"
13 #include "mojo/shell/public/interfaces/shell_client.mojom.h" 13 #include "mojo/shell/public/interfaces/shell_client.mojom.h"
14 14
15 class GURL;
16
17 namespace mojo { 15 namespace mojo {
18 namespace shell { 16 namespace shell {
19 class ApplicationLoader; 17 class ApplicationLoader;
20 } // namespace shell 18 } // namespace shell
21 } // namespace mojo 19 } // namespace mojo
22 20
23 namespace content { 21 namespace content {
24 22
25 // Default implementation of the ProcessControl interface. 23 // Default implementation of the ProcessControl interface.
26 class ProcessControlImpl : public ProcessControl { 24 class ProcessControlImpl : public ProcessControl {
27 public: 25 public:
28 ProcessControlImpl(); 26 ProcessControlImpl();
29 ~ProcessControlImpl() override; 27 ~ProcessControlImpl() override;
30 28
31 using URLToLoaderMap = std::map<GURL, mojo::shell::ApplicationLoader*>; 29 using NameToLoaderMap =
30 std::map<std::string, mojo::shell::ApplicationLoader*>;
32 31
33 // Registers Mojo applications loaders for URLs. 32 // Registers Mojo applications loaders for names.
34 virtual void RegisterApplicationLoaders( 33 virtual void RegisterApplicationLoaders(
35 URLToLoaderMap* url_to_loader_map) = 0; 34 NameToLoaderMap* name_to_loader_map) = 0;
36 35
37 // ProcessControl: 36 // ProcessControl:
38 void LoadApplication( 37 void LoadApplication(
39 const mojo::String& url, 38 const mojo::String& name,
40 mojo::InterfaceRequest<mojo::shell::mojom::ShellClient> request, 39 mojo::InterfaceRequest<mojo::shell::mojom::ShellClient> request,
41 const LoadApplicationCallback& callback) override; 40 const LoadApplicationCallback& callback) override;
42 41
43 private: 42 private:
44 // Called if a LoadApplication request fails. 43 // Called if a LoadApplication request fails.
45 virtual void OnLoadFailed() {} 44 virtual void OnLoadFailed() {}
46 45
47 bool has_registered_loaders_ = false; 46 bool has_registered_loaders_ = false;
48 URLToLoaderMap url_to_loader_map_; 47 NameToLoaderMap name_to_loader_map_;
49 48
50 DISALLOW_COPY_AND_ASSIGN(ProcessControlImpl); 49 DISALLOW_COPY_AND_ASSIGN(ProcessControlImpl);
51 }; 50 };
52 51
53 } // namespace content 52 } // namespace content
54 53
55 #endif // CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ 54 #endif // CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version_unittest.cc ('k') | content/child/process_control_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698