diff options
author | rockot <rockot@chromium.org> | 2015-06-04 17:30:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-05 00:32:18 +0000 |
commit | b814a5850da5aa473ad526eef4b41a82b05037a0 (patch) | |
tree | d1730ed4fccfc7fda63bd51f30891a95e61ba915 /content/utility/utility_process_control_impl.h | |
parent | 87c39e56c03c089751e4ae22dcea9ca7cf17c741 (diff) | |
download | chromium_src-b814a5850da5aa473ad526eef4b41a82b05037a0.zip chromium_src-b814a5850da5aa473ad526eef4b41a82b05037a0.tar.gz chromium_src-b814a5850da5aa473ad526eef4b41a82b05037a0.tar.bz2 |
Embed a mojo ApplicationManager in content/browser
This embeds mojo/shell's ApplicationManager in content/browser
and provides a way for arbitrary browser code to connect to
Mojo apps as if the browser itself were a Mojo app.
This is a basic implementation of Mojo app support which only
loads static apps either in the browser process or a (per-app)
utility process.
Future CLs will address connection to apps from arbitrary render
frames (i.e. connection requests which include the requestor's
origin) as well as refactoring the utility process code further
so that it serves strictly as a Mojo app runner.
BUG=492422
Review URL: https://codereview.chromium.org/1149833007
Cr-Commit-Position: refs/heads/master@{#332974}
Diffstat (limited to 'content/utility/utility_process_control_impl.h')
-rw-r--r-- | content/utility/utility_process_control_impl.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/content/utility/utility_process_control_impl.h b/content/utility/utility_process_control_impl.h new file mode 100644 index 0000000..dcc0a4d --- /dev/null +++ b/content/utility/utility_process_control_impl.h @@ -0,0 +1,48 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UTILITY_PROCESS_CONTROL_IMPL_H_ +#define UTILITY_PROCESS_CONTROL_IMPL_H_ + +#include <map> + +#include "base/macros.h" +#include "base/memory/scoped_ptr.h" +#include "content/common/process_control.mojom.h" +#include "mojo/application/public/interfaces/application.mojom.h" +#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" + +class GURL; + +namespace mojo { +namespace shell { +class ApplicationLoader; +} // namespace shell +} // namespace mojo + +namespace content { + +// Implementation of the ProcessControl interface. Exposed to the browser via +// the utility process's ServiceRegistry. +class UtilityProcessControlImpl : public ProcessControl { + public: + UtilityProcessControlImpl(); + ~UtilityProcessControlImpl() override; + + using URLToLoaderMap = std::map<GURL, mojo::shell::ApplicationLoader*>; + + // ProcessControl: + void LoadApplication(const mojo::String& url, + mojo::InterfaceRequest<mojo::Application> request, + const LoadApplicationCallback& callback) override; + + private: + URLToLoaderMap url_to_loader_map_; + + DISALLOW_COPY_AND_ASSIGN(UtilityProcessControlImpl); +}; + +} // namespace content + +#endif // UTILITY_PROCESS_CONTROL_IMPL_H_ |