| Index: content/browser/loader/resource_hints_impl.cc
|
| diff --git a/content/browser/loader/resource_hints_impl.cc b/content/browser/loader/resource_hints_impl.cc
|
| index 694947881e67296fa2fa2d6ebdb829da9de7eedb..c9ca99fae8f3799890c34ea4834b1f6e7fd32702 100644
|
| --- a/content/browser/loader/resource_hints_impl.cc
|
| +++ b/content/browser/loader/resource_hints_impl.cc
|
| @@ -2,9 +2,12 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/public/browser/resource_hints.h"
|
| -
|
| +#include "base/memory/ptr_util.h"
|
| +#include "content/browser/loader/resource_dispatcher_host_impl.h"
|
| +#include "content/browser/loader/resource_hints_controller.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/resource_context.h"
|
| +#include "content/public/browser/resource_hints.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/http/http_network_session.h"
|
| #include "net/http/http_request_info.h"
|
| @@ -12,20 +15,19 @@
|
| #include "net/http/http_transaction_factory.h"
|
| #include "net/url_request/http_user_agent_settings.h"
|
| #include "net/url_request/url_request_context.h"
|
| -#include "net/url_request/url_request_context_getter.h"
|
|
|
| namespace content {
|
|
|
| -void PreconnectUrl(net::URLRequestContextGetter* getter,
|
| +void PreconnectUrl(content::ResourceContext* resource_context,
|
| const GURL& url,
|
| const GURL& first_party_for_cookies,
|
| int count,
|
| bool allow_credentials,
|
| net::HttpRequestInfo::RequestMotivation motivation) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| - DCHECK(getter);
|
| + DCHECK(resource_context);
|
|
|
| - net::URLRequestContext* context = getter->GetURLRequestContext();
|
| + net::URLRequestContext* context = resource_context->GetRequestContext();
|
| net::HttpTransactionFactory* factory = context->http_transaction_factory();
|
| net::HttpNetworkSession* session = factory->GetSession();
|
|
|
| @@ -57,4 +59,16 @@ void PreconnectUrl(net::URLRequestContextGetter* getter,
|
| http_stream_factory->PreconnectStreams(count, request_info);
|
| }
|
|
|
| +int PreresolveUrl(content::ResourceContext* resource_context,
|
| + const GURL& url,
|
| + const net::CompletionCallback& callback) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| + ResourceDispatcherHostImpl* dispatcher_host =
|
| + ResourceDispatcherHostImpl::Get();
|
| + DCHECK(dispatcher_host);
|
| + ResourceHintsController* controller =
|
| + dispatcher_host->resource_hints_controller();
|
| + return controller->PreresolveUrl(resource_context, url, callback);
|
| +}
|
| +
|
| } // namespace content
|
|
|