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

Unified Diff: content/browser/loader/resource_hints_handler_impl.h

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove gmocking + add another browser test 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698