summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache.cc
Commit message (Collapse)AuthorAgeFilesLines
* Http cache: Reorder the files after the previous mess-up.rvargas@google.com2010-03-081-62/+62
| | | | | | | | | | | | No real code change. BUG=none TEST=none Review URL: http://codereview.chromium.org/669142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40967 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Expose storing metadata on a given entry.rvargas@google.com2010-03-021-1/+87
| | | | | | | | | | BUG=32406 TEST=unittests Review URL: http://codereview.chromium.org/660041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40400 0039d316-1c4b-4281-b951-d872f2087c98
* Add APIs to expose http cache's metadata and thervargas@google.com2010-02-231-0/+6
| | | | | | | | | | | the ability to stop caching a given request. BUG=32406, 22900 TEST=none Review URL: http://codereview.chromium.org/600167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39751 0039d316-1c4b-4281-b951-d872f2087c98
* Pulled out Callback code into base/callback.h. This is the first step ↵akalin@chromium.org2010-02-191-0/+1
| | | | | | | | | | | | | towards redoing the Callback interfaces. Added and removed includes as needed. BUG=35223 TEST=trybots Review URL: http://codereview.chromium.org/646061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39419 0039d316-1c4b-4281-b951-d872f2087c98
* Added factories for HttpAuthHandler.cbentzel@chromium.org2010-02-151-3/+5
| | | | | | | | | | | | | | | | | | | The driving rationale for this change was to prevent choosing an AuthHandler when it is not supported on the system due to a missing runtime component (such as not being able to locate a gssapi shared library when seeing a Negotiate scheme). It also has the advantage (currently unused) of determining some per-auth-scheme properties only the first time that a challenge for that scheme is seen (such as maximum token length for the SSPI implementation of NTLM). Finally, it may make unit tests easier to generate since the factory can be easily mocked. BUG=34795 TEST=New unit test for HttpAuthHandlerDispatchFactory. Review URL: http://codereview.chromium.org/582007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39065 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Remove the explicit transaction callback and let thervargas@google.com2010-02-111-30/+27
| | | | | | | | | | | cache grab it when needed. BUG=26729 TEST=none. Review URL: http://codereview.chromium.org/594041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38848 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Eliminate EntryAvailable() and make the cache uservargas@google.com2010-02-111-3/+7
| | | | | | | | | | | | | callbacks to notify the transaction about the completion of AddTransactionToEntry. BUG=26729 TEST=current tests. Review URL: http://codereview.chromium.org/593058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38808 0039d316-1c4b-4281-b951-d872f2087c98
* The great Flip -> Spdy rename.mbelshe@chromium.org2010-02-081-2/+2
| | | | | | | | | BUG=30747 TEST=none Review URL: http://codereview.chromium.org/580009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38386 0039d316-1c4b-4281-b951-d872f2087c98
* Rename all files from flip* to spdy*.mbelshe@chromium.org2010-02-061-1/+1
| | | | | | | | | | | I haven't yet renamed the classes. BUG=30747 TEST=none Review URL: http://codereview.chromium.org/582001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38315 0039d316-1c4b-4281-b951-d872f2087c98
* Pass the NetworkChangeNotifier to HostResolver.willchan@chromium.org2010-02-041-4/+8
| | | | | | | | | | | | | | | This requires the following refactors: (1) NetworkChangeNotifier moves out of HttpNetworkSession into IOThread. (2) HostResolver gets initialized with NetworkChangeNotifier. (3) NetworkChangeNotifier needs to get passed into HttpCache and HttpNetworkSession (required updating a lot of files). (4) NetworkChangeNotifier is no longer reference counted. It is owned by IOThread. (5) IOThread gains a new struct: Globals. It can only be used on the io thread. (6) ChromeURLRequestContextFactory uses IOThread::Globals to initialize ChromeURLRequest objects with the host resolver and network change notifier. BUG=26159 Review URL: http://codereview.chromium.org/552117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38052 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Fix a leak on RemovePendingCallbackFromNewEntryrvargas@google.com2010-01-141-0/+1
| | | | | | | | | | | BUG=none TEST=none TBR=eroman Review URL: http://codereview.chromium.org/548039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36222 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Use asynchronous Open/Create/Doom entry calls.rvargas@google.com2010-01-141-25/+300
| | | | | | | | | | | | | | | | 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
* Rename CloseIdleConnections -> CloseCurrentConnections.mbelshe@chromium.org2010-01-141-1/+2
| | | | | | | | | | | | | | | | | This method is (and was) just for debugging; while it was closing idle connections, that was not aggressive enough; the benchmark needs to close all connections, not just the idle ones. To ensure connections are abandoned, create a new pool; leaving the old pool to languish as any pending sockets die. BUG=none TEST=none Review URL: http://codereview.chromium.org/549031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36208 0039d316-1c4b-4281-b951-d872f2087c98
* Update CloseIdleSockets to close out FLIP connections asmbelshe@google.com2009-12-011-0/+3
| | | | | | | | | | | well as HTTP connections. This is used for benchmarking. BUG=none TEST=none Review URL: http://codereview.chromium.org/454009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33402 0039d316-1c4b-4281-b951-d872f2087c98
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-201-2/+5
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Split HttpCache::Transaction to its own setrvargas@google.com2009-11-111-1582/+1
| | | | | | | | | | | | | of files. No real code change... I'm just moving code around. BUG=26729 TEST=none Review URL: http://codereview.chromium.org/387017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31693 0039d316-1c4b-4281-b951-d872f2087c98
* Clear disk cache when the cache is not initializedhclam@chromium.org2009-11-071-18/+20
| | | | | | | | | | | | | | BUG=24765 TEST=unit test, clear browsing data and the cache, media cache will be cleared even if a media object was not loaded. Since the disk cache backend in HttpCache is lazily initialized, clearing the cache before it receives the first transaction would have no effect. So initialize the disk cache explicitly when we clear the cache. Review URL: http://codereview.chromium.org/378015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31361 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Make sure that we handle byte range requests thatrvargas@google.com2009-11-031-3/+8
| | | | | | | | | | | | end up skipping the cache. BUG=26175 TEST=unittests Review URL: http://codereview.chromium.org/348053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30877 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Always preserve extra headers when dealing withrvargas@google.com2009-11-031-1/+3
| | | | | | | | | | | byte range requests. BUG=25755 TEST=unittests Review URL: http://codereview.chromium.org/339088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30773 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Allow multiple external validation headers.rvargas@google.com2009-11-021-55/+38
| | | | | | | | | | | | If the last pair of headers match the entry that we have we allow the server response to update the entry. BUG=23222 TEST=unittests Review URL: http://codereview.chromium.org/345019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30748 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Handle byte range requests when there is no cache entry.rvargas@google.com2009-10-271-0/+3
| | | | | | | | | | BUG=25873 TEST=unittest Review URL: http://codereview.chromium.org/330026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30165 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Make sure that we remove pending transactionsrvargas@google.com2009-10-261-3/+18
| | | | | | | | | | | when they belong to a doomed entry. BUG=25588 TEST=unittests Review URL: http://codereview.chromium.org/335015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30054 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Convert data writes from sysnchronous to asynchronous.rvargas@google.com2009-10-221-30/+76
| | | | | | | | | | BUG=21383 TEST=unit tests (original review for r25873: http://codereview.chromium.org/201065) Review URL: http://codereview.chromium.org/313013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29792 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Enable byte-range support by default.rvargas@google.com2009-10-161-4/+4
| | | | | | | | | | | | | | | The command line parameter to modify the behavior changes from --enable-byte-range-support to --disable-byte-range-support BUG=24989 TEST= current tests Review URL: http://codereview.chromium.org/267132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29337 0039d316-1c4b-4281-b951-d872f2087c98
* HTTP Cache: Apply all freshness tests to Partial content entries.rvargas@google.com2009-10-161-0/+3
| | | | | | | | | BUG=24057 TEST=unittest Review URL: http://codereview.chromium.org/267122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29301 0039d316-1c4b-4281-b951-d872f2087c98
* Convert the HTTP cache to use FilePath rather than wstring for thetony@chromium.org2009-10-151-6/+5
| | | | | | | | | | disk cache path. BUG=24672 Review URL: http://codereview.chromium.org/276048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29213 0039d316-1c4b-4281-b951-d872f2087c98
* Final patch to convert disk cache to using FilePath instead oftony@chromium.org2009-10-151-2/+3
| | | | | | | | | | | 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
* Disk cache: Add a method to cancel pending sparse operations.rvargas@google.com2009-10-081-4/+36
| | | | | | | | | | | | | | | | | | | The sparse IO methods require exclusive use of the cache entry and they complain when that requirement is violated. When the user cancels a request and reissues another one to the same entry, we may be waiting for the previous operation to finish when we receive a new IO request, so we fail. This CL add a way for the HTTP cache to cancel IO operations and get a notification when the disk cache is able to operate on that entry again. BUG=23862 TEST=unittests Review URL: http://codereview.chromium.org/256090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28475 0039d316-1c4b-4281-b951-d872f2087c98
* Make HttpResponseInfo pickle'able, just moves some code from HttpCache to ↵michaeln@google.com2009-10-081-123/+3
| | | | | | | | | | | HttpResponseInfo. TEST=none BUG=none Review URL: http://codereview.chromium.org/269012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28363 0039d316-1c4b-4281-b951-d872f2087c98
* Initial CL for fixing some of the proxy auth issues.chron@chromium.org2009-10-061-0/+6
| | | | | | | | | | | | | | Auth_cache is contained in the http session. We need to share the http session with the parent profile request context in order to retain http authentication. Weirdly enough, Profile::GetDefaultRequestContext() is not the same as profile_->GetRequestContext(), It does NOT yet pop up a dialog if the user hasn't done so already. BUG=19581 TEST=Included. Review URL: http://codereview.chromium.org/241001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28086 0039d316-1c4b-4281-b951-d872f2087c98
* Handle range request on a truncated entryhclam@chromium.org2009-10-021-0/+2
| | | | | | | | | | This change will doom the truncated entry and creates a new sparse entry. TEST=unit tests Review URL: http://codereview.chromium.org/251067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27859 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ScopedRunnableMethodFactory using WeakPtr.darin@chromium.org2009-09-251-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This required some changes to WeakPtr to support the addition of WeakPtrFactory::HasWeakPtrs(), which is used to implement ScopedRunnableMethodFactory::empty(). Now, the WeakReferenceOwner just holds a pointer to the Flag class, and the Flag holds a back-pointer that it can use to clear the WeakReferenceOwner's pointer when the Flag is destroyed. I use the null'ness of this back-pointer in place of the bool member that was previously used to indicate if the WeakReference is valid. It was also necessary to expose a HasOneRef method on RefCounted. I included one on RefCountedThreadSafe for completeness. Finally, I switched HttpCache over to using WeakPtr instead of RevocableStore so that I could delete RevocableStore. (I'm making this change to consolidate similar functionality.) R=abarth BUG=none TEST=none Review URL: http://codereview.chromium.org/235027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27287 0039d316-1c4b-4281-b951-d872f2087c98
* Replace some net::ERR_FAILED generic error codes with more specific codes.eroman@chromium.org2009-09-241-6/+8
| | | | | | | | | | The goal is to end up with more meaningful errors if a page fails to load. BUG=22623 Review URL: http://codereview.chromium.org/222009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27038 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 25873.eroman@chromium.org2009-09-221-73/+31
| | | | | | | | | | | This appears to be responsible for a regression in downloading of files. BUG=http://crbug.com/406 TBR=darin Review URL: http://codereview.chromium.org/215035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26764 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Convert data writes from sysnchronous to asynchronous.rvargas@google.com2009-09-101-31/+73
| | | | | | | | | | BUG=21383 TEST=covered by current unit tests. Review URL: http://codereview.chromium.org/201065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25873 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Don't delete sparse entries when wervargas@google.com2009-09-091-11/+18
| | | | | | | | | | | cancel the request. BUG=20930 TEST=unittests Review URL: http://codereview.chromium.org/193043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25736 0039d316-1c4b-4281-b951-d872f2087c98
* Add some trace-points to HttpCache for request profiling (cache entry ↵eroman@chromium.org2009-09-061-3/+15
| | | | | | | | | | | "open", "create", "waiting" and "read_info"). BUG=http://crbug.com/14478 TEST=HttpCache unittests. Review URL: http://codereview.chromium.org/201035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25583 0039d316-1c4b-4281-b951-d872f2087c98
* Bug fixing for range request support in HttpCachehclam@chromium.org2009-09-051-1/+0
| | | | | | | | | | | | | | | | | | | TEST=net_unittests --gtest_filter=HttpCache.GET_Previous206_NotModified Step to reproduce the failure: 1. Sparse cache has data for (0 - 9) 2. Make a non-range request for the resource 3. Server replies with 304 not modified 4. User would get 304 modified while 200 is expected The cause is that PartialData::ResponseHeadersOK requires a full specified range to accept the response when server replies with 304. This is not a valid assumption as the response of 304 can be caused by the cache submitting a range request for validation purpose. Review URL: http://codereview.chromium.org/198018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25569 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: Add support for resuming downloading arvargas@google.com2009-09-041-29/+75
| | | | | | | | | | | | resource after the original request was interrupted. BUG=8995 TEST=unittests Review URL: http://codereview.chromium.org/197016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25551 0039d316-1c4b-4281-b951-d872f2087c98
* Update the request time of http cache entries on 304.eroman@chromium.org2009-09-041-0/+1
| | | | | | | | | BUG=http://crbug.com/20594 TEST=HttpCache.UpdatesRequestResponseTimeOn304 Review URL: http://codereview.chromium.org/199028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25541 0039d316-1c4b-4281-b951-d872f2087c98
* Update the response time of http cache entries on 304.eroman@chromium.org2009-09-041-0/+2
| | | | | | | | | BUG=http://crbug.com/20594 TEST=HttpCacheTest.UpdatesResponseTimeOn304 Review URL: http://codereview.chromium.org/197024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25484 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: reorder some functions. No code change.rvargas@google.com2009-09-011-77/+74
| | | | | | | | | | | | | I'm just making the order of the methods match the order of declaration again. BUG=nonde TEST=none Review URL: http://codereview.chromium.org/175042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25062 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Cleanup from tracking of bug 9952.rvargas@google.com2009-09-011-67/+12
| | | | | | | | | BUG=9952 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24992 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Bypass the cache for range requests that have validation headers.rvargas@google.com2009-08-281-0/+8
| | | | | | | | | BUG=20017 TEST=unittests Review URL: http://codereview.chromium.org/177016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24759 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor function to unpack an Entry from its pickle to a HttpResponseInfo.mbelshe@google.com2009-08-251-12/+18
| | | | | | | | | | | This will be used for some dump_cache modifications which are coming. BUG=none TEST=none Review URL: http://codereview.chromium.org/174388 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24319 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Enable experimental support for byte range requests.rvargas@google.com2009-08-241-24/+21
| | | | | | | | | | | Requires --enable-byte-range-support BUG=12258 TEST=covered by unit tests. Review URL: http://codereview.chromium.org/173231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24113 0039d316-1c4b-4281-b951-d872f2087c98
* Revert cl 24015rvargas@google.com2009-08-211-20/+24
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/174260 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24026 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Enable experimental support for byte range requests.rvargas@google.com2009-08-211-24/+20
| | | | | | | | | | | Requires --enable-byte-range-support BUG=12258 TEST=covered by unit tests. Review URL: http://codereview.chromium.org/173173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24015 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Fix the code that handles 206s when revalidatingrvargas@google.com2009-08-201-18/+46
| | | | | | | | | | | a range from the cache. BUG=12258 TEST=unittests Review URL: http://codereview.chromium.org/174039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23881 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing break statement.jhawkins@chromium.org2009-08-191-3/+5
| | | | | | | | | CID=5724 BUG=none TEST=none Review URL: http://codereview.chromium.org/173078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23766 0039d316-1c4b-4281-b951-d872f2087c98