summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-19 21:30:53 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-20 05:32:23 +0000
commitfde0aff82c74a78e8cb298f3028e7effd527ae2c (patch)
treeb85de9df6fb9f51d8e24d6ad786d0ab046560065
parentbb917ddb01a8c3e373d6df02046c69ff00b07254 (diff)
downloadchromium_src-fde0aff82c74a78e8cb298f3028e7effd527ae2c.zip
chromium_src-fde0aff82c74a78e8cb298f3028e7effd527ae2c.tar.gz
chromium_src-fde0aff82c74a78e8cb298f3028e7effd527ae2c.tar.bz2
Move StaticApplicationLoader to content/common/mojo
TBR=rockot@chromium.org BUG= Review URL: https://codereview.chromium.org/1716473002 Cr-Commit-Position: refs/heads/master@{#376629}
-rw-r--r--content/browser/mojo/mojo_shell_context.cc4
-rw-r--r--content/child/process_control_impl.cc2
-rw-r--r--content/common/mojo/DEPS4
-rw-r--r--content/common/mojo/static_application_loader.cc (renamed from mojo/shell/static_application_loader.cc)18
-rw-r--r--content/common/mojo/static_application_loader.h (renamed from mojo/shell/static_application_loader.h)14
-rw-r--r--content/content_common.gypi2
-rw-r--r--content/gpu/gpu_process_control_impl.cc6
-rw-r--r--content/shell/utility/shell_content_utility_client.cc2
-rw-r--r--content/utility/utility_process_control_impl.cc6
-rw-r--r--mojo/mojo_shell.gyp2
-rw-r--r--mojo/shell/BUILD.gn2
11 files changed, 27 insertions, 35 deletions
diff --git a/content/browser/mojo/mojo_shell_context.cc b/content/browser/mojo/mojo_shell_context.cc
index f53618a..980c7a6 100644
--- a/content/browser/mojo/mojo_shell_context.cc
+++ b/content/browser/mojo/mojo_shell_context.cc
@@ -13,6 +13,7 @@
#include "base/thread_task_runner_handle.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/common/gpu/gpu_process_launch_causes.h"
+#include "content/common/mojo/static_application_loader.h"
#include "content/common/process_control.mojom.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -27,7 +28,6 @@
#include "mojo/shell/connect_to_application_params.h"
#include "mojo/shell/identity.h"
#include "mojo/shell/public/cpp/shell_client.h"
-#include "mojo/shell/static_application_loader.h"
namespace content {
@@ -216,7 +216,7 @@ MojoShellContext::MojoShellContext() {
for (const auto& entry : apps) {
application_manager_->SetLoaderForURL(
scoped_ptr<mojo::shell::ApplicationLoader>(
- new mojo::shell::StaticApplicationLoader(entry.second)),
+ new StaticApplicationLoader(entry.second)),
entry.first);
}
diff --git a/content/child/process_control_impl.cc b/content/child/process_control_impl.cc
index 9f4b474..6cf00e5 100644
--- a/content/child/process_control_impl.cc
+++ b/content/child/process_control_impl.cc
@@ -7,8 +7,8 @@
#include <utility>
#include "base/stl_util.h"
+#include "content/common/mojo/static_application_loader.h"
#include "content/public/common/content_client.h"
-#include "mojo/shell/static_application_loader.h"
#include "url/gurl.h"
namespace content {
diff --git a/content/common/mojo/DEPS b/content/common/mojo/DEPS
index 906af32..0f2f39e 100644
--- a/content/common/mojo/DEPS
+++ b/content/common/mojo/DEPS
@@ -1,7 +1,5 @@
include_rules = [
"+mojo/converters/network",
"+mojo/edk/embedder",
- "+mojo/shell/public/cpp",
- "+mojo/shell/public/interfaces",
- "+mojo/shell/runner/child",
+ "+mojo/shell",
]
diff --git a/mojo/shell/static_application_loader.cc b/content/common/mojo/static_application_loader.cc
index a6920ff..263236c 100644
--- a/mojo/shell/static_application_loader.cc
+++ b/content/common/mojo/static_application_loader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/shell/static_application_loader.h"
+#include "content/common/mojo/static_application_loader.h"
#include <utility>
@@ -17,15 +17,14 @@
#include "mojo/shell/public/cpp/shell_client.h"
#include "mojo/shell/public/interfaces/shell_client.mojom.h"
-namespace mojo {
-namespace shell {
+namespace content {
namespace {
class RunnerThread : public base::SimpleThread {
public:
RunnerThread(const GURL& url,
- InterfaceRequest<mojom::ShellClient> request,
+ mojo::shell::mojom::ShellClientRequest request,
scoped_refptr<base::TaskRunner> exit_task_runner,
const base::Closure& exit_callback,
const StaticApplicationLoader::ApplicationFactory& factory)
@@ -36,15 +35,15 @@ class RunnerThread : public base::SimpleThread {
factory_(factory) {}
void Run() override {
- scoped_ptr<ApplicationRunner> runner(
- new ApplicationRunner(factory_.Run().release()));
+ scoped_ptr<mojo::ApplicationRunner> runner(
+ new mojo::ApplicationRunner(factory_.Run().release()));
runner->Run(request_.PassMessagePipe().release().value(),
false /* init_base */);
exit_task_runner_->PostTask(FROM_HERE, exit_callback_);
}
private:
- InterfaceRequest<mojom::ShellClient> request_;
+ mojo::shell::mojom::ShellClientRequest request_;
scoped_refptr<base::TaskRunner> exit_task_runner_;
base::Closure exit_callback_;
StaticApplicationLoader::ApplicationFactory factory_;
@@ -72,7 +71,7 @@ StaticApplicationLoader::~StaticApplicationLoader() {
void StaticApplicationLoader::Load(
const GURL& url,
- InterfaceRequest<mojom::ShellClient> request) {
+ mojo::shell::mojom::ShellClientRequest request) {
if (thread_)
return;
@@ -94,5 +93,4 @@ void StaticApplicationLoader::StopAppThread() {
quit_callback_.Run();
}
-} // namespace shell
-} // namespace mojo
+} // namespace content
diff --git a/mojo/shell/static_application_loader.h b/content/common/mojo/static_application_loader.h
index b3d55ba..44402c5 100644
--- a/mojo/shell/static_application_loader.h
+++ b/content/common/mojo/static_application_loader.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SHELL_STATIC_APPLICATION_LOADER_H_
-#define MOJO_SHELL_STATIC_APPLICATION_LOADER_H_
+#ifndef CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_
+#define CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_
#include <list>
@@ -20,8 +20,7 @@ namespace mojo {
class ShellClient;
}
-namespace mojo {
-namespace shell {
+namespace content {
// An ApplicationLoader which loads a single type of app from a given
// mojo::ShellClient factory. A Load() request is fulfilled by creating an
@@ -44,7 +43,7 @@ class StaticApplicationLoader : public mojo::shell::ApplicationLoader {
// mojo::shell::ApplicationLoader:
void Load(const GURL& url,
- InterfaceRequest<mojom::ShellClient> request) override;
+ mojo::shell::mojom::ShellClientRequest request) override;
private:
void StopAppThread();
@@ -63,7 +62,6 @@ class StaticApplicationLoader : public mojo::shell::ApplicationLoader {
DISALLOW_COPY_AND_ASSIGN(StaticApplicationLoader);
};
-} // namespace shell
-} // namespace mojo
+} // namespace content
-#endif // MOJO_SHELL_STATIC_APPLICATION_LOADER_H_
+#endif // CONTENT_COMMON_MOJO_STATIC_APPLICATION_LOADER_H_
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 73c1dfc..703edad 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -508,6 +508,8 @@
'common/mojo/mojo_messages.h',
'common/mojo/service_registry_impl.cc',
'common/mojo/service_registry_impl.h',
+ 'common/mojo/static_application_loader.cc',
+ 'common/mojo/static_application_loader.h',
'common/navigation_gesture.h',
'common/navigation_params.cc',
'common/navigation_params.h',
diff --git a/content/gpu/gpu_process_control_impl.cc b/content/gpu/gpu_process_control_impl.cc
index 6e38ffd..615c63b 100644
--- a/content/gpu/gpu_process_control_impl.cc
+++ b/content/gpu/gpu_process_control_impl.cc
@@ -7,8 +7,8 @@
#if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "content/common/mojo/static_application_loader.h"
#include "media/mojo/services/mojo_media_application_factory.h"
-#include "mojo/shell/static_application_loader.h"
#endif
namespace content {
@@ -21,8 +21,8 @@ void GpuProcessControlImpl::RegisterApplicationLoaders(
URLToLoaderMap* url_to_loader_map) {
#if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
(*url_to_loader_map)[GURL("mojo:media")] =
- new mojo::shell::StaticApplicationLoader(
- base::Bind(&media::CreateMojoMediaApplication),
+ new StaticApplicationLoader(
+ base::Bind(&media::CreateMojoMediaApplication),
base::Bind(&base::DoNothing));
#endif
}
diff --git a/content/shell/utility/shell_content_utility_client.cc b/content/shell/utility/shell_content_utility_client.cc
index a21c083..a9819ee 100644
--- a/content/shell/utility/shell_content_utility_client.cc
+++ b/content/shell/utility/shell_content_utility_client.cc
@@ -6,8 +6,8 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
+#include "content/common/mojo/static_application_loader.h"
#include "content/public/test/test_mojo_app.h"
-#include "mojo/shell/static_application_loader.h"
namespace content {
diff --git a/content/utility/utility_process_control_impl.cc b/content/utility/utility_process_control_impl.cc
index f6c59f8..422b0a4 100644
--- a/content/utility/utility_process_control_impl.cc
+++ b/content/utility/utility_process_control_impl.cc
@@ -5,11 +5,11 @@
#include "content/utility/utility_process_control_impl.h"
#include "base/bind.h"
+#include "content/common/mojo/static_application_loader.h"
#include "content/public/common/content_client.h"
#include "content/public/utility/content_utility_client.h"
#include "content/public/utility/utility_thread.h"
#include "content/utility/utility_thread_impl.h"
-#include "mojo/shell/static_application_loader.h"
#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
#include "media/mojo/services/mojo_media_application_factory.h"
@@ -38,12 +38,12 @@ void UtilityProcessControlImpl::RegisterApplicationLoaders(
GetContentClient()->utility()->RegisterMojoApplications(&apps);
for (const auto& entry : apps) {
- map_ref[entry.first] = new mojo::shell::StaticApplicationLoader(
+ map_ref[entry.first] = new StaticApplicationLoader(
entry.second, base::Bind(&QuitProcess));
}
#if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
- map_ref[GURL("mojo:media")] = new mojo::shell::StaticApplicationLoader(
+ map_ref[GURL("mojo:media")] = new StaticApplicationLoader(
base::Bind(&media::CreateMojoMediaApplication), base::Bind(&QuitProcess));
#endif
}
diff --git a/mojo/mojo_shell.gyp b/mojo/mojo_shell.gyp
index 4151d2e..69074b4 100644
--- a/mojo/mojo_shell.gyp
+++ b/mojo/mojo_shell.gyp
@@ -27,8 +27,6 @@
'shell/identity.cc',
'shell/identity.h',
'shell/native_runner.h',
- 'shell/static_application_loader.cc',
- 'shell/static_application_loader.h',
'shell/switches.cc',
'shell/switches.cc',
'util/filename_util.cc',
diff --git a/mojo/shell/BUILD.gn b/mojo/shell/BUILD.gn
index 0b1c96b..892029d 100644
--- a/mojo/shell/BUILD.gn
+++ b/mojo/shell/BUILD.gn
@@ -34,8 +34,6 @@ source_set("shell") {
"identity.cc",
"identity.h",
"native_runner.h",
- "static_application_loader.cc",
- "static_application_loader.h",
"switches.cc",
"switches.h",
]