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

Side by Side Diff: base/files/scoped_temp_dir.cc

Issue 2275553005: //base: Make ScopedTempDir::path() a GetPath() with a DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 3 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 | « base/files/scoped_temp_dir.h ('k') | base/files/scoped_temp_dir_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 return ret; 70 return ret;
71 } 71 }
72 72
73 FilePath ScopedTempDir::Take() { 73 FilePath ScopedTempDir::Take() {
74 FilePath ret = path_; 74 FilePath ret = path_;
75 path_ = FilePath(); 75 path_ = FilePath();
76 return ret; 76 return ret;
77 } 77 }
78 78
79 const FilePath& ScopedTempDir::GetPath() const {
80 DCHECK(!path_.empty()) << "Did you call CreateUniqueTempDir* before?";
81 return path_;
82 }
83
79 bool ScopedTempDir::IsValid() const { 84 bool ScopedTempDir::IsValid() const {
80 return !path_.empty() && DirectoryExists(path_); 85 return !path_.empty() && DirectoryExists(path_);
81 } 86 }
82 87
83 } // namespace base 88 } // namespace base
OLDNEW
« no previous file with comments | « base/files/scoped_temp_dir.h ('k') | base/files/scoped_temp_dir_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698