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

Unified Diff: content/browser/mojo/mojo_shell_context.cc

Issue 1738663002: Hook embedded shell up to MojoShellConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/mojo/mojo_shell_client_host.cc ('k') | content/browser/mojo/renderer_capability_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mojo/mojo_shell_context.cc
diff --git a/content/browser/mojo/mojo_shell_context.cc b/content/browser/mojo/mojo_shell_context.cc
index 31f449aec51726fefed10b822d0ef210d6b04a46..4b0e3beea3d07d6ae565d8e7d6d5694a9f533d8f 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/mojo_shell_connection_impl.h"
#include "content/common/mojo/static_application_loader.h"
#include "content/common/process_control.mojom.h"
#include "content/public/browser/browser_thread.h"
@@ -27,12 +28,17 @@
#include "mojo/shell/application_loader.h"
#include "mojo/shell/connect_params.h"
#include "mojo/shell/identity.h"
+#include "mojo/shell/native_runner.h"
#include "mojo/shell/public/cpp/shell_client.h"
+#include "mojo/shell/public/interfaces/shell.mojom.h"
+#include "mojo/shell/runner/host/in_process_native_runner.h"
namespace content {
namespace {
+const char kBrowserAppUrl[] = "exe:chrome";
+
// An extra set of apps to register on initialization, if set by a test.
const MojoShellContext::StaticApplicationMap* g_applications_for_test;
@@ -201,8 +207,12 @@ MojoShellContext::MojoShellContext() {
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE);
bool register_mojo_url_schemes = false;
+ scoped_ptr<mojo::shell::NativeRunnerFactory> native_runner_factory(
+ new mojo::shell::InProcessNativeRunnerFactory(
+ BrowserThread::GetBlockingPool()));
application_manager_.reset(new mojo::shell::ApplicationManager(
- nullptr, file_task_runner.get(), register_mojo_url_schemes, nullptr));
+ std::move(native_runner_factory), file_task_runner.get(),
+ register_mojo_url_schemes, nullptr));
application_manager_->set_default_loader(
scoped_ptr<mojo::shell::ApplicationLoader>(new DefaultApplicationLoader));
@@ -249,9 +259,16 @@ MojoShellContext::MojoShellContext() {
scoped_ptr<mojo::shell::ApplicationLoader>(new GpuProcessLoader()),
GURL("mojo:media"));
#endif
+
+ if (!IsRunningInMojoShell()) {
+ MojoShellConnectionImpl::Create(
+ application_manager_->InitInstanceForEmbedder(GURL(kBrowserAppUrl)));
+ }
}
MojoShellContext::~MojoShellContext() {
+ if (!IsRunningInMojoShell())
+ MojoShellConnectionImpl::Destroy();
}
// static
« no previous file with comments | « content/browser/mojo/mojo_shell_client_host.cc ('k') | content/browser/mojo/renderer_capability_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698