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

Side by Side Diff: base/files/file.h

Issue 1216183004: Only set File::[tracing_]path_ when file tracing is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tracing_path_ Created 5 years, 5 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 | « no previous file | base/files/file.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(uint32 flags, const FilePath& path);
rvargas (doing something else) 2015/07/02 02:11:05 tiny nit: Do you mind going back to having path as
Dan Beam 2015/07/02 02:18:06 Done.
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 // Path that |Initialize()| was called with. Only set if safe (i.e. no '..')
rvargas (doing something else) 2015/07/02 02:11:06 I think the safe reference is stale at this point,
Dan Beam 2015/07/02 02:18:06 Done.
375 FilePath path_; 375 // and if file tracing is enabled when |Initialize()| is called.
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_
OLDNEW
« no previous file with comments | « no previous file | base/files/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698