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

Unified Diff: components/dns_prefetch/browser/net_message_filter.h

Issue 730833004: Adds simple browser-side implementation for DNS prefetching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address ttuttle@ comments Created 6 years 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
« no previous file with comments | « components/dns_prefetch/browser/DEPS ('k') | components/dns_prefetch/browser/net_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dns_prefetch/browser/net_message_filter.h
diff --git a/components/dns_prefetch/browser/net_message_filter.h b/components/dns_prefetch/browser/net_message_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..610f1abc3096092c9f4a7f4c2c9824d7b01b75ad
--- /dev/null
+++ b/components/dns_prefetch/browser/net_message_filter.h
@@ -0,0 +1,40 @@
+// Copyright 2014 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 COMPONENTS_DNS_PREFETCH_BROWSER_NET_MESSAGE_FILTER_H_
+#define COMPONENTS_DNS_PREFETCH_BROWSER_NET_MESSAGE_FILTER_H_
+
+#include "base/macros.h"
+#include "content/public/browser/browser_message_filter.h"
+
+namespace net {
+class HostResolver;
+}
+
+namespace dns_prefetch {
+struct LookupRequest;
+
+// Simple browser-side handler for DNS prefetch requests.
+// Passes prefetch requests to the provided net::HostResolver.
+// Each renderer process requires its own filter.
+class NetMessageFilter : public content::BrowserMessageFilter {
+ public:
+ explicit NetMessageFilter(net::HostResolver* host_resolver);
+
+ // content::BrowserMessageFilter implementation:
+ bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+ ~NetMessageFilter() override;
+
+ void OnDnsPrefetch(const LookupRequest& lookup_request);
+
+ net::HostResolver* host_resolver_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetMessageFilter);
+};
+
+} // namespace dns_prefetch
+
+#endif // COMPONENTS_DNS_PREFETCH_BROWSER_NET_MESSAGE_FILTER_H_
« no previous file with comments | « components/dns_prefetch/browser/DEPS ('k') | components/dns_prefetch/browser/net_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698