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

Side by Side Diff: chrome/browser/ui/webui/predictors/predictors_handler.cc

Issue 2755093002: predictors: Mark before_first_contentful_paint for resources fetched before fcp. (Closed)
Patch Set: before_first_contentful_paint browser_test Created 3 years, 8 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 (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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 new base::DictionaryValue()); 125 new base::DictionaryValue());
126 resource->SetString("resource_url", r.resource_url()); 126 resource->SetString("resource_url", r.resource_url());
127 resource->SetString("resource_type", 127 resource->SetString("resource_type",
128 ConvertResourceType(r.resource_type())); 128 ConvertResourceType(r.resource_type()));
129 resource->SetInteger("number_of_hits", r.number_of_hits()); 129 resource->SetInteger("number_of_hits", r.number_of_hits());
130 resource->SetInteger("number_of_misses", r.number_of_misses()); 130 resource->SetInteger("number_of_misses", r.number_of_misses());
131 resource->SetInteger("consecutive_misses", r.consecutive_misses()); 131 resource->SetInteger("consecutive_misses", r.consecutive_misses());
132 resource->SetDouble("position", r.average_position()); 132 resource->SetDouble("position", r.average_position());
133 resource->SetDouble( 133 resource->SetDouble(
134 "score", ResourcePrefetchPredictorTables::ComputeResourceScore(r)); 134 "score", ResourcePrefetchPredictorTables::ComputeResourceScore(r));
135 resource->SetBoolean("before_first_contentful_paint",
136 r.before_first_contentful_paint());
135 resource->SetBoolean( 137 resource->SetBoolean(
136 "is_prefetchable", 138 "is_prefetchable",
137 resource_prefetch_predictor_->IsResourcePrefetchable(r)); 139 resource_prefetch_predictor_->IsResourcePrefetchable(r));
138 resources->Append(std::move(resource)); 140 resources->Append(std::move(resource));
139 } 141 }
140 main->Set("resources", std::move(resources)); 142 main->Set("resources", std::move(resources));
141 db->Append(std::move(main)); 143 db->Append(std::move(main));
142 } 144 }
143 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698