OLD | NEW |
(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 |
OLD | NEW |