summaryrefslogtreecommitdiffstats
path: root/net/http/http_server_properties_manager_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* [AltSvc] Save expiration as int64 string instead of double.bnc2015-08-131-12/+105
| | | | | | | | | | | | | | | | | | | | | | Save alternative service expiration times as int64 in a string instead of double in HttpServerPropertiesManager::SaveAlternativeServiceToServerPrefs(), and load expiration time accordingly in HttpServerPropertiesManager::ParseAlternativeServiceDict(). The reason is that numeric_limits<int64>::max() can be serialized in JSON, whereas numeric_limits<double>::max() cannot. That is, this change allows base::Time::Max() expiration times. Note that JSON does not support int64, so it has to be converted into a string. This change might result in unexpected behavior on user installations where alternative services were persisted to disk as double with earlier versions. However, as https://crrev.com/1227063002 has not even made it to Beta yet, this can be safely ignored. BUG=516034 Review URL: https://codereview.chromium.org/1275663002 Cr-Commit-Position: refs/heads/master@{#343209}
* Add expiration to AlternativeServiceInfo.bnc2015-07-281-22/+28
| | | | | | | | | | | | | In order to properly implement the max-age parameter of alternative services, * add expiration to AlternativeServiceInfo; * lazy delete expired alternative services in GetAlternativeServices; * save/load expiration time in HttpServerPropertiesManager. BUG=392576 Review URL: https://codereview.chromium.org/1227063002 Cr-Commit-Position: refs/heads/master@{#340683}
* Do not return alternative services equivalent to the origin in ↵bnc2015-07-231-3/+3
| | | | | | | | | | | | GetAlternativeServices(). If there is an alternative service equivalent to the origin (same host, same port, both TCP), this should not be returned by GetAlternativeServices(), because there is always an HttpStreamFactoryImpl::Job launched for the origin. BUG=392576 Review URL: https://codereview.chromium.org/1224303002 Cr-Commit-Position: refs/heads/master@{#340065}
* Stop using SPDY/3 in tests.bnc2015-07-201-4/+4
| | | | | | | | | | | | SPDY/3 is deprecated and will gradually be removed from the codebase. This CL removes all remaining occurrences of "npn-spdy/3" protocol string and NPN_SPDY_3 enum AlternateProtocol value from unittests. BUG=431299 Review URL: https://codereview.chromium.org/1225263003 Cr-Commit-Position: refs/heads/master@{#339431}
* s/NPN_SPDY_4/NPN_HTTP_2/gbnc2015-07-081-9/+9
| | | | | | | | BUG=419722 Review URL: https://codereview.chromium.org/1211253012 Cr-Commit-Position: refs/heads/master@{#337907}
* Implement multiple alternative services per origin.bnc2015-07-081-46/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | HttpServerProperties: * Introduce AlternativeServiceVector and AlternativeServiceInfoVector. * Change AlternativeServiceMap typedef. HttpServerPropertiesImpl: * Add bool SetAlternativeServices. * Change SetAlternativeService return type to bool. * Replace GetAlternativeService with GetAlternativeServices. * Replace ClearAlternativeService with ClearAlternativeServices. HttpServerPropertiesManager: * Implement saving and loading preferences to support multiple alternative services per origin. HttpStreamFactory and QuicStreamFactory: * Use first alternative service for now; more work to be done here. Also update misc clients and add and update unittests. BUG=392575 Review URL: https://codereview.chromium.org/1216703002 Cr-Commit-Position: refs/heads/master@{#337772}
* net: Remove use of MessageLoopProxy and deprecated MessageLoop APIsskyostil2015-06-111-3/+4
| | | | | | | | | | This patch was mostly autogenerated with https://codereview.chromium.org/1010073002/. BUG=465354 Review URL: https://codereview.chromium.org/1170183002 Cr-Commit-Position: refs/heads/master@{#333929}
* HttpServerProperties - Don't persist if SetSupportsQuic is called withrtenneti2015-06-101-0/+2
| | | | | | | | | | | the same data more than once. BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1160823007 Cr-Commit-Position: refs/heads/master@{#333651}
* HttpServerProperties - Don't persist if SetServerNetworkStats is calledrtenneti2015-06-051-0/+2
| | | | | | | | | | | | | | | with the same origin (HostPortPair) and value (ServerNetworkStats). This change reduces the number of times SetServerNetworkStats tries to persist HttpServerProperties to disk (currently 17% of persist calls are due to SetServerNetworkStats). BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1158823005 Cr-Commit-Position: refs/heads/master@{#333173}
* HttpServerProperties - Don't persist if ConfirmAlternativeService isrtenneti2015-06-051-0/+46
| | | | | | | | | | | | | | | | | called with the same origin (HostPortPair) more than once and if we didn't change anything in broken_alternative_services_ (in other words the return value of IsAlternativeServiceBroken hasn't changed). This change reduces the number of times ConfirmAlternativeService tries to persist HttpServerProperties to disk (currently ~17% of persist calls are due to ConfirmAlternativeService). BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1142413004 Cr-Commit-Position: refs/heads/master@{#333169}
* HttpServerProperties - Don't persist if ClearAlternativeService isrtenneti2015-06-051-0/+21
| | | | | | | | | | | | | | | called with the same origin (HostPortPair) and nothing was deleted. This change reduces the number of times ClearAlternativeService tries to persist HttpServerProperties to disk (currently ~11% of persist calls are due to ClearAlternativeService). BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1156513004 Cr-Commit-Position: refs/heads/master@{#333147}
* HttpServerProperties - Don't persist if SetSupportsSpdy is called withrtenneti2015-06-051-0/+2
| | | | | | | | | | | | | | | the same origin (HostPortPair) and value (supports_spdy). This change reduces the number of times SetSupportsSpdy tries to persist HttpServerProperties to disk (currently ~5% of persist calls are due to SetSupportsSpdy). BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1159853005 Cr-Commit-Position: refs/heads/master@{#333146}
* HttpServerProperties - Don't persist if SetAlternativeService is calledrtenneti2015-06-041-1/+36
| | | | | | | | | | | | | | | with the same origin (HostPortPair) and value (AlternativeServiceInfo). This change reduces the number of times SetAlternativeService tries to persist HttpServerProperties to disk (currently 40% of persist calls are due to SetAlternativeService). BUG=451256 R=rch@chromium.org Review URL: https://codereview.chromium.org/1156053004 Cr-Commit-Position: refs/heads/master@{#332755}
* Stop including ip_address_number.h from net_util.heroman2015-06-031-0/+1
| | | | | | | | | | | Required duplicating the typedef for IPAddressNumber, and fixing a number of missing includes from consumers. BUG=488531 TBR=jam@chromium.org,rpaquay@chromium.org,keybuk@chromium.org, Review URL: https://codereview.chromium.org/1162973005 Cr-Commit-Position: refs/heads/master@{#332708}
* Convert JsonWriter::Write to taking a const ref for the in-paramestade2015-05-161-1/+1
| | | | | | | | | | | | Clearer API; flushes out a lot of unnecessary heap allocations. depends on https://codereview.chromium.org/1129083003/ BUG=none Review URL: https://codereview.chromium.org/1131113004 Cr-Commit-Position: refs/heads/master@{#330255}
* HttpServerProperties - Track UpdatePrefs callers. In offical builds, onrtenneti2015-05-121-0/+6
| | | | | | | | | | | | Mac we had noticed UpdatePrefs is being called a lot. Would like to track the caller (we think it could be extensions). BUG=485314, 451256, 431476 R=mmenke@chromium.org, asvitkine@chromium.org Review URL: https://codereview.chromium.org/1139843002 Cr-Commit-Position: refs/heads/master@{#329452}
* Update {virtual,override} to follow C++11 style in net.nick2015-04-231-5/+3
| | | | | | | | | | | | The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override. This patch was manually generated using a regex and a text editor. BUG=417463 Review URL: https://codereview.chromium.org/1088903008 Cr-Commit-Position: refs/heads/master@{#326489}
* s/NPN_SPDY_3/NPN_SPDY_4/g in tests.bnc2015-04-031-9/+9
| | | | | | | | | | | | | Since SPDY/3 is deprecated, replace it with HTTP/2 (also known as SPDY/4 internally) in tests. This is not critical as they are the negotiated protocols are not actually used in the tests affected by this CL, but it is a prerequisite to removing NPN_SPDY_3 enum value from the codebase. BUG=428086 Review URL: https://codereview.chromium.org/1059243003 Cr-Commit-Position: refs/heads/master@{#323759}
* Introduce AlternativeServiceInfo.bnc2015-03-311-60/+61
| | | | | | | | | | | | | | | | | | * Introduce AlternativeServiceInfo and use it instead of AlternateProtocolInfo in HttpServerPropertiesImpl. * Change language in method and variable names and comments to consistently talk about alternative service instead of alternate protocol (except for threshold related occurrences). * Update HttpServerPropertiesManager to save by key "alternative_service" instead of "alternate_protocol", while still being able to read old preferences. * Add TODO(bnc) at a couple of places. BUG=392575 Review URL: https://codereview.chromium.org/1043973002 Cr-Commit-Position: refs/heads/master@{#322968}
* Update HttpServerProperties::*AlternateProtocol* interface.bnc2015-03-201-11/+15
| | | | | | | | | | | | | | | | | | | | | | | * Rename SetAlternateProtocol, WasAlternateProtocolRecentlyBroken, ConfirmAlternateProtocol, ClearAlternateProtocol methods to *AlternativeService*. * Rename SetBrokenAlternateProtocol to MarkAlternativeServiceBroken. * Make MarkAlternativeServiceBroken, WasAlternativeServiceRecentlyBroken, and ConfirmAlternativeService take |alternative_service| instead of |origin|. * Make SetAlternativeService take |alternative_service| instead of separate |protocol|, |port| arguments. |alternative_service.host| is currently ignored. This CL does not rename SetAlternateProtocolProbabilityThreshold and GetAlternateProtocolProbabilityThreshold methods or alternate_protocol_probability_threshold_ members, that will come later. TBR=pauljensen@chromium.org BUG=392576 Review URL: https://codereview.chromium.org/1018943002 Cr-Commit-Position: refs/heads/master@{#321622}
* Make GetAlternateProtocol return AlternativeService.bnc2015-03-171-25/+24
| | | | | | | | | | | | | | Make HttpServerProperties::GetAlternateProtocol return AlternativeService, and rename it to GetAlternativeService. Rename its parameter, as well as parameters of other alternate protocol or alternative service related functions, from server to origin. Update all clients of GetAlternateProtocol. Also rename anonymous namespace HasAlternateProtocol to HasAlternativeService in tests. BUG=392576 Review URL: https://codereview.chromium.org/1017453008 Cr-Commit-Position: refs/heads/master@{#320980}
* Add HttpServerPropertiesManagerTest.UpdateCacheWithPrefs.bnc2015-02-051-0/+59
| | | | | | | | | | | | Add HttpServerPropertiesManagerTest.UpdateCacheWithPrefs to test that preferences like AlternateProtocol, SupportsQuic, and ServerNetworkStats are saved to PrefService properly. BUG=392575 Review URL: https://codereview.chromium.org/893403005 Cr-Commit-Position: refs/heads/master@{#314822}
* Make HttpServerProperties::GetSupportsQuic not host-specific.rch2015-02-041-58/+35
| | | | | | Review URL: https://codereview.chromium.org/892203004 Cr-Commit-Position: refs/heads/master@{#314671}
* Remove HasAlternateProtocol().bnc2015-02-031-20/+18
| | | | | | | | | | | | | | If GetAlternateProtocol() is called but there is no alternate protocol, it now returns one with UNINITIALIZED_ALTERNATE_PROTOCOL. See https://crrev.com/665083009 for the context of this change and how draft future changes might rely on this CL. BUG=392575 Review URL: https://codereview.chromium.org/874603004 Cr-Commit-Position: refs/heads/master@{#314428}
* Fix bug where requests to QUIC servers were throttled by the resource scheduler.rch2015-01-301-8/+13
| | | | | | Review URL: https://codereview.chromium.org/893693002 Cr-Commit-Position: refs/heads/master@{#314032}
* Lint.bnc2015-01-301-10/+9
| | | | | | | | | | | | | | | | | Driveby lint while working on https://crrev.com/665083009. * Remove redundant net:: namespace qualifiers. * Remove one redundant line. * Change probability literals from int to float. * Fix typos in comments. * Add https to one link in a comment. * git cl format to fix one indent and to reduce number of lines. BUG=392575 Review URL: https://codereview.chromium.org/882973006 Cr-Commit-Position: refs/heads/master@{#313971}
* QUIC - Persist MRU 200 server's srtt (smoothed_rtt) of ServerNetworkStatsrtenneti2015-01-061-81/+133
| | | | | | | | | | | | | | | | | | to disk. + Converted ServerNetworkStatsMap to MRUCache. + Renamed "NetworkStats" to "ServerNetworkStats" and made it a top level struct. + Didn't persist QuicBandwidth (bandwidth_estimate) because it is not being used + Deleted unnecessary net:: prefixes. + Ran "git cl format net". R=rch@chromium.org Review URL: https://codereview.chromium.org/826543002 Cr-Commit-Position: refs/heads/master@{#310005}
* QUIC - fix reading of "supports_quic" server property from prefs file ifrtenneti2015-01-051-0/+65
| | | | | | | | | | | prefs file has 200 AlternateProtocol servers. BUG=444956 R=rch@chromium.org Review URL: https://codereview.chromium.org/819223003 Cr-Commit-Position: refs/heads/master@{#309934}
* Make HttpServerPropertiesManager's port checking more robust.mmenke2014-11-181-0/+89
| | | | | | | | | | | If we're going to handle corruption, bad port checking should be correct. BUG=433895 Review URL: https://codereview.chromium.org/739633003 Cr-Commit-Position: refs/heads/master@{#304655}
* Standardize usage of virtual/override/final specifiers.dcheng2014-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Google C++ style guide states: Explicitly annotate overrides of virtual functions or virtual destructors with an override or (less frequently) final specifier. Older (pre-C++11) code will use the virtual keyword as an inferior alternative annotation. For clarity, use exactly one of override, final, or virtual when declaring an override. To better conform to these guidelines, the following constructs have been rewritten: - if a base class has a virtual destructor, then: virtual ~Foo(); -> ~Foo() override; - virtual void Foo() override; -> void Foo() override; - virtual void Foo() override final; -> void Foo() final; This patch was automatically generated. The clang plugin can generate fixit hints, which are suggested edits when it is 100% sure it knows how to fix a problem. The hints from the clang plugin were applied to the source tree using the tool in https://codereview.chromium.org/598073004. BUG=417463 R=pauljensen@chromium.org Review URL: https://codereview.chromium.org/663043004 Cr-Commit-Position: refs/heads/master@{#301452}
* QUIC - Always pesist 1000 MRU alternate protocols to preferences file.rtenneti2014-10-241-2/+1
| | | | | | | | | | | | | | | | | Deleted the experiment to load either 200 or 1000 servers from disk. + Obsoleted the following histograms ++ Net.AlternateProtocolUsage.200Truncated ++ Net.AlternateProtocolUsage.1000Truncated Reverted the changes related to the above from the following CL: https://codereview.chromium.org/298683010/ R=jar@chromium.org, rch@chromium.org Review URL: https://codereview.chromium.org/675783005 Cr-Commit-Position: refs/heads/master@{#301070}
* replace OVERRIDE and FINAL with override and final in net/mostynb2014-10-091-4/+4
| | | | | | | | BUG=417463 Review URL: https://codereview.chromium.org/623213004 Cr-Commit-Position: refs/heads/master@{#298844}
* QUIC - Code to persist if we had talked QUIC to a server and if so whatrtenneti2014-09-251-3/+57
| | | | | | | | | | | | | is the address. This code is not hooked up into QUIC code yet. Will submit that in the next CL. R=rch@chromium.org Review URL: https://codereview.chromium.org/605563003 Cr-Commit-Position: refs/heads/master@{#296749}
* Move http_server_properties_manager from chrome/browser/net to net/http.mef@chromium.org2014-07-101-0/+484
BUG= Review URL: https://codereview.chromium.org/378823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282319 0039d316-1c4b-4281-b951-d872f2087c98