| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/predictors/predictors_handler.h" | 5 #include "chrome/browser/ui/webui/predictors/predictors_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 new base::DictionaryValue()); | 124 new base::DictionaryValue()); |
| 125 resource->SetString("resource_url", r.resource_url()); | 125 resource->SetString("resource_url", r.resource_url()); |
| 126 resource->SetString("resource_type", | 126 resource->SetString("resource_type", |
| 127 ConvertResourceType(r.resource_type())); | 127 ConvertResourceType(r.resource_type())); |
| 128 resource->SetInteger("number_of_hits", r.number_of_hits()); | 128 resource->SetInteger("number_of_hits", r.number_of_hits()); |
| 129 resource->SetInteger("number_of_misses", r.number_of_misses()); | 129 resource->SetInteger("number_of_misses", r.number_of_misses()); |
| 130 resource->SetInteger("consecutive_misses", r.consecutive_misses()); | 130 resource->SetInteger("consecutive_misses", r.consecutive_misses()); |
| 131 resource->SetDouble("position", r.average_position()); | 131 resource->SetDouble("position", r.average_position()); |
| 132 resource->SetDouble( | 132 resource->SetDouble( |
| 133 "score", ResourcePrefetchPredictorTables::ComputeResourceScore(r)); | 133 "score", ResourcePrefetchPredictorTables::ComputeResourceScore(r)); |
| 134 resource->SetBoolean( |
| 135 "is_prefetchable", |
| 136 resource_prefetch_predictor_->IsResourcePrefetchable(r)); |
| 134 resources->Append(std::move(resource)); | 137 resources->Append(std::move(resource)); |
| 135 } | 138 } |
| 136 main->Set("resources", resources); | 139 main->Set("resources", resources); |
| 137 db->Append(std::move(main)); | 140 db->Append(std::move(main)); |
| 138 } | 141 } |
| 139 } | 142 } |
| OLD | NEW |