Chromium Code Reviews| Index: content/browser/loader/resource_hints_controller.h |
| diff --git a/content/browser/loader/resource_hints_controller.h b/content/browser/loader/resource_hints_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4ea2f416a4be76f1d2ab131a6156ebb1e8b6d9be |
| --- /dev/null |
| +++ b/content/browser/loader/resource_hints_controller.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 ResourceHintsController : public blink::mojom::ResourceHintsHandler { |
|
kinuko
2016/06/16 05:39:58
nit: the most common naming pattern seems to be to
Charlie Harrison
2016/06/16 11:00:20
Done.
|
| + public: |
| + // |controller| and |resource_context| must outlive this class. |
| + ResourceHintsController(blink::mojom::ResourceHintsHandlerRequest request, |
| + ResourceContext* resource_context); |
| + |
| + ~ResourceHintsController() 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(ResourceHintsController); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_ |