summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Disk cache: A dirty entry can point to a list thatrvargas@google.com2010-11-171-0/+20
| | | | | | | | | | | | | | | is not the actual list where the entry is stored. This CL recognizes that case and hanldes removing that entry from the lists, without saying that there is critical corruption. BUG=38859 TEST=net_unittests Review URL: http://codereview.chromium.org/5119001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66518 0039d316-1c4b-4281-b951-d872f2087c98
* Convert implicit scoped_refptr constructor calls to explicit ones, part 1thakis@chromium.org2010-11-011-14/+14
| | | | | | | | | | | This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2776043/ . I manually fixed a few rough spots of the rewriter output (doh1-3) and fixed all presubmit errors. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4192012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64573 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Change the way we delete files.rvargas@google.com2010-09-291-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | Now we always share delete and request delete access when we open the files, and don't close the handle before deleting a file. The result is that the delete operation should not be prevented by someone opening the file right after we close our handle. The downside is that anybody attempting to open one of our files while the browser is running will have to also share delete or their request will fail. On the other hand, we don't really want other people modifying the files at the same time, so the change may be for good. The caveat is that I think most of the failures are result of improper AV behavior, so we have to see what happens. BUG=16723 TEST=net_unittests Review URL: http://codereview.chromium.org/3475025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60989 0039d316-1c4b-4281-b951-d872f2087c98
* net: Append base:: in the StringPrintf calls.tfarina@chromium.org2010-09-251-1/+2
| | | | | | | | | | | (Note: This is a TODO in string_util.h) BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3390026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60555 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 60165 - GTTF: Make net_unittests run successfully with parallel test ↵phajdan.jr@chromium.org2010-09-221-51/+52
| | | | | | | | | | | | | | | | launcher by using a unique directory for disk cache tests. BUG=54098 TEST=run net_unittests using tools/parallel_launcher/parallel_launcher.py Review URL: http://codereview.chromium.org/3410008 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3387012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60166 0039d316-1c4b-4281-b951-d872f2087c98
* GTTF: Make net_unittests run successfully with parallel test launcherphajdan.jr@chromium.org2010-09-221-52/+51
| | | | | | | | | | | by using a unique directory for disk cache tests. BUG=54098 TEST=run net_unittests using tools/parallel_launcher/parallel_launcher.py Review URL: http://codereview.chromium.org/3410008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60165 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Fix the include order.rvargas@google.com2010-09-201-1/+1
| | | | | | | | | | BUG=55970 TEST=none Review URL: http://codereview.chromium.org/3458006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59952 0039d316-1c4b-4281-b951-d872f2087c98
* Annotate test-only race in DiskCacheBackendTest.NewEvictionTrimInvalidEntrytimurrrr@chromium.org2010-09-171-0/+8
| | | | | | | | | | | also remove the suppressions which won't be needed anymore. Also remove suppression for an old bug 30960 fixed long ago. BUG=55970,30960 TBR=rvargas TEST=trybots, TSan Review URL: http://codereview.chromium.org/3416009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59778 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: For an AppCache, now we only update thervargas@google.com2010-08-271-4/+76
| | | | | | | | | | | | | | | | | | | | | | | | LRU list when an entry is created. This means that we don't update the list anymore when an entry is accessed, even if we are writing to the entry. The general idea is that now we should be able to open an AppCache and read from it without modifying the contents of the cache, so that if the browser crashes, we won't find "dirty" entries to discard. By minimizing writes to the LRU list, we reduce the chances that the list will get corrupt beyond the point where we cannot trust it anymore if the whole system crashes (and not just the browser). BUG=51870 TEST=net_unittests Review URL: http://codereview.chromium.org/3186032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57697 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Extend the internal buffering performed by each entryrvargas@google.com2010-08-231-51/+112
| | | | | | | | | | | | | | | | | | | | | | to cover external files. We now keep a variable-size buffer and use it even after we know that the data is not going to be stored by a block-file. The backend keeps track of the total memory used by all entries and prevents that value from going over a max value that depends on the total memory available. This CL removes the tests that were checking the synchronous operation of sparse IO because that model is no longer supported by the public API, and this CL would add complexity to them (they fail due to thread safety concerns). BUG=6626 TEST=net_unittests Review URL: http://codereview.chromium.org/3167020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57082 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Code cleanup after the last cl.rvargas@google.com2010-07-151-1/+1
| | | | | | | | | | BUG=26730 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52527 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Read the index and data_0 files in a singlervargas@google.com2010-07-151-71/+51
| | | | | | | | | | | | | | | | operation to reduce multiple IO operations generated by on-demand paging. Also, generate extra histograms and improve the scale of some others. BUG=none TEST=net_unittests Review URL: http://codereview.chromium.org/2891022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52506 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-07-131-17/+80
| | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2945002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52185 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51858 - Disk cache: Switch the disk cache to use the cache_thread. rvargas@google.com2010-07-081-70/+15
| | | | | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2827043 TBR=rvargas@google.com Review URL: http://codereview.chromium.org/2944002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51874 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Switch the disk cache to use the cache_thread. rvargas@google.com2010-07-081-15/+70
| | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2827043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51858 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51456 - Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-07-021-66/+14
| | | | | | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2841034 TBR=rvargas@google.com Review URL: http://codereview.chromium.org/2881010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51469 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-07-011-14/+66
| | | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2841034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51456 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51312 - Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-07-011-66/+14
| | | | | | | | | | | | | | | | | | | (tsan errors on the unit tests) Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2829008 TBR=nsylvain@chromium.org Review URL: http://codereview.chromium.org/2819032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51325 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-06-301-14/+66
| | | | | | | | | | | | | Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2829008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51312 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Remove deprecated methods from the disk cache interface.rvargas@google.com2010-06-171-1/+1
| | | | | | | | | | | BUG=26730 TEST=current tests Review URL: http://codereview.chromium.org/2869005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50147 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Update the disk cache tools and tests to uservargas@google.com2010-06-151-23/+102
| | | | | | | | | | | | the new interface (provide a cache thread and callback). BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2739007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49819 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Allow the disk cache histograms to generatervargas@google.com2010-05-111-0/+13
| | | | | | | | | | | | | more than one name so that we can move a user from one group to another within the same session. BUG=none TEST=unittest Review URL: http://codereview.chromium.org/2044007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46931 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Re-enable some unit tests that were disabledrvargas@google.com2010-04-301-13/+6
| | | | | | | | | | | or marked as flaky. BUG=21110,38562 TEST=unittests Review URL: http://codereview.chromium.org/1800010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46084 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: fix a unit test for Linux.rvargas@google.com2010-04-301-4/+1
| | | | | | | | | | | The name of a test file was not correct. BUG=41563 TEST=unittest Review URL: http://codereview.chromium.org/1792011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46020 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Make sure that we don't access the index filervargas@google.com2010-04-281-0/+15
| | | | | | | | | | | | if it was truncated. BUG=41563 TEST=unittest Review URL: http://codereview.chromium.org/1719024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45878 0039d316-1c4b-4281-b951-d872f2087c98
* Make PreferredCacheSize(avail) <= avail*0.8 and f(x) <= f(x+1). nsylvain@chromium.org2010-04-061-25/+44
| | | | | | | | | | | | | Contributed by slamm@google.com BUG=40079 TEST=DiskCacheTest.AutomaticMaxSize http://codereview.chromium.org/1564007 Review URL: http://codereview.chromium.org/1566021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43749 0039d316-1c4b-4281-b951-d872f2087c98
* Disable more DiskCacheBackendTest's as the crash on Linux/shlibtimurrrr@chromium.org2010-03-311-2/+4
| | | | | | | | TBR=rvargas,amit BUG=38562 Review URL: http://codereview.chromium.org/1546007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43213 0039d316-1c4b-4281-b951-d872f2087c98
* Disabling the DiskCacheBackendTest.NewEvictionDisableFailure2 as it crashes ↵timurrrr@chromium.org2010-03-301-1/+2
| | | | | | | | | | on Linux/shlib BUG=38562 TBR=amit Review URL: http://codereview.chromium.org/1593001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43077 0039d316-1c4b-4281-b951-d872f2087c98
* Disabling the DiskCacheBackendTest.DisableFailure2 as it crashes at times on ↵timurrrr@chromium.org2010-03-301-1/+2
| | | | | | | | | | Linux TBR=amit BUG=38562 Review URL: http://codereview.chromium.org/1592002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43074 0039d316-1c4b-4281-b951-d872f2087c98
* Disabling the DiskCacheBackendTest.DisableSuccess2 as it crashes at times on ↵ananta@chromium.org2010-03-291-1/+2
| | | | | | | | | | | Linux Bug=38562 TBR=amit Review URL: http://codereview.chromium.org/1530007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42978 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache" Convert some of the unit tests to the newrvargas@google.com2010-03-181-114/+115
| | | | | | | | | | | disk cache interface (async) BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/1135002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42031 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Make sure that we don't oveload the IO messagervargas@google.com2010-03-151-0/+3
| | | | | | | | | | | | loop when there are (active) doomed entries that we want to remove from the "deleted" list. BUG=32119 TEST=unittests Review URL: http://codereview.chromium.org/969002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41657 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Add a test to make sure that the cachervargas@google.com2009-12-181-1/+2
| | | | | | | | | | | | | | | | works as expected with synchronous responses. As an added bonus, now changing the default test mode of kRangeGET_TransactionOK doesn't end up with some tests hanging, so it is easy to manually verify that all tests work as expected. BUG=26729 TEST=unittests Review URL: http://codereview.chromium.org/501099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34914 0039d316-1c4b-4281-b951-d872f2087c98
* Mark some disabled tests as flaky to increase test coverage.phajdan.jr@chromium.org2009-10-161-3/+3
| | | | | | | | | | | | When a test doesn't hang or crash, it can run on the bots and on developers' machines. BUG=none TEST=none Review URL: http://codereview.chromium.org/269104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29279 0039d316-1c4b-4281-b951-d872f2087c98
* Final patch to convert disk cache to using FilePath instead oftony@chromium.org2009-10-151-17/+16
| | | | | | | | | | | wstring. After this patch, I'm able to start chrome in a user data dir with non-ascii characters on non-utf8 systems. BUG=24444 Review URL: http://codereview.chromium.org/267085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29136 0039d316-1c4b-4281-b951-d872f2087c98
* Start migrating the disk cache to using FilePath.tony@chromium.org2009-10-121-1/+1
| | | | | | | | | | This converts BackendImpl to using FilePath. BUG=24444 Review URL: http://codereview.chromium.org/261045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28711 0039d316-1c4b-4281-b951-d872f2087c98
* Disable flaky DiskCacheBackendTest.NewEvictionDisableSuccess4.phajdan.jr@chromium.org2009-09-161-1/+3
| | | | | | | | | | This is #9 flaky test and rising (#5 in tests failing recently). TBR=rvargas Review URL: http://codereview.chromium.org/193127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26345 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Implement asynchronous IO for Posix.rvargas@google.com2009-08-211-0/+33
| | | | | | | | | | BUG=16507 TEST=Unittests Review URL: http://codereview.chromium.org/173170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23990 0039d316-1c4b-4281-b951-d872f2087c98
* Revert cl 23919 to investigate valgrind failures.rvargas@google.com2009-08-211-33/+0
| | | | | | | | | | | TBR=willchan TEST=none BUG=none Review URL: http://codereview.chromium.org/174205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23926 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Implement asynchronous IO for Posix.rvargas@google.com2009-08-211-0/+33
| | | | | | | | | | BUG=16507 TEST=Unittests Review URL: http://codereview.chromium.org/171085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23919 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Don't depend on the backend being enabled torvargas@google.com2009-08-061-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | be able to return the key of an open entry. Whenever a critical corruption is detected by the disk cache, the backend disables itself and starts failing all requests until it's able to re-create the backing store. Key's longer than 928 bytes are not stored inside the entry itself, so a file object is required to access them. The backend will reject any request for a file object after it is disabled, so a user's request for the key of an open entry will also fail. Now we keep a pointer to the related file object (if needed) so that we don't have to ask the backend for it when the user requests the current key. BUG=9952 TEST=unittest Review URL: http://codereview.chromium.org/165030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22637 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Remove remaining uses of RankingsNode.pointer.rvargas@google.com2009-07-301-0/+45
| | | | | | | | | | | | | We now have a map of open entries so we don't need to do a lookup through the rankings node anymore. This simplifies the 64 bit version of the code. BUG=17881 TEST=unittests Review URL: http://codereview.chromium.org/159643 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22074 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Avoid restarting the cache while it may be in use.rvargas@google.com2009-07-241-0/+5
| | | | | | | | | | | | | | Now the code that releases resources runs from the message loop so that methods can cause the cache to disable itself while still being able to touch internal state. BUG=17604 TEST=unittests. Review URL: http://codereview.chromium.org/159327 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21550 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Fix handling of invalid entries that are detectedrvargas@google.com2009-07-231-10/+72
| | | | | | | | | | | | | | | | | | | | when doing evictions or enumerations. This cl fixes an issue with dirty entries being deleted twice from disk, and improves the whole thing so that different flavors or corrupt entries are removed gracefully. We started deleting things twice when we created the map of currently-open entries, because we don't want to have dirty entries on that map, so it is possible to have multiple EntryImpl objects that refer to the same entry (for corrupt entries). BUG=17474 TEST=Unittests, stress_cache.exe Review URL: http://codereview.chromium.org/155951 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21360 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Keep a map of all open entries.rvargas@google.com2009-07-071-5/+14
| | | | | | | | | | | | | | | | | We still have a few crashes when for some reason we believe an entry is not dirty and we follow the pointer stored by its rankings node only to crash while accessing the memory. I have no explanation to why the dirty id matches the current one (a page boundary issue maybe?), but having a map with all open entries solves the issue of having to follow pointers from disk. BUG=15596, b/1120346 TEST=unittests Review URL: http://codereview.chromium.org/149218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20067 0039d316-1c4b-4281-b951-d872f2087c98
* Remove code path that passes a file handle to the rendererhclam@chromium.org2009-05-291-5/+2
| | | | | | | | | | | | | | | | | | | | | | Since the code now does range request without any caching the code path for passing file handle is not used any more. Changes: 1. Remove response_data_file in webkit_glue::ResourceResponseHead 2. Remove response_data_file in net::ResourceInfo 3. Remove code that passes file handle using IPC 4. Remove code that passes file hadnle from network layer to ResourceDispatcherHost 5. Remove MediaResourceHandler 6. Remove code in disk_cache that expose the file handle 7. Remove ChromeURLRequestContext::CreateOffTheRecordForMedia() so no more OTR request context for media, in OTR mode simply memory cache is used 8. Reset cache size for media cache to default BUG=12249 BUG=12256 Review URL: http://codereview.chromium.org/113931 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17227 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Reset mask_ when the disk cache is being restarted.rvargas@google.com2009-05-281-0/+63
| | | | | | | | | | | | | | | It is possible that the size for the index table is reduced when the cache is restarted (the available disk space could be lower than what it was when the cache was originally created). If that is the case, not resetting mask_ to 0 will prevent the mask to be set correctly for the new table size, resulting in a crash. BUG=12378 TEST=unittests Review URL: http://codereview.chromium.org/113930 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17052 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate wstring version of PathService::Get() in net.thestig@chromium.org2009-05-011-6/+6
| | | | | | Review URL: http://codereview.chromium.org/100240 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15088 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Modify the unit tests so that they test bothrvargas@google.com2009-04-171-131/+358
| | | | | | | | eviction algorithms without having to recompile the code. Review URL: http://codereview.chromium.org/79031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13909 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Enable the code that sets the max size automatically.rvargas@google.com2009-04-141-0/+30
| | | | | | | | (still limiting the ceiling). Review URL: http://codereview.chromium.org/68007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13684 0039d316-1c4b-4281-b951-d872f2087c98