summaryrefslogtreecommitdiffstats
path: root/net/base/sdch_manager.h
Commit message (Collapse)AuthorAgeFilesLines
* linux: build with -Wextraevan@chromium.org2010-02-051-2/+2
| | | | | | | | | | | | 95% of this is removing "const" from return types, but turning this on found one bug! (A "for" loop that expected its iterator to go negative but which was using an unsigned type.) BUG=34160 Review URL: http://codereview.chromium.org/570012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38266 0039d316-1c4b-4281-b951-d872f2087c98
* Add metarefresh for SDCH in yet another case.jar@chromium.org2010-01-041-1/+1
| | | | | | | | | | | | | I had historically hit meta-refresh loops, and the code appeared to be too careful to avoid such a loop. This change avoids the infinite loop, and does at least an SDCH backoff of support when an infinite loop might otherwise be induced. BUG=31271 r=kmixter Review URL: http://codereview.chromium.org/518029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35461 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid meta-refresh when back-button gets non-sdch contentjar@chromium.org2009-12-281-0/+4
| | | | | | | | | | | | | | | | | | The first page search from google will not be SDCH encoded, but will trigger a background download of a dictionary for future use. ..but.. IF the user navigates forward from the search page, and then back, then Chromium will fetch the content from cache after specifying in the URL that a dictionary is now available. This new logic detects such a situation where non-SDCH content is pulled from the cache, and avoids the (slower and overly conservative) meta-refresh. test=see bug for repro cases. Check about:histogram/SDCH for error codes. bug=20457 r=kmixter Review URL: http://codereview.chromium.org/518016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35318 0039d316-1c4b-4281-b951-d872f2087c98
* Second patch in making destructors of refcounted objects private.jam@chromium.org2009-11-051-0/+2
| | | | | | | | BUG=26749 Review URL: http://codereview.chromium.org/368001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some coverity warnings in src/net.willchan@chromium.org2009-07-101-4/+4
| | | | | | Review URL: http://codereview.chromium.org/155315 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20352 0039d316-1c4b-4281-b951-d872f2087c98
* Handle proxy corruption including nesting of compressino algorithmsjar@chromium.org2009-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vodaphone (UK) Mobile Broadband appears to be providing an extra level of gzip compression, at the same time as it discards the content encoding "sdch,gzip" and replaces it with "gzip." The previous approach for handling a missing "sdch" content encoding statement from a server that *probably* was trying to send encoded content, was to replace the (probably) garbage content encoding with tentative decodings for both gzip and sdch. That approach was not sufficient for the resulting double-gzip encoding that Vodaphone provided :-(. This fix leaves the existing content encodings (such as Vodaphone's solo "gzip"), and adds the tentative decodings (gzip plus sdch). Hence we translate received content encodings (when we know we requested an SDCH response by including an applicable dictionary) as follows: "sdch,gzip" unchanged. This is perfect. "" ==> "Tent_sdch, Tent_gzip" "gzip" ==> "Tent_sdch, Test_gzip, gzip" Note that the TENTATIVE_gzip is a sniffing gzip, that can turn into an identity (no-op) filter if it can't find a gzip header. By continuing to use a tentative SDCH, it is possible for the SDCH filter to make error recovery decision, and to record stats on this case. In addition, I've changed the error recovery approach in the SDCH filter to be ultra conservative. If there is ANY unrecoverable error in a response to an SDCH request, then we will blacklist the host of the URL. Recoverable errors are where the SDCH is fully functional, and decodes its data using the dictionary. The test cases added focus on the double gzip cases, as observed in Vodaphone (UK) Mobile Broadband. BUG=13606 r=huanr Review URL: http://codereview.chromium.org/140037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18936 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent SDCH from re-trying to download a dicitionaryjar@chromium.org2009-06-051-0/+1
| | | | | | | | | | | | | Some dicitoaries provided by an SDCH server may be larger than allowed by Chromium (which holds the dictionary memory-resident). This CL prevents Chromium from endlessly re-trying such dicitonary loads, BUG=7722 r=huanr Review URL: http://codereview.chromium.org/119198 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17699 0039d316-1c4b-4281-b951-d872f2087c98
* Adjust histograms to only collect non-cache stats for SDCH.jar@chromium.org2009-05-151-0/+1
| | | | | | | | | | | | | | | | I also changed the name of all the SDCH histograms so that there would be no confusion about the data. I also added one new problem code, but that recordation doesn't have any semantic impact. I added it to help make it easier to diagnose dictionary specification errors in SDCH. bug=12012 R=wtc Review URL: http://codereview.chromium.org/115377 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16138 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that IO thread is not called in last actions by SDCH shutdownjar@chromium.org2009-05-131-0/+3
| | | | | | | | | | | | | Unregister the sdch_dictionary_fetcher so that it destroys any pending URLFetcher instances when we are nearing shutdown time. Dictionaries are only *potentially* useful (and not needed) for future SDCH fetches, so abandoning any pending items is safe and harmless. b=9669 r=wtc Review URL: http://codereview.chromium.org/113235 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16015 0039d316-1c4b-4281-b951-d872f2087c98
* Hand craft an A/B test of SDCH compressionjar@chromium.org2009-04-301-8/+24
| | | | | | | | | | | | | | | After we're sure we can do SDCH compression to a given URL, toss a 50-50 coin each time we have a chance to advertise SDCH, and either completely avoid advertisement, or advertise (including the dictionary). Histogram both compression download times, as well as the download times for the "completely avoid" case. http://crbug.com/11236 bug=11236 r=wtc,openvcdiff Review URL: http://codereview.chromium.org/100004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15010 0039d316-1c4b-4281-b951-d872f2087c98
* Correct SDCH enforcement of PathMatch for dictionariesjar@chromium.org2009-04-201-1/+2
| | | | | | | r=openvcdiff Review URL: http://codereview.chromium.org/67286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14041 0039d316-1c4b-4281-b951-d872f2087c98
* wtc: please look at URL related code, and hooks and nitsjar@chromium.org2009-03-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | you might have commented on before. huanr: please look at sdch_filter code. The intent was no semantic change, and only change in histograms and stats gathered. I wanted to be sure I had better stats on several failure cases, as the turn-around time of adding stats to instrument such cases after they surface is just too long. The big feature is the mechanism for getting the total number of bytes passed to a filter. We use the filter context to achieve this, and then the SDCH filter can calculate compression ratio (from pre-gunzip vs post SDCH decompress). The number of bytes read was also histogrammed in a number of error scenarios, to better diagnose what is going on when these cases arrise (example: When some data is still buffered in the VCDIFF decoder). The sdch_filter destructor was getting long and hard to read with multiple if blocks, so I cleaned that up as well a bit (less indentation, and use of early returns). Nits not included in previous CL that earlier are listed as well. r=wtc,huanr Review URL: http://codereview.chromium.org/40319 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11665 0039d316-1c4b-4281-b951-d872f2087c98
* Distinguish a few more SDCH cases via problem codesjar@chromium.org2009-02-271-0/+8
| | | | | | | r=huanr Review URL: http://codereview.chromium.org/27284 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10649 0039d316-1c4b-4281-b951-d872f2087c98
* Correct enums in SDCH problem codesjar@chromium.org2009-02-251-4/+6
| | | | | | | r=huanr Review URL: http://codereview.chromium.org/28123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10350 0039d316-1c4b-4281-b951-d872f2087c98
* Provide error reporting and recovery for SDCH responses not market as HTMLjar@chromium.org2009-02-211-0/+4
| | | | | | | | | | | | | | | | | | | Some AV software may actually strip content type as well as content encoding. As a result, when we propose a dicitonary (suggesting that this will probably be an SDCH encoded response) we need to be ready to "fix" the content-encoding string if it is not marked as gzip,sdch. Note that "fixups" put in tentative decodes, which degrade to pass-through filters if the content's header is not compatible with the decoding format. I also added a line of defensive coding in the dictionary fetcher, and cleaned up a line where I record stats after decoding sdch. bug=7679 r=openvcdiff,huanr Review URL: http://codereview.chromium.org/27016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10143 0039d316-1c4b-4281-b951-d872f2087c98
* Improve modularity of recent SDCH dictionary load checkinjar@chromium.org2009-02-171-1/+1
| | | | | | | | | | | I felt guilty that I allowed url_request_job to have some logic in it about whether it can load an SDCH dictinary or not. This patch pushed the logic back into sdch_manager (where it belongs). r=wtc Review URL: http://codereview.chromium.org/20379 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9897 0039d316-1c4b-4281-b951-d872f2087c98
* Fetch SDCH dictionary as soon as current URL fetch completesjar@chromium.org2009-02-111-4/+4
| | | | | | | | | | | | | Rather than just waiting for 15 seconds, this patch fetches the "suggested dicitionary" as soon as the current download completes. This avoids stealing bandwidth from the original download, but works as quickly as possible to get the dictionary, so that the user can receive compression results asap. r=wtc Review URL: http://codereview.chromium.org/20254 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9597 0039d316-1c4b-4281-b951-d872f2087c98
* Add to SDCH histogrammingjar@chromium.org2009-02-021-1/+2
| | | | | | | | | | | | | | | | Define a histogram macro that is customizable, and precise, for detailed examination of performance when needed. Provide graceful degradation when entire SDCH window is not received. We now blacklist the site with an exponential back-off. This allows teh user to hit reload, and get not-SDCH content. bug=1609306 r=huanr,mbelshe Review URL: http://codereview.chromium.org/19718 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9035 0039d316-1c4b-4281-b951-d872f2087c98
* Adjust SDCH problem code histogram.jar@chromium.org2009-01-271-3/+7
| | | | | | | | | | | | Tentative SDCH was not properly noted, and this caused some confusion in the SDCH problem codes. I corrected the assertion of a tentative sdch, and renumbered (to new numbers) all problem codes that might have been varied. r=huanr Review URL: http://codereview.chromium.org/18780 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8698 0039d316-1c4b-4281-b951-d872f2087c98
* Improve SDCH stability stats and error recoveryjar@chromium.org2009-01-201-21/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL provides an exponential back-off (within a run of chromium) for recovery to a decoding error, rather than an full disable of SDCH when a (minor) error appears. This will help to recover from the common (implementation) problem where a user has an SDCH encoded page as a startup tab, but doesn't still have the requisite dictionary from the previous run. The exponential backoff is not "time based," but instead counts down the number of times a tentatively blacklisted domain is accessed. I now detect the use of the browser cache in an SDCH decode, and use that to better identify if external proxies have corrupted the process, vs internal use of cache (such as at startup) has caused a "dictionary not found" error to emerge. r=openvcdiff,huanr Review URL: http://codereview.chromium.org/18355 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8290 0039d316-1c4b-4281-b951-d872f2087c98
* Correct typo in SDCH problem logging code.jar@google.com2008-12-171-1/+2
| | | | | | | r=openvcdiff,huanr Review URL: http://codereview.chromium.org/14802 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7162 0039d316-1c4b-4281-b951-d872f2087c98
* Add instrumentation to and tighten SDCH implementationjar@google.com2008-12-021-0/+5
| | | | | | | r=huanr,kmixter,openvcdiff Review URL: http://codereview.chromium.org/12699 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6193 0039d316-1c4b-4281-b951-d872f2087c98
* Adjust histograms to get better data for latency experimentsjar@google.com2008-11-221-20/+28
| | | | | | | r=openvcdiff,huanr Review URL: http://codereview.chromium.org/11810 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5891 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid plausible DOS attack by malicious SDCH serverjar@google.com2008-11-181-0/+17
| | | | | | | | | | | | | | | Restrict SDCH to ONLY work with HTTP (fail safe security policy for this experimental protocol). Also add a histogram to see how often we encounter dictionary corruption (which will evidence itself by having a multitude of dicitionaries adverttised, with no real use server side). r=ajenjo,kmixter Review URL: http://codereview.chromium.org/11209 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5628 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-2/+2
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up filter and content encoding handling jar@google.com2008-10-271-3/+2
| | | | | | | | | | | | | | | | Centralize translation functions (text of "Content-Encoding" to enum) in filter.cc Centralize error recovery (for damaged content encoding headers) in filter.cc Error recovery includes a loss of SDCH encoding headers, plus handling of Apache server bug with gzip files are tagged as also being gzip encoded. Centralize and add a pile of unit tests to this filter code. r=openvcdiff,huanr Review URL: http://codereview.chromium.org/8018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4004 0039d316-1c4b-4281-b951-d872f2087c98
* Add a lot of robustness to SDCH filter decodingjar@google.com2008-10-151-7/+67
| | | | | | | | | | | | | | | | | | | | | | a) Do meta-refresh (and partially disable sdch) when we have an sdch decode error early on (due to lack of dictionary). b) Gracefully handle proxy removal of "gzip" in "content-encoding: sdch,gzip". c) Recover from completely stripped content encoding (in response to a request for which we advertised an SDCH dictionary) by using a filter that can optionally decode sdch with an optional gzip as well. Some field tests have shown problems with this protocol's transit across the ether. The general approach we've adopted is to stop using SDCH on the problematic site when we have problems. This will prevent a malicious site from shutting down all use of SDCH. r=kmixter,openvcdiff,huanr Review URL: http://codereview.chromium.org/6433 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3420 0039d316-1c4b-4281-b951-d872f2087c98
* Unrollback 3024 (partially rolled back in 3027).ericroman@google.com2008-10-081-3/+0
| | | | | | | | It is fixed in mac build now -- problem was bad format string to StringPrintf, where passed string instead of char*. Review URL: http://codereview.chromium.org/6359 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3064 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 3024, broke mac build.maruel@google.com2008-10-081-0/+3
| | | | | | Review URL: http://codereview.chromium.org/6351 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3027 0039d316-1c4b-4281-b951-d872f2087c98
* Pull in new googleurl@94 which includes GURL::EffectiveIntPort().ericroman@google.com2008-10-081-3/+0
| | | | | | | | Update callers to use this method. Review URL: http://codereview.chromium.org/5641 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3024 0039d316-1c4b-4281-b951-d872f2087c98
* Correct typo with containing extra declarations in headerjar@google.com2008-09-231-8/+7
| | | | | | | r=pinkerton Review URL: http://codereview.chromium.org/4045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2496 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land SDCH filter support experimentjar@google.com2008-09-231-0/+202
| | | | | | | | | | | Fix up solution files for webkit and net Add one line keyword change to help linux build r=hunanr,openvcdiff,nsylvain Review URL: http://codereview.chromium.org/4026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2469 0039d316-1c4b-4281-b951-d872f2087c98
* Rollback 2444 and 2443 to get linux and mac prepjar@google.com2008-09-221-202/+0
| | | | | | | | | Also need to augment sln dependencies tbr Review URL: http://codereview.chromium.org/3188 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2446 0039d316-1c4b-4281-b951-d872f2087c98
* Experimental integration of delta compression content encodingjar@google.com2008-09-221-0/+202
The command line option "sdch-enable" enables support of sdch and automtic lazy download of dictionaries. Optionally it can select a singular domain to work from. By default, all domains are enabled when the flag is used. "-sdch-enable=".google.com" Enables it only for Google. When the switch is not set on the command line, all this code is completely disabled. Still TBD: a) Finish implementation of security details (much of it is in place) b) Add tests for security details. r=huanr,ajenjo,kmixter Review URL: http://codereview.chromium.org/461 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2443 0039d316-1c4b-4281-b951-d872f2087c98