| OLD | NEW |
| 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 UTILITY_PROCESS_CONTROL_IMPL_H_ | 5 #ifndef CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ |
| 6 #define UTILITY_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 "base/memory/scoped_ptr.h" | |
| 12 #include "content/common/process_control.mojom.h" | 11 #include "content/common/process_control.mojom.h" |
| 13 #include "mojo/application/public/interfaces/application.mojom.h" | 12 #include "mojo/application/public/interfaces/application.mojom.h" |
| 14 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" | 13 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
| 15 | 14 |
| 16 class GURL; | 15 class GURL; |
| 17 | 16 |
| 18 namespace mojo { | 17 namespace mojo { |
| 19 namespace shell { | 18 namespace shell { |
| 20 class ApplicationLoader; | 19 class ApplicationLoader; |
| 21 } // namespace shell | 20 } // namespace shell |
| 22 } // namespace mojo | 21 } // namespace mojo |
| 23 | 22 |
| 24 namespace content { | 23 namespace content { |
| 25 | 24 |
| 26 // Implementation of the ProcessControl interface. Exposed to the browser via | 25 // Default implementation of the ProcessControl interface. |
| 27 // the utility process's ServiceRegistry. | 26 class ProcessControlImpl : public ProcessControl { |
| 28 class UtilityProcessControlImpl : public ProcessControl { | |
| 29 public: | 27 public: |
| 30 UtilityProcessControlImpl(); | 28 ProcessControlImpl(); |
| 31 ~UtilityProcessControlImpl() override; | 29 ~ProcessControlImpl() override; |
| 32 | 30 |
| 33 using URLToLoaderMap = std::map<GURL, mojo::shell::ApplicationLoader*>; | 31 using URLToLoaderMap = std::map<GURL, mojo::shell::ApplicationLoader*>; |
| 34 | 32 |
| 33 // Registers Mojo applications loaders for URLs. |
| 34 virtual void RegisterApplicationLoaders( |
| 35 URLToLoaderMap* url_to_loader_map) = 0; |
| 36 |
| 35 // ProcessControl: | 37 // ProcessControl: |
| 36 void LoadApplication(const mojo::String& url, | 38 void LoadApplication(const mojo::String& url, |
| 37 mojo::InterfaceRequest<mojo::Application> request, | 39 mojo::InterfaceRequest<mojo::Application> request, |
| 38 const LoadApplicationCallback& callback) override; | 40 const LoadApplicationCallback& callback) override; |
| 39 | 41 |
| 40 private: | 42 private: |
| 43 bool has_registered_loaders_ = false; |
| 41 URLToLoaderMap url_to_loader_map_; | 44 URLToLoaderMap url_to_loader_map_; |
| 42 | 45 |
| 43 DISALLOW_COPY_AND_ASSIGN(UtilityProcessControlImpl); | 46 DISALLOW_COPY_AND_ASSIGN(ProcessControlImpl); |
| 44 }; | 47 }; |
| 45 | 48 |
| 46 } // namespace content | 49 } // namespace content |
| 47 | 50 |
| 48 #endif // UTILITY_PROCESS_CONTROL_IMPL_H_ | 51 #endif // CONTENT_CHILD_PROCESS_CONTROL_IMPL_H_ |
| OLD | NEW |