OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef BASE_FILES_FILE_H_ | 5 #ifndef BASE_FILES_FILE_H_ |
6 #define BASE_FILES_FILE_H_ | 6 #define BASE_FILES_FILE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 // failing a CHECK if they do not. | 348 // failing a CHECK if they do not. |
349 void Check() const; | 349 void Check() const; |
350 | 350 |
351 void UpdateChecksum(); | 351 void UpdateChecksum(); |
352 | 352 |
353 ScopedFD file_; | 353 ScopedFD file_; |
354 unsigned int file_memory_checksum_; | 354 unsigned int file_memory_checksum_; |
355 }; | 355 }; |
356 #endif | 356 #endif |
357 | 357 |
358 // Creates or opens the given file. Only called if |path_| has no | 358 // Creates or opens the given file. Only called if |path| has no |
359 // traversal ('..') components. | 359 // traversal ('..') components. |
360 void DoInitialize(uint32 flags); | 360 void DoInitialize(const FilePath& path, uint32 flags); |
361 | 361 |
362 // TODO(tnagel): Reintegrate into Flush() once histogram isn't needed anymore, | 362 // TODO(tnagel): Reintegrate into Flush() once histogram isn't needed anymore, |
363 // cf. issue 473337. | 363 // cf. issue 473337. |
364 bool DoFlush(); | 364 bool DoFlush(); |
365 | 365 |
366 void SetPlatformFile(PlatformFile file); | 366 void SetPlatformFile(PlatformFile file); |
367 | 367 |
368 #if defined(OS_WIN) | 368 #if defined(OS_WIN) |
369 win::ScopedHandle file_; | 369 win::ScopedHandle file_; |
370 #elif defined(OS_POSIX) | 370 #elif defined(OS_POSIX) |
371 MemoryCheckingScopedFD file_; | 371 MemoryCheckingScopedFD file_; |
372 #endif | 372 #endif |
373 | 373 |
374 // Path that |Initialize()| was called with. Only set if safe (i.e. no '..'). | 374 // A path to use for tracing purposes. Set if file tracing is enabled during |
375 FilePath path_; | 375 // |Initialize()|. |
| 376 FilePath tracing_path_; |
376 | 377 |
377 // Object tied to the lifetime of |this| that enables/disables tracing. | 378 // Object tied to the lifetime of |this| that enables/disables tracing. |
378 FileTracing::ScopedEnabler trace_enabler_; | 379 FileTracing::ScopedEnabler trace_enabler_; |
379 | 380 |
380 Error error_details_; | 381 Error error_details_; |
381 bool created_; | 382 bool created_; |
382 bool async_; | 383 bool async_; |
383 }; | 384 }; |
384 | 385 |
385 } // namespace base | 386 } // namespace base |
386 | 387 |
387 #endif // BASE_FILES_FILE_H_ | 388 #endif // BASE_FILES_FILE_H_ |
OLD | NEW |