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

Unified Diff: services/debugger/debugger.cc

Issue 1157253007: Connect mojo:debugger to window_manager only when requested. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | sky/tools/skydb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/debugger/debugger.cc
diff --git a/services/debugger/debugger.cc b/services/debugger/debugger.cc
index 5d1f63038df94226aa76b10851818f167814ca2b..5654cdb2cf7434034bfad9d8e11f63f035a721e7 100644
--- a/services/debugger/debugger.cc
+++ b/services/debugger/debugger.cc
@@ -39,7 +39,6 @@ class Debugger : public mojo::ApplicationDelegate,
// mojo::ApplicationDelegate:
void Initialize(mojo::ApplicationImpl* app) override {
app_ = app;
- app->ConnectToService("mojo:window_manager", &window_manager_);
// Format: --args-for="app_url command_port"
if (app->args().size() < 2) {
@@ -47,6 +46,11 @@ class Debugger : public mojo::ApplicationDelegate,
mojo::ApplicationImpl::Terminate();
return;
}
+ if (app->args().size() == 3 && app->args()[2] == "--wm") {
+ // Connect to window manager only if requested, as the user might want to
+ // run the debugger without spawning one.
+ app_->ConnectToService("mojo:window_manager", &window_manager_);
+ }
base::StringToUint(app->args()[1], &command_port_);
http_server::HttpServerFactoryPtr http_server_factory;
app->ConnectToService("mojo:http_server", &http_server_factory);
@@ -129,6 +133,9 @@ class Debugger : public mojo::ApplicationDelegate,
}
void Reload() {
+ if (!window_manager_)
+ return;
+
// SimpleWindowManager will wire up necessary services on our behalf.
window_manager_->Embed(url_, nullptr, nullptr);
}
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698