|  | //base: Make ScopedTempDir::path() a GetPath() with a DCHECK
This CL changes the inline ScopedTempDir::path() to an out-of-line
GetPath() and enhances it with a DCHECK against the directory not
having been created yet.
FAQ
Q: Why GetPath?
A: Because of the added DCHECK in the path accessor, which needs
   #include "base/logging.h", there were two alternatives:
    (A) Keep the inline path() and #include "base/logging.h" in the header.
    (B) Change the inline path() to an out-of-line GetPath and implement it
        in the .cc file.
   (A) would affect compile-time, (B) affects run-time of the tests. I made no
   measuring, but obtaining the path is usually a one-off step in a test, so an
   unlikely hotspot. Therefore the trade-off seems much better for (B).
Q: Why deprecating path() instead of deleting it?
A: Due to the big amount of callsites (almost 600 files in the whole codebase),
   this change is rolled out in phases. This CL changes //base. After all of the
   codebase is converted, the deprecated path() will be deleted.
R=danakj@chromium.org 
BUG=640599 
Committed: https://crrev.com/411f4fc60df3a256dd2d15ab39c540228ed66e7f 
Cr-Commit-Position: refs/heads/master@{#417241}
  
  
   
  
   
      Total comments: 4
      
     
  
   
    
  
  
    
      |  | Unified diffs | Side-by-side diffs | Delta from patch set | Stats (+258 lines, -245 lines) | Patch |  
        |  | M | base/debug/activity_tracker_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/files/dir_reader_posix_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/files/file_locking_unittest.cc | View | 1 | 2 chunks | +4 lines, -4 lines | 0 comments | Download |  
        |  | M | base/files/file_path_watcher_unittest.cc | View | 1 | 16 chunks | +24 lines, -23 lines | 0 comments | Download |  
        |  | M | base/files/file_proxy_unittest.cc | View | 1
        
          2
        
          3 | 16 chunks | +29 lines, -34 lines | 0 comments | Download |  
        |  | M | base/files/file_unittest.cc | View | 1 | 14 chunks | +17 lines, -14 lines | 0 comments | Download |  
        |  | M | base/files/file_util_proxy_unittest.cc | View | 1
        
          2
        
          3 | 4 chunks | +10 lines, -16 lines | 0 comments | Download |  
        |  | M | base/files/file_util_unittest.cc | View | 1 | 72 chunks | +123 lines, -115 lines | 0 comments | Download |  
        |  | M | base/files/important_file_writer_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/files/scoped_temp_dir.h | View | 1 | 1 chunk | +6 lines, -0 lines | 0 comments | Download |  
        |  | M | base/files/scoped_temp_dir.cc | View | 1
        
          2 | 1 chunk | +5 lines, -0 lines | 0 comments | Download |  
        |  | M | base/files/scoped_temp_dir_unittest.cc | View | 1 | 3 chunks | +4 lines, -4 lines | 0 comments | Download |  
        |  | M | base/json/json_value_serializer_unittest.cc | View | 1 | 4 chunks | +5 lines, -4 lines | 0 comments | Download |  
        |  | M | base/mac/mac_util_unittest.mm | View | 1 | 4 chunks | +4 lines, -4 lines | 0 comments | Download |  
        |  | M | base/metrics/persistent_histogram_allocator_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/metrics/persistent_memory_allocator_unittest.cc | View | 1 | 4 chunks | +4 lines, -4 lines | 0 comments | Download |  
        |  | M | base/path_service_unittest.cc | View | 1 | 4 chunks | +6 lines, -6 lines | 0 comments | Download |  
        |  | M | base/process/process_metrics_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/test/launcher/test_launcher_ios.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/test/launcher/unit_test_launcher.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/test/scoped_path_override.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/win/event_trace_consumer_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/win/event_trace_controller_unittest.cc | View | 1 | 1 chunk | +1 line, -1 line | 0 comments | Download |  
        |  | M | base/win/shortcut_unittest.cc | View | 1 | 4 chunks | +7 lines, -7 lines | 0 comments | Download |  
      Dependent Patchsets:
      
         
    Total messages: 31 (18 generated)
     |