summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_operation_write_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Check response code before writing blob to file.tzik@chromium.org2012-01-061-1/+1
| | | | | | | | | | | | | | In current impl, FileWriterDelegate does not check response code of blob scheme request. This causes falsely success write-job when writing broken blob to file. This patch makes it explicitly fail. BUG=None TEST="FileWriterDelegateTest.*, FileSystemOperationWriteTest.*" Review URL: http://codereview.chromium.org/9007055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116663 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Removing FileSystemPathManagerkinuko@chromium.org2012-01-051-3/+1
| | | | | | | | | | | | | | | | - Deprecating FileSystemPathManager, which I believe no longer has a lot of reasons to exist * Changed GetFileSystemTypeString to a regular function in file_system_util * Added GetFileUtil(FileSystemType), GetMountPointProvider(FileSystemType), external_provider() to FileSystemContext * Moved all the tests in file_system_path_manager_unittest to file_system_mount_point_provider_unittest - Also replaced two boolean values in FileSystemContext with a thin FileSystemOptions interface BUG=none TEST=no functional changes Review URL: http://codereview.chromium.org/9004019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116482 0039d316-1c4b-4281-b951-d872f2087c98
* Use base::Callback in Quota related code.tzik@chromium.org2011-10-181-4/+4
| | | | | | | | | BUG=None TEST='Compilation should finished successfull and all quota related tests should be passed.' Review URL: http://codereview.chromium.org/8070001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106060 0039d316-1c4b-4281-b951-d872f2087c98
* A few improvements to Blob handling.michaeln@google.com2011-10-171-15/+17
| | | | | | | | | | | | * Break large blobs into multiple ipcs during creation. * Use shared memory blocks for the xfer. * Rename some methods and IPCs for readability. * Cap memory usage in the browser process at 1G. BUG=97221 Review URL: http://codereview.chromium.org/7974011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105950 0039d316-1c4b-4281-b951-d872f2087c98
* [Refactor] to rename and re-layer the file_util stack layers.dmikurube@google.com2011-09-051-4/+3
| | | | | | | | | | | | | | | | | | | | Splits FileSystemFileUtil into two classes. 1. FileSystemFileUtil (pure virtual and non-virtual functions + functions to forward to an underlying file_util.) 2. NativeFileUtil (FileUtil for OS-native operations) Renames *FileSystemFileUtil into *FileUtil except for FileSystemFileUtil. Renames *_file_system_file_util.{cc,h} into *_file_util.{cc,h}. Renames variable *_file_system_file_util into *_file_util. BUG=none TEST=All FileAPI-related tests Review URL: http://codereview.chromium.org/7470037 Patch from Dai Mikurube <dmikurube@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99641 0039d316-1c4b-4281-b951-d872f2087c98
* Add MessageLoopProxy::currentnduca@chromium.org2011-08-151-3/+3
| | | | | | Review URL: http://codereview.chromium.org/7583053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96819 0039d316-1c4b-4281-b951-d872f2087c98
* Refactoring: Change all -FileUtils non-Singleton and to own underlying ↵dmikurube@chromium.org2011-07-271-1/+1
| | | | | | | | | | | | | | | | | FileUtils. Based on the discussion at http://codereview.chromium.org/7174002/diff/26001/webkit/fileapi/local_file_system_file_util.h#newcode38, this change * also reduces dependency between FileUtils, * enables more flexible stacking of -FileUtils, such as QuotaFileUtil over other -FileUtils, and * makes -FileUtils symmetry so owner handling for these objects gets unified. BUG=none TEST=FileSystemFileUtilTest.*,FileSystemOperationTest.*,FileSystemOperationWriteTest.*,FileSystemQuotaTest.*,FileWriterDelegateTest.*,LocalFileSystemFileUtilTest.*,ObfuscatedFileSystemFileUtil.*,QuotaFileUtil.*,SandboxMountPointProviderTest.* Review URL: http://codereview.chromium.org/7312023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94251 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate RegisterProtocolFactory/(Un)RegisterInterceptor.willchan@chromium.org2011-07-191-2/+3
| | | | | | | | | | | | Mark those APIs as private and friend existing uses. BUG=none TEST=none Review URL: http://codereview.chromium.org/7397008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92992 0039d316-1c4b-4281-b951-d872f2087c98
* Make the URLRequestContext constantbattre@chromium.org2011-07-141-4/+9
| | | | | | | | | | | | | The URLRequestContext is basically a collection of pointers to other data structures. This CL makes sure that these pointers are not easily modified after the construction of the URLRequestContext. BUG=67597 TEST=no Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=92511 Review URL: http://codereview.chromium.org/7322010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92521 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 92511 - Make the URLRequestContext constantbattre@chromium.org2011-07-141-9/+4
| | | | | | | | | | | | | | The URLRequestContext is basically a collection of pointers to other data structures. This CL makes sure that these pointers are not easily modified after the construction of the URLRequestContext. BUG=67597 TEST=no Review URL: http://codereview.chromium.org/7322010 TBR=battre@chromium.org Review URL: http://codereview.chromium.org/7366005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92512 0039d316-1c4b-4281-b951-d872f2087c98
* Make the URLRequestContext constantbattre@chromium.org2011-07-141-4/+9
| | | | | | | | | | | The URLRequestContext is basically a collection of pointers to other data structures. This CL makes sure that these pointers are not easily modified after the construction of the URLRequestContext. BUG=67597 TEST=no Review URL: http://codereview.chromium.org/7322010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92511 0039d316-1c4b-4281-b951-d872f2087c98
* Change {Obfuscated|Local}FileSystemFileUtil non-Singleton to take an ↵dmikurube@chromium.org2011-07-061-2/+6
| | | | | | | | | | | | | | | underlying *FileUtil. This change : * reduces dependency between FileUtils, and * enables more flexible stacking of FileSystemFileUtil, such as {Obfuscated|Local}FSFU without any quota operation. BUG=none TEST=*FileUtilTest.*,FileSystemPathManagerTest.*,SandboxMountPointProvider.*,FileSystem*OperationTest.*,FileWriterDelegateTest.*,FileSystemQuotaTest.* Review URL: http://codereview.chromium.org/7174002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91547 0039d316-1c4b-4281-b951-d872f2087c98
* Retain support for 'UnlimitedStorage' in the QuotaManager.michaeln@google.com2011-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Track unlimited_usage in parallel with total global_usage. The latter value is the sum of all usage by any origin (same as before). The new value is the amount of the total that is attributable to origins with the unlimited storage permission. Widened the GlobalUsageCallback to take two int64 params, one for the total global_usage and the other for the unlimited_usage. Modified the eviction logic to exempt origins with the unlimited storage right from eviction. Modified the behavior of QuotaManager::GetUsageAndQuota(origin) method to return kint64max for unlimited origins. Also modified the return value in the limited case to be 10% of the total limit for temp storage, unless the system is over the total limit in which case they're capped at their current usage level. // Allow an individual host to utilize no more than 10% of the total // pool available for temp storage. int64 host_quota = quota() / 10; // If total temp usage is over-budget, stop letting new data in until we reclaim space. limited_global_usage = global_usage() - unlimted_global_usage(); if (limited_global_usage > quota()) host_quota = std::min(host_quota, host_usage()); return host_quota; At this time, the total limit for temp storage is 1G, that gives each site 100M to work with (no prompts involved). BUG=61676 TEST=unittests Review URL: http://codereview.chromium.org/6962005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87207 0039d316-1c4b-4281-b951-d872f2087c98
* Use appropriate FileSystemOperations in "filesystem:" URLRequestJobs.adamk@chromium.org2011-05-191-4/+0
| | | | | | | | | | | | | | | | | | | | FileSystemURLRequestJob now calls GetMetadata(), while FileSystemDirURLRequestJob calls ReadDirectory(). With neither calling GetLocalPath(), the need for FileSystemURLRequestJobBase has disappeared, as has the need for FileSystemOperation::GetLocalPath and FileSystemCallbackDispatcher::DidGetLocalPath(). The only changes in behavior due to this patch are: - ReadDirectory is now called on the URL, so it will still work properly after the obsfuscated filesystem is in use. - FileSystemDirURLRequestJob has been fixed to show a directory header. This was somehow lost in the refactor to use FileSystemURLRequestJobBase. - The error codes for "file not found" are now always net::ERR_FILE_NOT_FOUND. R=ericu@chromium.org Review URL: http://codereview.chromium.org/7047013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86015 0039d316-1c4b-4281-b951-d872f2087c98
* Move scoped_temp_dir and scoped_native_library back from base/memory to base.thakis@chromium.org2011-05-191-4/+4
| | | | | | | | | | | It looks like they got moved accidentally in http://codereview.chromium.org/6714032 BUG=none TEST=none Review URL: http://codereview.chromium.org/7048007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86010 0039d316-1c4b-4281-b951-d872f2087c98
* Change usage cache code in QuotaFileUtil to use QuotaUtil methodskinuko@chromium.org2011-05-191-50/+23
| | | | | | | | | | | | | | | *** This patch is necessary not only for refactoring but to notify changes from FS to QM (call notifyStorageModified()) upon modifications. *** - replaced usage cache code in QuotaFileUtilTest with QuotaUtil code - this change required some other FileSystem tests to use correct sandbox path, so touched the FileSystem test code (namely LocalFileSystemFileUtilTest, FileSystemOperationTest and FileSystemOperationWriteTest) too. - factored out some common code into a helper class (FileSystemTestOriginHelper) as I needed to make the same change again and again BUG=61676 TEST=QuotaFileUtilTest.*, LocalFileSystemFileUtilTest.*, FileSystemOperationTest.*, FileSystemOperationWriteTest.*, FileWriterDelegateTest.* Review URL: http://codereview.chromium.org/6975016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85884 0039d316-1c4b-4281-b951-d872f2087c98
* Memory leak fix in FileSystemOperationWriteTestkinuko@chromium.org2011-05-171-0/+1
| | | | | | | | BUG=none TEST=FileSystemOperationWriteTest.* TBR=hbono@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85640 0039d316-1c4b-4281-b951-d872f2087c98
* Set allowed bytes growth in FileSystemOperation from QuotaManager.dmikurube@chromium.org2011-05-101-2/+61
| | | | | | | | | | | | | | | | It sets allowed bytes growth before copy(/move)/write/truncate. It includes : 1) rewriting FileSystemOperationTest with using FileSystemContext, PathManager and QuotaManager, and 2) switching the callee of LocalFileSystemFileUtil into QuotaFileUtil. BUG=74841 TEST=FileSystemOperationTest.*, FileSystemOperationWriteTest.* Review URL: http://codereview.chromium.org/6865008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84776 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SandboxQuotaClient for Quota support in sandboxed filesystemkinuko@chromium.org2011-05-091-1/+1
| | | | | | | | | | | | - Refactored FileSystemUsageTracker as a SandboxQuotaClient - Added a few more tests BUG=61676 TEST=SandboxQuotaClientTest.* Review URL: http://codereview.chromium.org/6883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84604 0039d316-1c4b-4281-b951-d872f2087c98
* Update .usage in QuotaFileUtil and FileWriterDelegate.dmikurube@google.com2011-04-261-14/+53
| | | | | | | BUG=74841 TEST=QuotaFileUtilTest.*,FileWriterDelegateTest.*,FileSystemOperationWriteTest.* git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83006 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed file/directory url resolution for external mount point provider.zelidrag@chromium.org2011-04-201-0/+4
| | | | | | | | | | Per Eric's request, refactored FileSystemDirURLRequestJob and FileSystemURLRequestJob classes to resolve local file system through a new operation. BUG=chromium-os:14225 TEST=added new test cases to FileSystemPathManagerTest.*, added FileSystemOperationTest.TestGetLocalFilePathSuccess Review URL: http://codereview.chromium.org/6864040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82266 0039d316-1c4b-4281-b951-d872f2087c98
* Nit fix FileSystemOperationWriteTest about when exiting the thread and ↵dmikurube@chromium.org2011-04-141-6/+3
| | | | | | | | | | | | remove unnecessary lines. BUG=none TEST=none Review URL: http://codereview.chromium.org/6852021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81571 0039d316-1c4b-4281-b951-d872f2087c98
* More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where ericu@google.com2011-04-131-7/+17
| | | | | | | | | | | | | possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/, which bounced recently. There are a few changes here that weren't there [most notably in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. Review URL: http://codereview.chromium.org/6833007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81463 0039d316-1c4b-4281-b951-d872f2087c98
* Fix FileSystemOperationTest for writing operations to avoid conflicting ↵dmikurube@chromium.org2011-04-131-35/+40
| | | | | | | | | | | | class names. BUG=none TEST=FileSystemOperationWriteTest.* Review URL: http://codereview.chromium.org/6835015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81382 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 81319 - More filesystem cleanup: convert URL-encoded-as-FilePath to ↵ericu@google.com2011-04-121-17/+7
| | | | | | | | | actual URL, where possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/ [third try lucky,fourth try persistent?], which bounced most recently due to bugs manifestingonly on XP. There are a few changes here that weren't there [infile_system_operation_write_unittest.cc and file_system_operation.cc], butthey're pretty trivial build/test fixes.BUG=none TEST=noneReview URL: http://codereview.chromium.org/6821065 TBR=ericu@google.com Review URL: http://codereview.chromium.org/6836002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81320 0039d316-1c4b-4281-b951-d872f2087c98
* More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where ericu@google.com2011-04-121-7/+17
| | | | | | | | | | | | | | | | | possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/ [third try lucky, fourth try persistent?], which bounced most recently due to bugs manifesting only on XP. There are a few changes here that weren't there [in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/6821065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81319 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 81028 - It broke LayoutTests/ fast/filesystem/op-copy.html on Windows ↵tkent@chromium.org2011-04-111-17/+7
| | | | | | | | | | | Release and Debug. More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/, which bounced dueto a recent checkin that required a merge. There are a few changes here thatweren't there [in file_system_operation_write_unittest.cc andfile_system_operation.cc], but they're pretty trivial build/test fixes.BUG=none TEST=noneReview URL: http://codereview.chromium.org/6813066 TBR=ericu@google.com Review URL: http://codereview.chromium.org/6813072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81065 0039d316-1c4b-4281-b951-d872f2087c98
* More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where ericu@google.com2011-04-091-7/+17
| | | | | | | | | | | | | | | | possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/, which bounced due to a recent checkin that required a merge. There are a few changes here that weren't there [in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/6813066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81028 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 80982, tests failing on Win XPdmichael@chromium.org2011-04-081-17/+6
| | | | | | | | | TBR=ericu BUG=None TEST=None Review URL: http://codereview.chromium.org/6821020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80991 0039d316-1c4b-4281-b951-d872f2087c98
* More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where ericu@google.com2011-04-081-6/+17
| | | | | | | | | | | | | | | | possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/, which bounced due to a recent checkin that required a merge. There are a few changes here that weren't there [in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/6812040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80982 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unittest for FileSystemOperation::Write().dmikurube@chromium.org2011-04-071-0/+253
BUG=none TEST=FileSystemOperationTest.TestWrite Review URL: http://codereview.chromium.org/6770004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80735 0039d316-1c4b-4281-b951-d872f2087c98