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

Unified Diff: content/browser/loader/resource_hints_impl.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: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_hints_impl.h
diff --git a/content/browser/loader/resource_hints_impl.h b/content/browser/loader/resource_hints_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b5d3e1e1f6c12cef34ee5dbd1aa6400396e3d795
--- /dev/null
+++ b/content/browser/loader/resource_hints_impl.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_LOADER_RESOURCE_HINTS_IMPL_H_
+#define CONTENT_BROWSER_LOADER_RESOURCE_HINTS_IMPL_H_
+
+#include <set>
+
+#include "base/macros.h"
+#include "net/base/address_list.h"
+#include "net/dns/host_resolver.h"
+#include "net/dns/single_request_host_resolver.h"
+#include "net/url_request/url_request_context_getter.h"
+
+namespace content {
+
+// Scoped to the ResourceDispatcherHostImpl.
Charlie Harrison 2016/05/20 16:30:26 I've added a more detailed comment here in the nex
+class ResourceHintsController {
+ public:
+ ResourceHintsController();
+ ~ResourceHintsController();
+ int PreresolveUrl(net::URLRequestContextGetter* getter,
+ const GURL& url,
+ const net::CompletionCallback& callback);
+
+ private:
+ struct DnsRequest {
+ DnsRequest(net::HostResolver* resolver);
+ net::SingleRequestHostResolver resolver;
+ net::AddressList addresses;
+ };
+
+ void OnResolveComplete(DnsRequest* request,
+ const net::CompletionCallback& callback,
+ int result);
+
+ std::set<DnsRequest*> pending_dns_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(ResourceHintsController);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_LOADER_RESOURCE_HINTS_IMPL_H_
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/loader/resource_hints_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698