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

Unified Diff: mojo/shell/context.cc

Issue 225203002: Mojo Spy core first cut (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gcc fix Created 6 years, 8 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/switches.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 3a000cee19dcca46c173a67a9776d5b8bb53fc6b..d6bfb4badbdd435b74bdb41dc1f617ee2f567b3a 100644
--- a/mojo/shell/context.cc
+++ b/mojo/shell/context.cc
@@ -12,6 +12,7 @@
#include "mojo/shell/network_delegate.h"
#include "mojo/shell/out_of_process_dynamic_service_runner.h"
#include "mojo/shell/switches.h"
+#include "mojo/spy/spy.h"
namespace mojo {
namespace shell {
@@ -27,15 +28,21 @@ Context::Context()
embedder::Init();
gles2::GLES2SupportImpl::Init();
+ CommandLine* cmdline = CommandLine::ForCurrentProcess();
scoped_ptr<DynamicServiceRunnerFactory> runner_factory;
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableMultiprocess))
+ if (cmdline->HasSwitch(switches::kEnableMultiprocess))
runner_factory.reset(new OutOfProcessDynamicServiceRunnerFactory());
else
runner_factory.reset(new InProcessDynamicServiceRunnerFactory());
+
dynamic_service_loader_.reset(
new DynamicServiceLoader(this, runner_factory.Pass()));
service_manager_.set_default_loader(dynamic_service_loader_.get());
+
+ if (cmdline->HasSwitch(switches::kSpy)) {
+ spy_.reset(new mojo::Spy(&service_manager_,
+ cmdline->GetSwitchValueASCII(switches::kSpy)));
+ }
}
Context::~Context() {
« no previous file with comments | « mojo/shell/context.h ('k') | mojo/shell/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698