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

Unified Diff: mojo/shell/context.cc

Issue 522443003: Accept inbound connections on unix domain socket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug407782
Patch Set: Deleted extra curly brace, which was closing a namespace too early Created 6 years, 3 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 | « mojo/shell/context.h ('k') | mojo/shell/external_application_listener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/context.cc
diff --git a/mojo/shell/context.cc b/mojo/shell/context.cc
index 4397271cd4632a1aaa693a762cb1b4b264a7c42e..253f4b7d24d85bf6b2fc2498b2151b2ef238a697 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -6,7 +6,9 @@
#include <vector>
+#include "base/bind.h"
#include "base/command_line.h"
+#include "base/files/file_path.h"
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
@@ -22,6 +24,7 @@
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/shell/dynamic_application_loader.h"
+#include "mojo/shell/external_application_listener.h"
#include "mojo/shell/in_process_dynamic_service_runner.h"
#include "mojo/shell/out_of_process_dynamic_service_runner.h"
#include "mojo/shell/switches.h"
@@ -178,6 +181,15 @@ void Context::Init() {
mojo_url_resolver_.AddLocalFileMapping(GURL(kLocalMojoURLs[i]));
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+
+ if (command_line->HasSwitch(switches::kEnableExternalApplications)) {
+ listener_ = ExternalApplicationListener::Create(
+ task_runners_->shell_runner(), task_runners_->io_runner());
+ listener_->ListenInBackground(
+ ExternalApplicationListener::ConstructDefaultSocketPath(),
+ base::Bind(&ApplicationManager::RegisterExternalApplication,
+ base::Unretained(&application_manager_)));
+ }
scoped_ptr<DynamicServiceRunnerFactory> runner_factory;
if (command_line->HasSwitch(switches::kEnableMultiprocess))
runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory());
@@ -225,6 +237,9 @@ void Context::Init() {
GURL("mojo:mojo_network_service"));
}
#endif
+
+ if (listener_)
+ listener_->WaitForListening();
}
void Context::OnApplicationError(const GURL& gurl) {
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/external_application_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698