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

Side by Side Diff: content/browser/tracing/add_new_file_index.cc

Issue 311313005: Add --trace-rotate-startup-file option and store unsaved trace data on exit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows build. Created 6 years, 6 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 | « content/browser/tracing/add_new_file_index.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/tracing/add_new_file_index.h"
6
7 #include "base/file_util.h"
8 #include "base/strings/string_number_conversions.h"
9
10 namespace {
11 const unsigned int kMaxLogFileIndex = 1000000;
12 }
13
14 namespace content {
15
16 base::FilePath AddNewLogFileIndex(const base::FilePath& trace_file) {
17 // trace file should be initialized synchronously
18 for (unsigned int i = 0; i < kMaxLogFileIndex; ++i) {
19 const base::FilePath new_filename(
20 trace_file.AppendASCII("." + base::UintToString(i)));
21 if (!base::PathExists(new_filename))
22 return new_filename;
23 }
24 return trace_file;
25 }
26
27 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/add_new_file_index.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698