summaryrefslogtreecommitdiffstats
path: root/base/file_util_proxy.cc
Commit message (Collapse)AuthorAgeFilesLines
* Copy buffers in base::FileUtilProxy::{Read,Write} to avoid memory corruption. darin@chromium.org2011-02-041-16/+15
| | | | | | | | | | | | | | | | | | If caller has called PPB_FileIO_Impl::Close() while a read or write operation is in flight, and deletes the read or write buffer, we now avoid corrupting memory. For Write, FileUtilProxy::Write simply copies the input buffer before passing control to the FILE thread. For Read, the caller no longer passes a buffer; instead, they are passed a const char* in the ReadCallback. One caller of FileUtilProxy::Read outside of PPAPI was also updated. BUG=70285 R=darin Patch by Adam Klein (adamk@chromium.org) Originally reviewed at http://codereview.chromium.org/6312040/ Review URL: http://codereview.chromium.org/6349090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73714 0039d316-1c4b-4281-b951-d872f2087c98
* Order function definitions in base/ according to the header.erg@google.com2011-01-111-41/+41
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98
* Moving Entry from base::file_util_proxy namespace to within class ↵kkanetkar@chromium.org2010-11-021-3/+3
| | | | | | | | | | | | base::FileUtilProxy BUG=None TEST=None Review URL: http://codereview.chromium.org/4261001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64806 0039d316-1c4b-4281-b951-d872f2087c98
* Rename FileUtilProxy::Create to EnsureFileExistskinuko@chromium.org2010-10-151-23/+61
| | | | | | | | | | | | | | | | | | per follow-up discussion on http://codereview.chromium.org/3717001/show Rename FileUtilProxy::Create to EnsureFileExists to make it clear that it doesn't open the file (or doesn't leave a file handle opened). Also fixes CreatePlatformFile to set |created| correctly when PLATFORM_FILE_CREATE flag is given (I think this is the correct behavior). BUG=none TEST=FileSystemOperationTest.* Review URL: http://codereview.chromium.org/3743004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62683 0039d316-1c4b-4281-b951-d872f2087c98
* Return NOT_FOUND error for an attempt to create a file under nonexistent ↵kinuko@chromium.org2010-10-121-0/+5
| | | | | | | | | | | directory. BUG=none TEST=fast/filesystem/op-get-entry.html Review URL: http://codereview.chromium.org/3729001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62229 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure we close the file_handle when we create (but not open) a new filekinuko@chromium.org2010-10-111-1/+22
| | | | | | | | | | | | 1. Add FileUtilProxy::Create that does not leave a file_handle opened. 2. Update the file_util_operation to use FileUtilProxy::Create instead of FileUtilProxy::CreateOrOpen so that no other tasks get queued in before we close the handle. BUG=58424,58473 TEST=fast/filesystem/ Review URL: http://codereview.chromium.org/3717001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62192 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply 61613 that was reverted for false valgrind alarm.kinuko@chromium.org2010-10-071-57/+68
| | | | | | | | | | | | | Original issue: http://codereview.chromium.org/3567012/show BUG=none TEST=FileSystemOperationTest.* TBR=ericu,thestig Review URL: http://codereview.chromium.org/3603014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61771 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 61613 - possible culprit for valgrind error. (Support ↵kinuko@chromium.org2010-10-061-68/+57
| | | | | | | | | | | removeRecursively and new copy/move) BUG=none TEST=none Review URL: http://codereview.chromium.org/3576017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61713 0039d316-1c4b-4281-b951-d872f2087c98
* Second try for support removeRecursively and new copy/move behaviors added ↵kinuko@chromium.org2010-10-061-57/+68
| | | | | | | | | | | | | | | | | | | | | | to the spec recently. http://lists.w3.org/Archives/Public/public-webapps/2010JulSep/1101.html > For a move/copy of a file on top of existing file, or a directory on > top of an existing empty directory, you get an automatic overwrite. > A move/copy of a file on top of an existing directory, or of a > directory on top of an existing file, will always fail. > A move/copy of a file or directory on top of an existing non-empty > directory will always fail. original issue: http://codereview.chromium.org/3567012 BUG=none TEST=FileSystemOperationTest.* TBR=ericu Review URL: http://codereview.chromium.org/3531012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61613 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 61480 - Support removeRecursively and new copy/move behaviors added ↵kinuko@chromium.org2010-10-051-68/+57
| | | | | | | | | | | | | | | | | | | | | to the spec recently. http://lists.w3.org/Archives/Public/public-webapps/2010JulSep/1101.html > For a move/copy of a file on top of existing file, or a directory on > top of an existing empty directory, you get an automatic overwrite. > A move/copy of a file on top of an existing directory, or of a > directory on top of an existing file, will always fail. > A move/copy of a file or directory on top of an existing non-empty > directory will always fail. BUG=32277 TEST=FileSystemOperationTest.* Review URL: http://codereview.chromium.org/3567012 TBR=kinuko@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61482 0039d316-1c4b-4281-b951-d872f2087c98
* Marks Test{Move,Copy}FailureContainsPath FAILS on Windows, also makes a fix ↵kinuko@chromium.org2010-10-051-1/+1
| | | | | | | | | | | | | | attempt for the failure. This patch also contains an attempt to fix the failure. TBR=ericu BUG=none TEST=green bot Review URL: http://codereview.chromium.org/3516014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61481 0039d316-1c4b-4281-b951-d872f2087c98
* Support removeRecursively and new copy/move behaviors added to the spec ↵kinuko@chromium.org2010-10-051-57/+68
| | | | | | | | | | | | | | | | | | | recently. http://lists.w3.org/Archives/Public/public-webapps/2010JulSep/1101.html > For a move/copy of a file on top of existing file, or a directory on > top of an existing empty directory, you get an automatic overwrite. > A move/copy of a file on top of an existing directory, or of a > directory on top of an existing file, will always fail. > A move/copy of a file or directory on top of an existing non-empty > directory will always fail. BUG=32277 TEST=FileSystemOperationTest.* Review URL: http://codereview.chromium.org/3567012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61480 0039d316-1c4b-4281-b951-d872f2087c98
* Second try at submitting 61462.ericu@google.com2010-10-051-7/+50
| | | | | | | | | BUG=none TEST=in file_system_operation_unittest.cc Review URL: http://codereview.chromium.org/3526018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61468 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 61462 - Add truncate and cancel for FileWriter; write and more tests ↵ericu@google.com2010-10-051-50/+7
| | | | | | | | | | | | | | | will come in later CLs. This CL also contains a fair amount of plumbing for the write call itself. BUG=none TEST=none Review URL: http://codereview.chromium.org/3599011 TBR=ericu@google.com Review URL: http://codereview.chromium.org/3604006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61463 0039d316-1c4b-4281-b951-d872f2087c98
* Add truncate and cancel for FileWriter; write and more tests will come in ↵ericu@google.com2010-10-051-7/+50
| | | | | | | | | | | | later CLs. This CL also contains a fair amount of plumbing for the write call itself. BUG=none TEST=none Review URL: http://codereview.chromium.org/3599011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61462 0039d316-1c4b-4281-b951-d872f2087c98
* file_util_proxy: fix a typo that caused us to ignore a path.evan@chromium.org2010-09-241-1/+1
| | | | | | | | | | This was found by the Clang bot! TEST=compiles Review URL: http://codereview.chromium.org/3470015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60512 0039d316-1c4b-4281-b951-d872f2087c98
* Adding a FileUtilProxy::TouchFile() method that takes a FilePath as andumi@chromium.org2010-09-241-0/+37
| | | | | | | | | | | | argument (instead of PlatformFile). BUG=none TEST=none Review URL: http://codereview.chromium.org/3380024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60397 0039d316-1c4b-4281-b951-d872f2087c98
* Adding some functions that operate on file handles.dumi@chromium.org2010-09-101-0/+230
| | | | | | | | | | TEST=platform_file_unittest.cc BUG=none TBR=darin Review URL: http://codereview.chromium.org/3354020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59041 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 59007 - Adding some utility functions that work on file handles, and ↵dumi@chromium.org2010-09-091-230/+0
| | | | | | | | | | | | | | | | | adding the corresponding relays to file_util_proxy. BUG=none TEST=none Review URL: http://codereview.chromium.org/3303007 TBR=dumi@chromium.org Review URL: http://codereview.chromium.org/3371011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59013 0039d316-1c4b-4281-b951-d872f2087c98
* Adding some utility functions that work on file handles, and addingdumi@chromium.org2010-09-091-0/+230
| | | | | | | | | | | | the corresponding relays to file_util_proxy. BUG=none TEST=none Review URL: http://codereview.chromium.org/3303007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59007 0039d316-1c4b-4281-b951-d872f2087c98
* Add recursive flag to file_util_proxy::CreateDirectory.kinuko@chromium.org2010-09-081-3/+7
| | | | | | | | | 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
* Moving file_util::FileInfo to base::PlatformFileInfo, and adding thedumi@chromium.org2010-09-031-1/+1
| | | | | | | | | | | | last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
* Change file_util_proxy::Entry::isDirectory to is_directory.kinuko@chromium.org2010-09-021-1/+1
| | | | | | | | | BUG=54228 TEST=none, just code cleanup Review URL: http://codereview.chromium.org/3357003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58415 0039d316-1c4b-4281-b951-d872f2087c98
* Changes for browser-side implementation for file api.kkanetkar@chromium.org2010-09-021-10/+239
| | | | | | | | | | BUG=32277 TEST=Separate CL for unit test. Review URL: http://codereview.chromium.org/3212002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58312 0039d316-1c4b-4281-b951-d872f2087c98
* Add an optional parameter to CreatePlatformFile() to report the typedumi@chromium.org2010-08-311-16/+17
| | | | | | | | | | | | of error that occured while trying to open/create a file. TEST=none BUG=none Review URL: http://codereview.chromium.org/3223007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58045 0039d316-1c4b-4281-b951-d872f2087c98
* Support handling blob URL and resolve blob references in upload data.jianli@chromium.org2010-08-311-0/+38
| | | | | | | | | BUG=none TEST=unittest Review URL: http://codereview.chromium.org/3282003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57938 0039d316-1c4b-4281-b951-d872f2087c98
* Change the FileUtilProxy callbacks to report error codes instead of booleans.dumi@chromium.org2010-08-241-28/+43
| | | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3165050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57228 0039d316-1c4b-4281-b951-d872f2087c98
* Moving file_system_proxy to base/ and changing it to work with ↵dumi@chromium.org2010-08-201-0/+245
MessageLoopProxies instead of ChromeThreads. BUG=none TEST=none Review URL: http://codereview.chromium.org/3131026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56923 0039d316-1c4b-4281-b951-d872f2087c98