OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "shell/context.h" | 5 #include "shell/context.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 if (command_line->HasSwitch(switches::kSpy)) { | 176 if (command_line->HasSwitch(switches::kSpy)) { |
177 spy_.reset( | 177 spy_.reset( |
178 new mojo::Spy(&application_manager_, | 178 new mojo::Spy(&application_manager_, |
179 command_line->GetSwitchValueASCII(switches::kSpy))); | 179 command_line->GetSwitchValueASCII(switches::kSpy))); |
180 // TODO(cpu): the spy can snoop, but can't tell anybody until | 180 // TODO(cpu): the spy can snoop, but can't tell anybody until |
181 // the Spy::WebSocketDelegate is implemented. In the original repo this | 181 // the Spy::WebSocketDelegate is implemented. In the original repo this |
182 // was implemented by src\mojo\spy\websocket_server.h and .cc. | 182 // was implemented by src\mojo\spy\websocket_server.h and .cc. |
183 } | 183 } |
184 | 184 |
185 tracing::TraceDataCollectorPtr trace_data_collector_ptr; | |
186 application_manager_.ConnectToService(GURL("mojo:tracing"), | |
187 &trace_data_collector_ptr); | |
188 TracingImpl::Create(trace_data_collector_ptr.Pass()); | |
189 | |
190 if (listener_) | 185 if (listener_) |
191 listener_->WaitForListening(); | 186 listener_->WaitForListening(); |
192 | 187 |
193 return true; | 188 return true; |
194 } | 189 } |
195 | 190 |
196 void Context::OnApplicationError(const GURL& url) { | 191 void Context::OnApplicationError(const GURL& url) { |
197 if (app_urls_.find(url) != app_urls_.end()) { | 192 if (app_urls_.find(url) != app_urls_.end()) { |
198 app_urls_.erase(url); | 193 app_urls_.erase(url); |
199 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) | 194 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) |
(...skipping 17 matching lines...) Expand all Loading... |
217 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 212 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
218 const GURL& application_url, | 213 const GURL& application_url, |
219 const std::string& service_name) { | 214 const std::string& service_name) { |
220 app_urls_.insert(application_url); | 215 app_urls_.insert(application_url); |
221 return application_manager_.ConnectToServiceByName(application_url, | 216 return application_manager_.ConnectToServiceByName(application_url, |
222 service_name).Pass(); | 217 service_name).Pass(); |
223 } | 218 } |
224 | 219 |
225 } // namespace shell | 220 } // namespace shell |
226 } // namespace mojo | 221 } // namespace mojo |
OLD | NEW |