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

Side by Side Diff: tools/gn/trace.cc

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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 | « tools/gn/setup.cc ('k') | tools/imagediff/image_diff.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "tools/gn/trace.h" 5 #include "tools/gn/trace.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <sstream> 9 #include <sstream>
10 #include <vector> 10 #include <vector>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 ScopedTrace::~ScopedTrace() { 141 ScopedTrace::~ScopedTrace() {
142 Done(); 142 Done();
143 } 143 }
144 144
145 void ScopedTrace::SetToolchain(const Label& label) { 145 void ScopedTrace::SetToolchain(const Label& label) {
146 if (item_) 146 if (item_)
147 item_->set_toolchain(label.GetUserVisibleName(false)); 147 item_->set_toolchain(label.GetUserVisibleName(false));
148 } 148 }
149 149
150 void ScopedTrace::SetCommandLine(const CommandLine& cmdline) { 150 void ScopedTrace::SetCommandLine(const base::CommandLine& cmdline) {
151 if (item_) 151 if (item_)
152 item_->set_cmdline(FilePathToUTF8(cmdline.GetArgumentsString())); 152 item_->set_cmdline(FilePathToUTF8(cmdline.GetArgumentsString()));
153 } 153 }
154 154
155 void ScopedTrace::Done() { 155 void ScopedTrace::Done() {
156 if (!done_) { 156 if (!done_) {
157 done_ = true; 157 done_ = true;
158 if (trace_log) { 158 if (trace_log) {
159 item_->set_end(base::TimeTicks::HighResNow()); 159 item_->set_end(base::TimeTicks::HighResNow());
160 AddTrace(item_); 160 AddTrace(item_);
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 out << "}"; 313 out << "}";
314 } 314 }
315 315
316 out << "]}"; 316 out << "]}";
317 317
318 std::string out_str = out.str(); 318 std::string out_str = out.str();
319 base::WriteFile(file_name, out_str.data(), 319 base::WriteFile(file_name, out_str.data(),
320 static_cast<int>(out_str.size())); 320 static_cast<int>(out_str.size()));
321 } 321 }
OLDNEW
« no previous file with comments | « tools/gn/setup.cc ('k') | tools/imagediff/image_diff.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698