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

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: explicit BrowserShutdownProfileDumper. 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 #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;
jochen (gone - plz use gerrit) 2014/06/06 07:01:49 can't you do this before thread restrictions are t
Alexander Alekseev 2014/06/06 15:43:41 Done.
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
« 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