Index: sky/tools/debugger/debugger.cc |
diff --git a/sky/tools/debugger/debugger.cc b/sky/tools/debugger/debugger.cc |
index c8d78348191b7ab5428f32e6eb27ed57990bf09e..06dd74630f728637a4a547e4a6d00a8f39ee8862 100644 |
--- a/sky/tools/debugger/debugger.cc |
+++ b/sky/tools/debugger/debugger.cc |
@@ -34,7 +34,7 @@ class SkyDebugger : public mojo::ApplicationDelegate, |
private: |
// mojo::ApplicationDelegate: |
void Initialize(mojo::ApplicationImpl* app) override { |
- app->ConnectToService("mojo:tracing", &tracing_); |
+ app_ = app; |
app->ConnectToService("mojo:window_manager", &window_manager_); |
// Format: --args-for="app_url command_port" |
@@ -140,6 +140,8 @@ class SkyDebugger : public mojo::ApplicationDelegate, |
return; |
} |
+ if (!tracing_) |
+ app_->ConnectToService("mojo:tracing", &tracing_); |
is_tracing_ = true; |
mojo::DataPipe pipe; |
tracing_->Start(pipe.producer_handle.Pass(), mojo::String("*")); |
@@ -185,6 +187,7 @@ class SkyDebugger : public mojo::ApplicationDelegate, |
} |
bool is_tracing_; |
+ mojo::ApplicationImpl* app_; |
mojo::WindowManagerPtr window_manager_; |
tracing::TraceCoordinatorPtr tracing_; |
std::string url_; |