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

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

Issue 2738613003: predictors: Add Manifest table to ResourcePrefetchPredictor. (Closed)
Patch Set: Created 3 years, 9 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ 4 #ifndef CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_
5 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ 5 #define CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 10 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
(...skipping 12 matching lines...) Expand all
23 net::RequestPriority priority, 23 net::RequestPriority priority,
24 bool has_validators, 24 bool has_validators,
25 bool always_revalidate); 25 bool always_revalidate);
26 26
27 void InitializeRedirectStat(RedirectStat* redirect, 27 void InitializeRedirectStat(RedirectStat* redirect,
28 const std::string& url, 28 const std::string& url,
29 int number_of_hits, 29 int number_of_hits,
30 int number_of_misses, 30 int number_of_misses,
31 int consecutive_misses); 31 int consecutive_misses);
32 32
33 void InitializePrecacheResource(precache::PrecacheResource* resource,
34 const std::string& url,
35 double weight_ratio);
36
33 PrefetchData CreatePrefetchData(const std::string& primary_key, 37 PrefetchData CreatePrefetchData(const std::string& primary_key,
34 uint64_t last_visit_time = 0); 38 uint64_t last_visit_time = 0);
35 RedirectData CreateRedirectData(const std::string& primary_key, 39 RedirectData CreateRedirectData(const std::string& primary_key,
36 uint64_t last_visit_time = 0); 40 uint64_t last_visit_time = 0);
37 41
38 NavigationID CreateNavigationID(SessionID::id_type tab_id, 42 NavigationID CreateNavigationID(SessionID::id_type tab_id,
39 const std::string& main_frame_url); 43 const std::string& main_frame_url);
40 44
41 ResourcePrefetchPredictor::PageRequestSummary CreatePageRequestSummary( 45 ResourcePrefetchPredictor::PageRequestSummary CreatePageRequestSummary(
42 const std::string& main_frame_url, 46 const std::string& main_frame_url,
(...skipping 30 matching lines...) Expand all
73 bool operator==(const ResourceData& lhs, const ResourceData& rhs); 77 bool operator==(const ResourceData& lhs, const ResourceData& rhs);
74 bool operator==(const RedirectData& lhs, const RedirectData& rhs); 78 bool operator==(const RedirectData& lhs, const RedirectData& rhs);
75 bool operator==(const RedirectStat& lhs, const RedirectStat& rhs); 79 bool operator==(const RedirectStat& lhs, const RedirectStat& rhs);
76 bool operator==(const ResourcePrefetchPredictor::PageRequestSummary& lhs, 80 bool operator==(const ResourcePrefetchPredictor::PageRequestSummary& lhs,
77 const ResourcePrefetchPredictor::PageRequestSummary& rhs); 81 const ResourcePrefetchPredictor::PageRequestSummary& rhs);
78 bool operator==(const ResourcePrefetchPredictor::URLRequestSummary& lhs, 82 bool operator==(const ResourcePrefetchPredictor::URLRequestSummary& lhs,
79 const ResourcePrefetchPredictor::URLRequestSummary& rhs); 83 const ResourcePrefetchPredictor::URLRequestSummary& rhs);
80 84
81 } // namespace predictors 85 } // namespace predictors
82 86
87 namespace precache {
alexilin 2017/03/07 16:08:15 I know, it doesn't look good but it won't compile
Benoit L 2017/03/09 17:00:28 Yes, I remember. Sigh...
88
89 std::ostream& operator<<(std::ostream& stream,
90 const PrecacheManifest& manifest);
91 std::ostream& operator<<(std::ostream& stream,
92 const PrecacheResource& resource);
93
94 bool operator==(const PrecacheManifest& lhs, const PrecacheManifest& rhs);
95 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs);
96
97 } // namespace precache
98
83 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_ 99 #endif // CHROME_BROWSER_PREDICTORS_RESOURCE_PREFETCH_PREDICTOR_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698