Index: content/browser/loader/resource_hints_handler_impl.h |
diff --git a/content/browser/loader/resource_hints_handler_impl.h b/content/browser/loader/resource_hints_handler_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4bc2c2307b3674bc0bcc4e36cb15afe95069e3a5 |
--- /dev/null |
+++ b/content/browser/loader/resource_hints_handler_impl.h |
@@ -0,0 +1,50 @@ |
+// 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_CONTROLLER_H_ |
+#define CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_ |
+ |
+#include "base/macros.h" |
+#include "mojo/public/cpp/bindings/interface_request.h" |
+#include "mojo/public/cpp/bindings/strong_binding.h" |
+#include "third_party/WebKit/public/platform/resource_hints.mojom.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+ |
+class RenderProcessHost; |
+class ResourceContext; |
+ |
+// Listeners for resource hints requests from a frame in the render process. |
+class ResourceHintsHandlerImpl : public blink::mojom::ResourceHintsHandler { |
+ public: |
+ // |controller| and |resource_context| must outlive this class. |
+ ResourceHintsHandlerImpl(blink::mojom::ResourceHintsHandlerRequest request, |
+ ResourceContext* resource_context); |
+ |
+ ~ResourceHintsHandlerImpl() override; |
+ |
+ // blink::mojom::ResourceHintsHandler: |
+ void Preresolve(const GURL& url) override; |
+ void Preconnect(const GURL& url, |
+ bool credentials_flag, |
+ uint8_t num_connections) override; |
+ |
+ static void RegisterConnection( |
+ RenderProcessHost* render_process_host, |
+ blink::mojom::ResourceHintsHandlerRequest request); |
+ |
+ private: |
+ static void RegisterConnectionOnIOThread( |
+ ResourceContext* resource_context, |
+ blink::mojom::ResourceHintsHandlerRequest request); |
+ ResourceContext* resource_context_; |
+ mojo::StrongBinding<blink::mojom::ResourceHintsHandler> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ResourceHintsHandlerImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_ |