diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 00:50:41 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 00:50:41 +0000 |
commit | 8b20191a72da085319a68e4953e9f2b355218825 (patch) | |
tree | 94dcdf6f4cc9513f80f052d6623c3a2cc59b603a /base/file_util_proxy.cc | |
parent | 97d1045022f612595642821a8d1c35b8b7c00019 (diff) | |
download | chromium_src-8b20191a72da085319a68e4953e9f2b355218825.zip chromium_src-8b20191a72da085319a68e4953e9f2b355218825.tar.gz chromium_src-8b20191a72da085319a68e4953e9f2b355218825.tar.bz2 |
Add recursive flag to file_util_proxy::CreateDirectory.
BUG=54352
TEST=all the FileSystemOperationTest.TestCreateDir* should continue to pass
Review URL: http://codereview.chromium.org/3293009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_proxy.cc')
-rw-r--r-- | base/file_util_proxy.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/file_util_proxy.cc b/base/file_util_proxy.cc index 1e6100e..6e4222d 100644 --- a/base/file_util_proxy.cc +++ b/base/file_util_proxy.cc @@ -320,17 +320,19 @@ class RelayCreateDirectory : public RelayWithStatusCallback { RelayCreateDirectory( const FilePath& file_path, bool exclusive, + bool recursive, base::FileUtilProxy::StatusCallback* callback) : RelayWithStatusCallback(callback), file_path_(file_path), - exclusive_(exclusive) { + exclusive_(exclusive), + recursive_(recursive) { } protected: virtual void RunWork() { bool path_exists = file_util::PathExists(file_path_); // If parent dir of file doesn't exist. - if (!file_util::PathExists(file_path_.DirName())) { + if (!recursive_ && !file_util::PathExists(file_path_.DirName())) { set_error_code(base::PLATFORM_FILE_ERROR_NOT_FOUND); return; } @@ -350,6 +352,7 @@ class RelayCreateDirectory : public RelayWithStatusCallback { private: FilePath file_path_; bool exclusive_; + bool recursive_; }; class RelayReadDirectory : public MessageLoopRelay { @@ -458,9 +461,10 @@ bool FileUtilProxy::CreateDirectory( scoped_refptr<MessageLoopProxy> message_loop_proxy, const FilePath& file_path, bool exclusive, + bool recursive, StatusCallback* callback) { return Start(FROM_HERE, message_loop_proxy, new RelayCreateDirectory( - file_path, exclusive, callback)); + file_path, exclusive, recursive, callback)); } // static |