OLD | NEW |
---|---|
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_PREDICTOR_H_ | 5 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 6 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 | 84 |
85 NavigationID navigation_id; | 85 NavigationID navigation_id; |
86 GURL resource_url; | 86 GURL resource_url; |
87 content::ResourceType resource_type; | 87 content::ResourceType resource_type; |
88 net::RequestPriority priority; | 88 net::RequestPriority priority; |
89 | 89 |
90 // Only for responses. | 90 // Only for responses. |
91 std::string mime_type; | 91 std::string mime_type; |
92 bool was_cached; | 92 bool was_cached; |
93 GURL redirect_url; // Empty unless request was redirected to a valid url. | 93 GURL redirect_url; // Empty unless request was redirected to a valid url. |
94 | |
95 // Initializes a |URLRequestSummary| from a |URLRequest| response. | |
96 static bool SummarizeResponse(const net::URLRequest* request, | |
pasko
2016/08/09 17:08:54
const net::URLRequest&
(yes, the const pointer is
Benoit L
2016/08/09 17:22:56
Unfortunately, it is:
CONTENT_EXPORT static const
pasko
2016/08/10 09:08:46
Why would it be inconvenient to do the following?
Benoit L
2016/08/10 14:08:47
Done.
| |
97 URLRequestSummary* summary); | |
pasko
2016/08/09 17:08:54
Just returning a unique_ptr (instead of, ugh, outp
Benoit L
2016/08/09 17:22:56
The rest of the code uses URLRequestSummary by val
| |
94 }; | 98 }; |
95 | 99 |
96 ResourcePrefetchPredictor(const ResourcePrefetchPredictorConfig& config, | 100 ResourcePrefetchPredictor(const ResourcePrefetchPredictorConfig& config, |
97 Profile* profile); | 101 Profile* profile); |
98 ~ResourcePrefetchPredictor() override; | 102 ~ResourcePrefetchPredictor() override; |
99 | 103 |
100 // Thread safe. | 104 // Thread safe. |
101 static bool ShouldRecordRequest(net::URLRequest* request, | 105 static bool ShouldRecordRequest(net::URLRequest* request, |
102 content::ResourceType resource_type); | 106 content::ResourceType resource_type); |
103 static bool ShouldRecordResponse(net::URLRequest* response); | 107 static bool ShouldRecordResponse(net::URLRequest* response); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 | 337 |
334 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 338 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
335 history_service_observer_; | 339 history_service_observer_; |
336 | 340 |
337 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); | 341 DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictor); |
338 }; | 342 }; |
339 | 343 |
340 } // namespace predictors | 344 } // namespace predictors |
341 | 345 |
342 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ | 346 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_H_ |
OLD | NEW |