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

Side by Side Diff: services/tracing/service.cc

Issue 2215133002: Change signature of OnConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: . Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « services/tracing/service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/tracing/service.h" 5 #include "services/tracing/service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "services/shell/public/cpp/interface_registry.h"
15 16
16 namespace tracing { 17 namespace tracing {
17 18
18 Service::Service() : collector_binding_(this), tracing_active_(false) {} 19 Service::Service() : collector_binding_(this), tracing_active_(false) {}
19 Service::~Service() {} 20 Service::~Service() {}
20 21
21 bool Service::OnConnect(shell::Connection* connection) { 22 bool Service::OnConnect(const shell::Identity& remote_identity,
22 connection->AddInterface<mojom::Factory>(this); 23 shell::InterfaceRegistry* registry) {
23 connection->AddInterface<mojom::Collector>(this); 24 registry->AddInterface<mojom::Factory>(this);
24 connection->AddInterface<mojom::StartupPerformanceDataCollector>(this); 25 registry->AddInterface<mojom::Collector>(this);
26 registry->AddInterface<mojom::StartupPerformanceDataCollector>(this);
25 return true; 27 return true;
26 } 28 }
27 29
28 bool Service::OnStop() { 30 bool Service::OnStop() {
29 // TODO(beng): This is only required because Service isn't run by 31 // TODO(beng): This is only required because Service isn't run by
30 // ServiceRunner - instead it's launched automatically by the standalone 32 // ServiceRunner - instead it's launched automatically by the standalone
31 // shell. It shouldn't be. 33 // shell. It shouldn't be.
32 base::MessageLoop::current()->QuitWhenIdle(); 34 base::MessageLoop::current()->QuitWhenIdle();
33 return false; 35 return false;
34 } 36 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 const GetStartupPerformanceTimesCallback& callback) { 178 const GetStartupPerformanceTimesCallback& callback) {
177 callback.Run(startup_performance_times_.Clone()); 179 callback.Run(startup_performance_times_.Clone());
178 } 180 }
179 181
180 void Service::AllDataCollected() { 182 void Service::AllDataCollected() {
181 recorder_impls_.clear(); 183 recorder_impls_.clear();
182 sink_.reset(); 184 sink_.reset();
183 } 185 }
184 186
185 } // namespace tracing 187 } // namespace tracing
OLDNEW
« no previous file with comments | « services/tracing/service.h ('k') | services/ui/demo/mus_demo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698