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

Side by Side Diff: content/browser/loader/resource_hints_controller.h

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use unique_ptr to avoid memory leaks in unit tests 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_
6 #define CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_
7
8 #include "base/macros.h"
9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/public/cpp/bindings/strong_binding.h"
11 #include "third_party/WebKit/public/platform/resource_hints.mojom.h"
12 #include "url/gurl.h"
13
14 namespace content {
15
16 class RenderProcessHost;
17 class ResourceContext;
18
19 // Listeners for resource hints requests from a frame in the render process.
20 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.
21 public:
22 // |controller| and |resource_context| must outlive this class.
23 ResourceHintsController(blink::mojom::ResourceHintsHandlerRequest request,
24 ResourceContext* resource_context);
25
26 ~ResourceHintsController() override;
27
28 // blink::mojom::ResourceHintsHandler:
29 void Preresolve(const GURL& url) override;
30 void Preconnect(const GURL& url,
31 bool credentials_flag,
32 uint8_t num_connections) override;
33
34 static void RegisterConnection(
35 RenderProcessHost* render_process_host,
36 blink::mojom::ResourceHintsHandlerRequest request);
37
38 private:
39 static void RegisterConnectionOnIOThread(
40 ResourceContext* resource_context,
41 blink::mojom::ResourceHintsHandlerRequest request);
42 ResourceContext* resource_context_;
43 mojo::StrongBinding<blink::mojom::ResourceHintsHandler> binding_;
44
45 DISALLOW_COPY_AND_ASSIGN(ResourceHintsController);
46 };
47
48 } // namespace content
49
50 #endif // CONTENT_BROWSER_LOADER_RESOURCE_HINTS_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698