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

Side by Side Diff: services/shell/standalone/tracer.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/shell/standalone/tracer.h ('k') | services/shell/switches.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/shell/standalone/tracer.h" 5 #include "services/shell/standalone/tracer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/synchronization/waitable_event.h" 14 #include "base/synchronization/waitable_event.h"
15 #include "base/threading/thread.h" 15 #include "base/threading/thread.h"
16 #include "base/trace_event/trace_config.h" 16 #include "base/trace_event/trace_config.h"
17 #include "base/trace_event/trace_event.h" 17 #include "base/trace_event/trace_event.h"
18 18
19 namespace mojo {
20 namespace shell { 19 namespace shell {
21 20
22 Tracer::Tracer() 21 Tracer::Tracer()
23 : tracing_(false), first_chunk_written_(false), trace_file_(nullptr) {} 22 : tracing_(false), first_chunk_written_(false), trace_file_(nullptr) {}
24 23
25 Tracer::~Tracer() { 24 Tracer::~Tracer() {
26 StopAndFlushToFile(); 25 StopAndFlushToFile();
27 } 26 }
28 27
29 void Tracer::Start(const std::string& categories, 28 void Tracer::Start(const std::string& categories,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 WriteFooterAndClose(); 153 WriteFooterAndClose();
155 } 154 }
156 155
157 void Tracer::WriteCommaIfNeeded() { 156 void Tracer::WriteCommaIfNeeded() {
158 if (first_chunk_written_) 157 if (first_chunk_written_)
159 PCHECK(fwrite(",", 1, 1, trace_file_) == 1); 158 PCHECK(fwrite(",", 1, 1, trace_file_) == 1);
160 first_chunk_written_ = true; 159 first_chunk_written_ = true;
161 } 160 }
162 161
163 } // namespace shell 162 } // namespace shell
164 } // namespace mojo
OLDNEW
« no previous file with comments | « services/shell/standalone/tracer.h ('k') | services/shell/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698