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

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: Mark before_first_contentful_paint. 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 (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
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("before_first_contentful_paint",
135 r.before_first_contentful_paint());
134 resource->SetBoolean( 136 resource->SetBoolean(
135 "is_prefetchable", 137 "is_prefetchable",
136 resource_prefetch_predictor_->IsResourcePrefetchable(r)); 138 resource_prefetch_predictor_->IsResourcePrefetchable(r));
137 resources->Append(std::move(resource)); 139 resources->Append(std::move(resource));
138 } 140 }
139 main->Set("resources", resources); 141 main->Set("resources", resources);
140 db->Append(std::move(main)); 142 db->Append(std::move(main));
141 } 143 }
142 } 144 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698