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

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: Comment change Created 4 years, 6 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
« no previous file with comments | « content/browser/loader/resource_hints_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 content {
15 class URLRequestContextGetter; 16 class ResourceContext;
16 } 17 }
17 18
18 namespace content { 19 namespace content {
19 20
20 // A Preconnect instance maintains state while a TCP/IP connection is made, and 21 // 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. 22 // then released into the pool of available connections for future use.
22 23
23 // Tries to preconnect. |count| may be used to request more than one connection 24 // 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 25 // 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 26 // calls to preconnect a given url within a short time frame will automatically
26 // coalesce. |allow_credentials| corresponds to the fetch spec. 27 // coalesce. |allow_credentials| corresponds to the fetch spec.
27 // Note: This should only be called on the IO thread, with a valid 28 // Note: This should only be called on the IO thread, with a valid
28 // URLRequestContextGetter. 29 // URLRequestContextGetter.
29 CONTENT_EXPORT void PreconnectUrl( 30 CONTENT_EXPORT void PreconnectUrl(
30 net::URLRequestContextGetter* getter, 31 content::ResourceContext* resource_context,
31 const GURL& url, 32 const GURL& url,
32 const GURL& first_party_for_cookies, 33 const GURL& first_party_for_cookies,
33 int count, 34 int count,
34 bool allow_credentials, 35 bool allow_credentials,
35 net::HttpRequestInfo::RequestMotivation motivation); 36 net::HttpRequestInfo::RequestMotivation motivation);
36 37
38 // Issues a DNS request to |url|. Note that these requests are sent to the host
39 // resolver with priority net::IDLE.
40 CONTENT_EXPORT int PreresolveUrl(content::ResourceContext* resource_context,
41 const GURL& url,
42 const net::CompletionCallback& callback);
43
37 } // namespace content 44 } // namespace content
38 45
39 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_ 46 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_HINTS_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_hints_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698