summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/dns_master.cc
Commit message (Collapse)AuthorAgeFilesLines
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-161-1/+2
| | | | | | | | | | | | | | | | event stream (NetLog). This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events. This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up. The user-visible behavior should remain unchanged. BUG=37421 Review URL: http://codereview.chromium.org/848006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor: Eliminte locking from PrefetchObserver and DnsMaster in favor of ↵eroman@chromium.org2009-12-081-66/+32
| | | | | | | | | | | | | | | | | making these classes non-threadsafe. Conceptually, PrefetchObserver and DnsMaster live on the IO thread, and their methods can only be called from the IO thread. In the cases where calls do need to be made from the UI thread, we post a task to be run on the IO loop and return without blocking. The only time where we block is during shutdown, when we must wait on the IO thread to get us the startup list and referral list. BUG=25335 Review URL: http://codereview.chromium.org/300032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34066 0039d316-1c4b-4281-b951-d872f2087c98
* Third patch in getting rid of caching MessageLoop pointers and always using ↵jam@chromium.org2009-11-021-20/+22
| | | | | | | | | | ChromeThread instead. BUG=25354 Review URL: http://codereview.chromium.org/342068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30687 0039d316-1c4b-4281-b951-d872f2087c98
* LoadLog is used as an output parameter, reorder it to the last parameter.willchan@chromium.org2009-08-141-1/+1
| | | | | | Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
* Add a "LoadLog" parameter to transactions, hostresolver, clientsocketpool ↵ericroman@google.com2009-08-121-1/+2
| | | | | | | | and proyxservice.This dependency comes from the parent URLRequest, and is used as a container for per-request profiling data.This change is strictly a no-op refactor -- the parameter is unused, and LoadLog does nothing.BUG=http://crbug.com/14478TEST=none -- just needs to compile and pass existing tests.DESIGN=<http://docs.google.com/Doc?id=dfhcnb2v_21gbtrcpr3&hl=en> Review URL: http://codereview.chromium.org/126303 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23127 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a typo in a comment.ericroman@google.com2009-06-291-1/+1
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/151037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19524 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor DNS A/B experient, and add test of congestion time limitsjar@chromium.org2009-06-271-5/+7
| | | | | | | | | | | | | | | | I added another option in the DNS experiment: user 2 seconds or 500ms for the congestion limit (that causes pre-resolutions to be discarded from the queue. The code in browser_main.cc was getting toooo large, so I pulled all the experiment code into dns_global.cc. BUG=15479 r=eroman Review URL: http://codereview.chromium.org/147215 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19464 0039d316-1c4b-4281-b951-d872f2087c98
* Properly cleanup state after synchronous DNS resolutionjar@chromium.org2009-06-161-12/+22
| | | | | | | | | | | | | | | Pre-resoultion system was not cleaning up its state when the resolver returned asynchronously. This regression probably landed when we shifted to using an internal resolver class, rather than running on worker threads. The impact was made detectable by the recent introudction of a micro-cache, which often returns with a synchronous result. BUG=14212 r=eroman Review URL: http://codereview.chromium.org/125209 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18537 0039d316-1c4b-4281-b951-d872f2087c98
* * Move the global "DnsResolutionObserver" code depended on by DNS ↵ericroman@google.com2009-06-151-2/+10
| | | | | | | | | | | | | | prefetcher, into HostResolver. This has the advantage that consumers of DNS no longer have to remember to call "DidFinishDnsResolutionWithStatus()" followed by "DidStartDnsResolution()" in order for the prefetcher to observe the resolution. Instead it just happens automatically, and subscribers register via HostResolver::AddObserver() on a particular resolver instance. * To accomodate the prefetcher's observer, HostResolver::Resolve() needs an additional "referrer" parameter. This is slightly awkward since "referrer" has nothing to do with the actual resolve request. To simplify plumbing through this and other optional parameters, Resolve() was changed to take a "RequestInfo&" parameter in place of say {hostname, port, flags}. * Added an option to HostResolver::Resolve() for disallowing cached responses (RequestInfo::allow_cached_response). This will be used when you refresh a page, to bypass the host cache. The code to do this has been added to HttpNetworkTransaction, but is commented out pending an appropriate unit-test to verify it. BUG=14056 Review URL: http://codereview.chromium.org/125107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18371 0039d316-1c4b-4281-b951-d872f2087c98
* * Avoid doing concurrent DNS resolves of the same hostname in HostResolver.ericroman@google.com2009-06-121-3/+4
| | | | | | | | | | | | | | | | * Add a 1 minute cache for host resolves. * Refactor HostResolver to handle multiple requests. * Make HostResolver a dependency of URLRequestContext. operate the HostResolver in async mode for proxy resolver (bridging to IO thread). TEST=unittests BUG=13163 Review URL: http://codereview.chromium.org/118100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18236 0039d316-1c4b-4281-b951-d872f2087c98
* Change DnsMaster to only access HostResolver only on the IO thread.ericroman@google.com2009-06-111-5/+45
| | | | | | | | | | | | | | | And plumb through an (unused) HostResolver dependency into DnsMaster. This is in preparation for <http://codereview.chromium.org/118100> which turns HostResolver into a (non-thread-safe) shared dependency of the URLRequestContext. After CL 118100, DnsMaster will be issuing host resolves through the main URLRequestContext's HostResolver (now on the IO thread). This will have the effect of warming the shared HostResolver's internal cache. BUG=13163 TEST=existing unit tests Review URL: http://codereview.chromium.org/122028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18212 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 17638.jar@chromium.org2009-06-051-12/+71
| | | | | | | | | | | | | | | This relands http://src.chromium.org/viewvc/chrome?view=rev&revision=17605 which was reverted in 17638. It also disables MassiveConcurrentLookupTest, which was a stress test, and is partially obsolete since the class now responds to congestion produced by NOT resolving all names. BUG=13356 TBR=willchan Review URL: http://codereview.chromium.org/119196 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17697 0039d316-1c4b-4281-b951-d872f2087c98
* Fix purify freeze. Revert "Use a priority queue to assure that subresources ↵willchan@chromium.org2009-06-041-71/+12
| | | | | | | | | | | are resolved asap" This reverts git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17605 0039d316-1c4b-4281-b951-d872f2087c98 TBR=jar Review URL: http://codereview.chromium.org/118239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17638 0039d316-1c4b-4281-b951-d872f2087c98
* Use a priority queue to assure that subresources are resolved asapjar@chromium.org2009-06-041-12/+71
| | | | | | | | | | | Also implement DNS congestion avoidance in the pre-fetch system. BUG=13276 r=mbelshe Review URL: http://codereview.chromium.org/118149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17605 0039d316-1c4b-4281-b951-d872f2087c98
* Test impact of 4 rather than 8 parallel DNS prefetchjar@chromium.org2009-06-011-6/+6
| | | | | | | | BUG=6532 r=wtc Review URL: http://codereview.chromium.org/115990 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17338 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of base/ref_counted.h.thestig@chromium.org2009-03-181-1/+0
| | | | | | Review URL: http://codereview.chromium.org/48105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11974 0039d316-1c4b-4281-b951-d872f2087c98
* Use string for Histogram names since these are all ASCII anyway.dsh@google.com2009-02-241-1/+1
| | | | | | | | Wide-character literals cause problems between platforms. Review URL: http://codereview.chromium.org/28046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10276 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up dns prefetch code, and also port it.phajdan.jr@chromium.org2009-02-191-202/+116
| | | | | | | | | | | | | | | | | | | | - remove slave threads and use HostResolver in asynchronous mode instead (while still limiting number of concurrent lookups) - make the implementation portable and make DnsMaster unit test compile and pass on Linux - add more tests to DnsMaster unit test to simulate various shutdown scenarios, concurrent lookups, and to verify that we don't exceed our limit of concurrent lookup requests) - remove some tests which relied on specifics of slaves' inner working - adjust initialization and shutdown of dns prefetching (now it relies on the IO message loop being present) Bonus: shutdown is almost instant now, no need to have a timeout. BUG=5687, 6683 Review URL: http://codereview.chromium.org/15076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10021 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce the amount of included header files. Vast change like in "Oh God! ↵maruel@chromium.org2009-02-181-1/+1
| | | | | | | | This revision changes half of the source files!". Review URL: http://codereview.chromium.org/20378 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9958 0039d316-1c4b-4281-b951-d872f2087c98
* Persist info about subresources on pages for DNS pre-resolutionjar@chromium.org2009-02-171-0/+46
| | | | | | | | | | | | | | | | | | | | | The DNS pre-resolution system already "learns" what domains are commonly needed when rendering sub-resources of a page at a given domain. This patch saves (some of) the information learned into a persistent pref, and restores it on startup. For now, I put in a wimpy pruning of the list each time I save, so that the list will not grow endlessly from session to session. I probably need a better pruning algorithm, such as one that prunes after a given amount of time, rather than only during shutdown. For now, this should get a lot of nice results, and provide slightly larger than needed lists to users that have long lived sessions, which is similar to the current performance, where I didn't persist any info, and only pruned (actually discarded) all learned info at shutdown. r=mbelshe Review URL: http://codereview.chromium.org/21374 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9912 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Clean up dns prefetch code, and also port it."tc@google.com2009-02-061-105/+202
| | | | | | | | | | | | | | | | This reverts commit r9312. Revert "Fix HostResolver crash when MessageLoop is destroyed during" This reverts commit r9317. BUG=5687,6683 TBR=ph Review URL: http://codereview.chromium.org/21133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9325 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up dns prefetch code, and also port it.phajdan.jr@chromium.org2009-02-061-202/+105
| | | | | | | | | | | | | | - remove slave threads and use HostResolver in asynchronous mode instead (while still limiting number of concurrent lookups) - make the implementation portable and make DnsMaster unit test compile and pass on Linux - add more tests to DnsMaster unit test to simulate various shutdown scenarios, concurrent lookups, and to verify that we don't exceed our limit of concurrent lookup requests) - remove some tests which relied on specifics of slaves' inner working Bonus: shutdown is almost instant now, no need to have a timeout. BUG=5687, 6683 Review URL: http://codereview.chromium.org/15076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9312 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 8627,8625.maruel@chromium.org2009-01-261-100/+191
| | | | | | Review URL: http://codereview.chromium.org/18598 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8628 0039d316-1c4b-4281-b951-d872f2087c98
* Fix MSVC warning.phajdan.jr@chromium.org2009-01-261-1/+3
| | | | | | | TBR=maruel Review URL: http://codereview.chromium.org/18594 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8627 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up dns prefetch code, and also port it.phajdan.jr@chromium.org2009-01-261-191/+98
| | | | | | | | BUG=5687, 6683 Review URL: http://codereview.chromium.org/15076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8625 0039d316-1c4b-4281-b951-d872f2087c98
* Platform cleanup in chrome/browser/net.phajdan.jr@chromium.org2008-12-201-15/+8
| | | | | | | | Preparing for more complex changes. Review URL: http://codereview.chromium.org/14919 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7344 0039d316-1c4b-4281-b951-d872f2087c98
* Adaptively identify URL subresources and pre-resolve hosts via DNSjar@google.com2008-11-061-60/+190
| | | | | | | | | | | | | | | | | | | | Use the HTTP "referer" header to identify subresources used during a page load. Store that info, and use it when next visiting the referenced hosts to pre-resolve the (probably) needed subresources. This set of changes will surely evolve as we see how it plays out on broader distribution (via histogram measurments), but this should be the foundation of the change. In design specs, this was previously referred to as "adaptive correlated DNS prefetching." r=mbelshe Review URL: http://codereview.chromium.org/9168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4929 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+2
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor thread naming in the DNS slaves.deanm@google.com2008-08-221-11/+0
| | | | | | BUG=1337196 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1219 0039d316-1c4b-4281-b951-d872f2087c98
* Port the Thread class properly to Mac and Linux. This involved portingdarin@google.com2008-08-211-1/+1
| | | | | | | | | | | | PlatformThread and creating an API on PlatformThread to create a native thread and later join with it. I also made a few other tweaks to PlatformThread, such as eliminating the Current() method which appears to be unused. The operator==() is also unused, so I killed it as well. I made a few other miscellaneous cleanups and adjustments. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1146 0039d316-1c4b-4281-b951-d872f2087c98
* Remove includes that are already included in the header.paulg@google.com2008-08-091-3/+0
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@611 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome to the repository.initial.commit2008-07-261-0/+454
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15 0039d316-1c4b-4281-b951-d872f2087c98