| 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 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 5 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 } else if (it->second) { | 1238 } else if (it->second) { |
| 1239 ++prefetch_cached; | 1239 ++prefetch_cached; |
| 1240 } else { | 1240 } else { |
| 1241 ++prefetch_network; | 1241 ++prefetch_network; |
| 1242 } | 1242 } |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 std::string prefix = key_type == PREFETCH_KEY_TYPE_HOST ? | 1245 std::string prefix = key_type == PREFETCH_KEY_TYPE_HOST ? |
| 1246 "ResourcePrefetchPredictor.Host.Predicted" : | 1246 "ResourcePrefetchPredictor.Host.Predicted" : |
| 1247 "ResourcePrefetchPredictor.Url.Predicted"; | 1247 "ResourcePrefetchPredictor.Url.Predicted"; |
| 1248 std::string suffix = "_" + base::IntToString(max_assumed_prefetched); | 1248 std::string suffix = "_" + base::SizeTToString(max_assumed_prefetched); |
| 1249 | 1249 |
| 1250 // Macros to avoid using the STATIC_HISTOGRAM_POINTER_BLOCK in UMA_HISTOGRAM | 1250 // Macros to avoid using the STATIC_HISTOGRAM_POINTER_BLOCK in UMA_HISTOGRAM |
| 1251 // definitions. | 1251 // definitions. |
| 1252 #define RPP_PREDICTED_HISTOGRAM_COUNTS(name, value) \ | 1252 #define RPP_PREDICTED_HISTOGRAM_COUNTS(name, value) \ |
| 1253 { \ | 1253 { \ |
| 1254 std::string full_name = prefix + name + suffix; \ | 1254 std::string full_name = prefix + name + suffix; \ |
| 1255 base::HistogramBase* histogram = base::Histogram::FactoryGet( \ | 1255 base::HistogramBase* histogram = base::Histogram::FactoryGet( \ |
| 1256 full_name, 1, 1000000, 50, \ | 1256 full_name, 1, 1000000, 50, \ |
| 1257 base::Histogram::kUmaTargetedHistogramFlag); \ | 1257 base::Histogram::kUmaTargetedHistogramFlag); \ |
| 1258 histogram->Add(value); \ | 1258 histogram->Add(value); \ |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 // HistoryService is already loaded. Continue with Initialization. | 1334 // HistoryService is already loaded. Continue with Initialization. |
| 1335 OnHistoryAndCacheLoaded(); | 1335 OnHistoryAndCacheLoaded(); |
| 1336 return; | 1336 return; |
| 1337 } | 1337 } |
| 1338 DCHECK(!history_service_observer_.IsObserving(history_service)); | 1338 DCHECK(!history_service_observer_.IsObserving(history_service)); |
| 1339 history_service_observer_.Add(history_service); | 1339 history_service_observer_.Add(history_service); |
| 1340 return; | 1340 return; |
| 1341 } | 1341 } |
| 1342 | 1342 |
| 1343 } // namespace predictors | 1343 } // namespace predictors |
| OLD | NEW |