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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_common.h

Issue 2545943003: Accessing navigation information via webcontents (Closed)
Patch Set: Post-Review Modifications #3 Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 20 matching lines...) Expand all
31 PREFETCH_KEY_TYPE_HOST, 31 PREFETCH_KEY_TYPE_HOST,
32 PREFETCH_KEY_TYPE_URL 32 PREFETCH_KEY_TYPE_URL
33 }; 33 };
34 34
35 // Indicates what caused the prefetch request. 35 // Indicates what caused the prefetch request.
36 enum class PrefetchOrigin { NAVIGATION, EXTERNAL }; 36 enum class PrefetchOrigin { NAVIGATION, EXTERNAL };
37 37
38 // Represents a single navigation for a render frame. 38 // Represents a single navigation for a render frame.
39 struct NavigationID { 39 struct NavigationID {
40 NavigationID(); 40 NavigationID();
41 NavigationID(int render_process_id, 41 explicit NavigationID(content::WebContents* web_contents);
42 int render_frame_id, 42 NavigationID(content::WebContents* web_contents,
43 const GURL& main_frame_url); 43 const GURL& main_frame_url,
44 const base::TimeTicks& creation_time);
44 NavigationID(const NavigationID& other); 45 NavigationID(const NavigationID& other);
45 explicit NavigationID(content::WebContents* web_contents);
46 bool operator<(const NavigationID& rhs) const; 46 bool operator<(const NavigationID& rhs) const;
47 bool operator==(const NavigationID& rhs) const; 47 bool operator==(const NavigationID& rhs) const;
48 48
49 bool IsSameRenderer(const NavigationID& other) const; 49 bool IsSameRenderer(const NavigationID& other) const;
50 50
51 // Returns true iff the render_process_id_, render_frame_id_ and 51 // Returns true iff the render_process_id_, render_frame_id_ and
52 // frame_url_ has been set correctly. 52 // frame_url_ has been set correctly.
53 bool is_valid() const; 53 bool is_valid() const;
54 54
55 int render_process_id; 55 int render_process_id;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // Maximum number of prefetches that can be inflight for a single navigation. 115 // Maximum number of prefetches that can be inflight for a single navigation.
116 size_t max_prefetches_inflight_per_navigation; 116 size_t max_prefetches_inflight_per_navigation;
117 // Maximum number of prefetches that can be inflight for a host for a single 117 // Maximum number of prefetches that can be inflight for a host for a single
118 // navigation. 118 // navigation.
119 size_t max_prefetches_inflight_per_host_per_navigation; 119 size_t max_prefetches_inflight_per_host_per_navigation;
120 }; 120 };
121 121
122 } // namespace predictors 122 } // namespace predictors
123 123
124 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_ 124 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_COMMON_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/resource_prefetch_predictor_observer.cc ('k') | chrome/browser/predictors/resource_prefetch_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698