Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: content/public/browser/resource_hints.h

Issue 2004453002: Add a Dns preresolve interface in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@predictor_dns_browsertest
Patch Set: Fix comment and add necessary include Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "net/base/completion_callback.h"
9 #include "net/http/http_request_info.h" 10 #include "net/http/http_request_info.h"
10 #include "url/gurl.h" 11 #include "url/gurl.h"
11 12
12 class GURL; 13 class GURL;
13 14
14 namespace net { 15 namespace net {
15 class URLRequestContextGetter; 16 class URLRequestContextGetter;
16 } 17 }
17 18
18 namespace content { 19 namespace content {
19 20
21 // TODO(csharrison): A cleaner interface woulbe to use ResourceContext instead
22 // of URLRequestContextGetter for these functions. The predictor will need to be
23 // modified for this purpose to guarantee lifetime semantics.
24
20 // A Preconnect instance maintains state while a TCP/IP connection is made, and 25 // A Preconnect instance maintains state while a TCP/IP connection is made, and
21 // then released into the pool of available connections for future use. 26 // then released into the pool of available connections for future use.
22 27
23 // Tries to preconnect. |count| may be used to request more than one connection 28 // Tries to preconnect. |count| may be used to request more than one connection
24 // be established in parallel. Note that the net stack has logic so multiple 29 // be established in parallel. Note that the net stack has logic so multiple
25 // calls to preconnect a given url within a short time frame will automatically 30 // calls to preconnect a given url within a short time frame will automatically
26 // coalesce. |allow_credentials| corresponds to the fetch spec. 31 // coalesce. |allow_credentials| corresponds to the fetch spec.
27 // Note: This should only be called on the IO thread, with a valid 32 // Note: This should only be called on the IO thread, with a valid
28 // URLRequestContextGetter. 33 // URLRequestContextGetter.
29 CONTENT_EXPORT void PreconnectUrl( 34 CONTENT_EXPORT void PreconnectUrl(
30 net::URLRequestContextGetter* getter, 35 net::URLRequestContextGetter* getter,
31 const GURL& url, 36 const GURL& url,
32 const GURL& first_party_for_cookies, 37 const GURL& first_party_for_cookies,
33 int count, 38 int count,
34 bool allow_credentials, 39 bool allow_credentials,
35 net::HttpRequestInfo::RequestMotivation motivation); 40 net::HttpRequestInfo::RequestMotivation motivation);
36 41
42 // Issues a DNS request to |url|. Note that these requests are sent to the host
43 // resolver with priority net::IDLE.
44 CONTENT_EXPORT int PreresolveUrl(net::URLRequestContextGetter* getter,
45 const GURL& url,
46 const net::CompletionCallback& callback);
47
37 } // namespace content 48 } // namespace content
38 49
39 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_ 50 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_
OLDNEW
« content/browser/loader/resource_hints_impl.cc ('K') | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698