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

Side by Side Diff: services/tracing/public/cpp/provider.cc

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 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/public/cpp/provider.h ('k') | services/tracing/service.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/public/cpp/provider.h" 5 #include "services/tracing/public/cpp/provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 24 matching lines...) Expand all
35 35
36 } 36 }
37 37
38 Provider::Provider() 38 Provider::Provider()
39 : binding_(this), tracing_forced_(false), weak_factory_(this) {} 39 : binding_(this), tracing_forced_(false), weak_factory_(this) {}
40 40
41 Provider::~Provider() { 41 Provider::~Provider() {
42 StopTracing(); 42 StopTracing();
43 } 43 }
44 44
45 void Provider::Initialize(shell::Connector* connector, const std::string& url) { 45 void Provider::Initialize(service_manager::Connector* connector,
46 const std::string& url) {
46 { 47 {
47 base::AutoLock lock(g_singleton_lock.Get()); 48 base::AutoLock lock(g_singleton_lock.Get());
48 if (g_tracing_singleton_created) 49 if (g_tracing_singleton_created)
49 return; 50 return;
50 g_tracing_singleton_created = true; 51 g_tracing_singleton_created = true;
51 } 52 }
52 53
53 // This will only set the name for the first app in a loaded mojo file. It's 54 // This will only set the name for the first app in a loaded mojo file. It's
54 // up to something like CoreServices to name its own child threads. 55 // up to something like CoreServices to name its own child threads.
55 base::PlatformThread::SetName(url); 56 base::PlatformThread::SetName(url);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // events. Empty string is not a valid chunk to record so skip in this case. 138 // events. Empty string is not a valid chunk to record so skip in this case.
138 if (!events_str->data().empty()) { 139 if (!events_str->data().empty()) {
139 recorder_->Record(mojo::String(events_str->data())); 140 recorder_->Record(mojo::String(events_str->data()));
140 } 141 }
141 if (!has_more_events) { 142 if (!has_more_events) {
142 recorder_.reset(); 143 recorder_.reset();
143 } 144 }
144 } 145 }
145 146
146 } // namespace tracing 147 } // namespace tracing
OLDNEW
« no previous file with comments | « services/tracing/public/cpp/provider.h ('k') | services/tracing/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698