OLD | NEW |
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 | 4 |
5 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" | 5 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 RedirectData CreateRedirectData(const std::string& primary_key, | 106 RedirectData CreateRedirectData(const std::string& primary_key, |
107 uint64_t last_visit_time) { | 107 uint64_t last_visit_time) { |
108 RedirectData data; | 108 RedirectData data; |
109 data.set_primary_key(primary_key); | 109 data.set_primary_key(primary_key); |
110 data.set_last_visit_time(last_visit_time); | 110 data.set_last_visit_time(last_visit_time); |
111 return data; | 111 return data; |
112 } | 112 } |
113 | 113 |
114 precache::PrecacheManifest CreateManifestData(uint64_t id) { | 114 precache::PrecacheManifest CreateManifestData(int64_t id) { |
115 precache::PrecacheManifestId* manifest_id = | |
116 new precache::PrecacheManifestId(); | |
117 manifest_id->set_id(id); | |
118 precache::PrecacheManifest manifest; | 115 precache::PrecacheManifest manifest; |
119 manifest.set_allocated_id(manifest_id); | 116 manifest.mutable_id()->set_id(id); |
120 return manifest; | 117 return manifest; |
121 } | 118 } |
122 | 119 |
123 OriginData CreateOriginData(const std::string& host, uint64_t last_visit_time) { | 120 OriginData CreateOriginData(const std::string& host, uint64_t last_visit_time) { |
124 OriginData data; | 121 OriginData data; |
125 data.set_host(host); | 122 data.set_host(host); |
126 data.set_last_visit_time(last_visit_time); | 123 data.set_last_visit_time(last_visit_time); |
127 return data; | 124 return data; |
128 } | 125 } |
129 | 126 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 351 |
355 return equal; | 352 return equal; |
356 } | 353 } |
357 | 354 |
358 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs) { | 355 bool operator==(const PrecacheResource& lhs, const PrecacheResource& rhs) { |
359 return lhs.url() == rhs.url() && | 356 return lhs.url() == rhs.url() && |
360 AlmostEqual(lhs.weight_ratio(), rhs.weight_ratio()); | 357 AlmostEqual(lhs.weight_ratio(), rhs.weight_ratio()); |
361 } | 358 } |
362 | 359 |
363 } // namespace precache | 360 } // namespace precache |
OLD | NEW |