summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.h
Commit message (Collapse)AuthorAgeFilesLines
* Disk cache: Remove the queue for backend operations andrvargas@google.com2010-11-041-0/+3
| | | | | | | | | | | | change the queue of entry operations so that the operation that is posted is kept on the list. BUG=54338 TEST=net_unittests Review URL: http://codereview.chromium.org/3744007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65118 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Handle failures growing the user_buffer thatrvargas@google.com2010-09-291-1/+2
| | | | | | | | | | | | | | | | | | | should result in data going to an external file. After PrepareBuffer() we must always have either a buffer that will receive the user data, or an initialized address that points to the correct block or external file to receive the data. This CL makes sure that when we end up without a buffer, the second condition is met. BUG=56872 TEST=net_unittests Review URL: http://codereview.chromium.org/3471016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60958 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Start an experiment to measure the impact ofrvargas@google.com2010-09-161-0/+2
| | | | | | | | | | | | throttling cache requests. BUG=54338 TEST=none Review URL: http://codereview.chromium.org/3388009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59729 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Fix the order in which we delete datarvargas@google.com2010-09-161-3/+12
| | | | | | | | | | | | | | | | | | | | | from the block files. Stress testing the cache reveals a problem with the deletion of some data from an entry: it is possible to crash in a way that the block file thinks a block is free and an entry thinks the block is in use. This CL corrects that issue. There is also some new tests and a bunch of DCHECKS added while looking for the problem, as well as adding tests to make sure that a block file is accessed only from one thread (there is no problem with the current code in that regard) BUG=55605 TEST=netunittests Review URL: http://codereview.chromium.org/3430004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59711 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Move Extension::LaunchContainer to extension_constants.h.erg@google.com2010-09-161-3/+1
| | | | | | | | | | | This makes browser.h not depend on extension.h. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3399008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59588 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Implement request throttling.rvargas@google.com2010-09-141-0/+3
| | | | | | | | | | | | | Note that no throttling is performed with this change, the backend is not activating the feature. BUG=54338 TEST=none. Review URL: http://codereview.chromium.org/3416002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59437 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Move more ctors/dtors from headers to implementation.erg@google.com2010-09-011-16/+2
| | | | | | | | | | | | | | | | | - Adding/Moving dtors of objects that have CancelableRequestConsumers shaves three megs off browser.a. - Adding/Moving dtors of objects that have ScopedRunnableMethodFactories only shaved 100k off browser.a/renderer.a. - Adding/Moving dtors of objects that used some form of base::*Timer<> was negligible; there were only a few classes that had a Timer but had a ctor/dtor in the header after the previous cleanups. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3278006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58192 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Extend the internal buffering performed by each entryrvargas@google.com2010-08-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | 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: Replace the backend pointer of the ChildrenDeleterrvargas@google.com2010-07-271-2/+10
| | | | | | | | | | | with a weak pointer to avoid crashing at shutdown. BUG=50082 TEST=net_unittests Review URL: http://codereview.chromium.org/3054012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53838 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Cleaner way to stop evictions at destruction.rvargas@google.com2010-07-231-3/+0
| | | | | | | | | | BUG=49547 TEST=none Review URL: http://codereview.chromium.org/3008014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53421 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Stop evictions while performing final cleanup.rvargas@google.com2010-07-201-0/+3
| | | | | | | | | | | | | The evictions code may post tasks for further processing and that is a problem at cache destruction, so add an explicit method to stop evictions. BUG=49547 TEST=none Review URL: http://codereview.chromium.org/2854053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52964 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Code cleanup after the last cl.rvargas@google.com2010-07-151-25/+15
| | | | | | | | | | BUG=26730 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52527 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Switch the disk cache to use the cache_thread.rvargas@google.com2010-07-131-9/+40
| | | | | | | | | | | | | 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
* Disk cache: Add a few more histograms.rvargas@google.com2010-07-121-0/+6
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/2863039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52140 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51858 - Disk cache: Switch the disk cache to use the cache_thread. rvargas@google.com2010-07-081-40/+9
| | | | | | | | | | | | | | | | 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-9/+40
| | | | | | | | | | | | | 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-40/+9
| | | | | | | | | | | | | | | | | 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-9/+40
| | | | | | | | | | | | | | 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-40/+9
| | | | | | | | | | | | | | | | | | | (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-9/+40
| | | | | | | | | | | | | 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-9/+15
| | | | | | | | | | | 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-6/+8
| | | | | | | | | | | | 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
* Get rid of DISALLOW_EVIL_CONSTRUCTORS macro usage in our code base.tfarina@chromium.org2010-06-071-2/+2
| | | | | | | | | | | TODO: Fix the remaining usages in third_party libraries and get rid of the macro in question. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/2657005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49032 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Use asynchronous Open/Create/Doom entry calls.rvargas@google.com2010-01-141-0/+1
| | | | | | | | | | | | | | | | More changes to the state machine: now we really issue asynchronous calls when getting new cache entries. We have to add a new serialization mechanism to the http cache in order to handle races among multiple requests creating and opening the same entry. BUG=26729 TEST=unittests Review URL: http://codereview.chromium.org/523019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36211 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: New interface that enables asynchronous completionrvargas@google.com2009-11-051-0/+12
| | | | | | | | | | | of any operation that may block. BUG=26730 TEST=none Review URL: http://codereview.chromium.org/355028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31160 0039d316-1c4b-4281-b951-d872f2087c98
* Final patch to convert disk cache to using FilePath instead oftony@chromium.org2009-10-151-1/+1
| | | | | | | | | | | 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
* Convert BlockFiles to use FilePath instead of wstring.tony@chromium.org2009-10-131-2/+2
| | | | | | | | BUG=24444 Review URL: http://codereview.chromium.org/274012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28873 0039d316-1c4b-4281-b951-d872f2087c98
* Start migrating the disk cache to using FilePath.tony@chromium.org2009-10-121-6/+7
| | | | | | | | | | 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
* Disk cache: End the experiment and use the new evictionrvargas@google.com2009-09-291-0/+7
| | | | | | | | | | | | algorithm by default. BUG=none TEST=none Review URL: http://codereview.chromium.org/248022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27514 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Lower the definition of a loaded system fromrvargas@google.com2009-08-111-6/+7
| | | | | | | | | | | | | | | 10 pending operations to 5. Data from the Beta channel shows that for all group sizes except one, the 99.90% cutoff of number of pending operations falls below 5 (in fact, below 3). BUG=none TEST=none Review URL: http://codereview.chromium.org/164355 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23120 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Open the disk cache experiment for new users.rvargas@google.com2009-08-011-1/+5
| | | | | | | | | | | | Also, fix the code that makes the unit tests have consistent results. BUG=none TEST=none Review URL: http://codereview.chromium.org/160485 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22238 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Remove remaining uses of RankingsNode.pointer.rvargas@google.com2009-07-301-3/+4
| | | | | | | | | | | | | 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-2/+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-3/+5
| | | | | | | | | | | | | | | | | | | | 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: Don't evict entries if we are busy doing other stuff.rvargas@google.com2009-07-091-3/+6
| | | | | | | | | BUG=10727 TEST=none Review URL: http://codereview.chromium.org/155314 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20330 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Keep a map of all open entries.rvargas@google.com2009-07-071-2/+11
| | | | | | | | | | | | | | | | | 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
* Disk Cache: Split some time histograms in groups basedrvargas@google.com2009-06-251-0/+3
| | | | | | | | | | | on the cache size. BUG=10727 TEST=none Review URL: http://codereview.chromium.org/146129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19256 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Report more info from the current experiment.rvargas@google.com2009-06-051-4/+13
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/119218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17772 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Modify the unit tests so that they test bothrvargas@google.com2009-04-171-0/+3
| | | | | | | | 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/+3
| | | | | | | | (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
* Disk cache: Finish the current experiment.rvargas@google.com2009-04-101-1/+1
| | | | | | Review URL: http://codereview.chromium.org/67046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13535 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Second pass (and final) to allow multiple instancesrvargas@google.com2009-03-271-0/+9
| | | | | | | | | | | | | | | | | | | of BackendImpl. This cl takes care of all the histograms on the disk cache. Most of them have to be splitted in three so that we get separate data from different cache types. There are a few places where the complexity of splitting the histogram is not worth it so we just keep either all data together (if it makes sense), or just ignore data for some types of caches. note: Having multiple versions of a histogram but only one "active" for a given client is not the same as having multiple histograms working at the same time for different objects. Review URL: http://codereview.chromium.org/42682 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12692 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: First pass to make it possible to havervargas@google.com2009-03-251-5/+13
| | | | | | | | | | | | multiple instances of BackendImpl. We need multiple objects to be able to support media files on the cache. After this change, histograms will be the only thing that get messed up by multiple disk caches. Review URL: http://codereview.chromium.org/49027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12520 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: More instrumentation for the cache.rvargas@google.com2009-03-201-1/+12
| | | | | | | | | | | | | | Now we separate data between before and after the cache is full. Also, reduce the rate at which a particular client sends data to be only once a week. The effect is that the histogram data will only have one value per client, and the same client will not be "voting" on more than one version (release) at the same time. Review URL: http://codereview.chromium.org/50063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12218 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-111-1/+0
| | | | | | | | | Normalize end of file newlines in net/. All files end in a single newline. Review URL: http://codereview.chromium.org/43079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11442 0039d316-1c4b-4281-b951-d872f2087c98
* New disk cache eviction algorithm (partial implementation).rvargas@google.com2009-03-061-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | Disabled by a #def. When enabled, file format 2.1 is used, with a possible update from ver 2.0. If a version with this code disabled is run after the upgrade, it will just discard the file and go back to 2.0. We now put some of those extra list to use! Entries are separated into various lists depending on how often are used, and we keep track of previously evicted entries. If the new algorithm is not enabled, most of the code just goes through a different path (with the old code instead of the new one). One notable exception is OpenFollowingEntry, used to enumerate the entries on the cache; the code changed significantly to support the new version of the "cache iterator", but functionally should do the same as the current code. Review URL: http://codereview.chromium.org/27345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11145 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: move eviction code to a separate file.rvargas@google.com2008-12-181-13/+6
| | | | | | | | There should be no change in behavior with this CL. Review URL: http://codereview.chromium.org/14183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7190 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: remove the hard coded list from rankings.ccrvargas@google.com2008-12-161-1/+1
| | | | | | | | | | | | | | | | The rankings module now works with any list, not just the first one. This is part of the support needed for new eviction algorithms. note: Rankings::CheckList() is basically the code that was implementing the old Rankings::SelfCheck() (moved with this cl). The disk cache behavior is not changing with this cl. Review URL: http://codereview.chromium.org/14141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7074 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Set up an experiment to measure the effect ofrvargas@google.com2008-12-111-0/+5
| | | | | | | | | | | | | | | | increasing the maximum cache size. There will be three groups on the experiment, each group with 10% of the users (Dev Channel). Each group will have the max cache size increased by a factor from 2 to 4 times the current size, and we'll measure the age of evicted entries. I'm also adding a few metrics of reliability, to detect how often we're not getting to do proper cleanup. Review URL: http://codereview.chromium.org/14013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6847 0039d316-1c4b-4281-b951-d872f2087c98