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

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: 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
OLDNEW
(Empty)
1 #include "content/browser/tracing/add_new_file_index.h"
2
3 #include "base/file_util.h"
4 #include "base/strings/string_number_conversions.h"
5 #include "base/threading/thread_restrictions.h"
6
7 namespace {
8 const unsigned int kMaxLogFileIndex = 1000000;
9 }
10
11 namespace content {
12
13 base::FilePath AddNewLogFileIndex(const base::FilePath& trace_file) {
14 // trace file should be initialized synchronously
15 base::ThreadRestrictions::ScopedAllowIO allow_io;
16 for (unsigned int i = 0; i < kMaxLogFileIndex; ++i) {
17 const base::FilePath new_filename(trace_file.value() + "." +
18 base::UintToString(i));
19 if (!base::PathExists(new_filename))
20 return new_filename;
21 }
22 return trace_file;
23 }
24
25 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698