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

Side by Side Diff: chrome/browser/net/resource_prefetch_predictor_observer.cc

Issue 2195503003: predictors: Add the request priority to the reource_prefetch_predictor DB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fix. Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/net/resource_prefetch_predictor_observer.h" 5 #include "chrome/browser/net/resource_prefetch_predictor_observer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 ReportRequestStats(REQUEST_STATS_NO_RENDER_FRAME_ID_FROM_REQUEST_INFO); 65 ReportRequestStats(REQUEST_STATS_NO_RENDER_FRAME_ID_FROM_REQUEST_INFO);
66 return false; 66 return false;
67 } 67 }
68 68
69 summary->navigation_id.render_process_id = render_process_id; 69 summary->navigation_id.render_process_id = render_process_id;
70 summary->navigation_id.render_frame_id = render_frame_id; 70 summary->navigation_id.render_frame_id = render_frame_id;
71 summary->navigation_id.main_frame_url = request->first_party_for_cookies(); 71 summary->navigation_id.main_frame_url = request->first_party_for_cookies();
72 summary->navigation_id.creation_time = request->creation_time(); 72 summary->navigation_id.creation_time = request->creation_time();
73 summary->resource_url = request->original_url(); 73 summary->resource_url = request->original_url();
74 summary->resource_type = info->GetResourceType(); 74 summary->resource_type = info->GetResourceType();
75 summary->priority = request->priority();
75 request->GetMimeType(&summary->mime_type); 76 request->GetMimeType(&summary->mime_type);
76 summary->was_cached = request->was_cached(); 77 summary->was_cached = request->was_cached();
77 78
78 // Use the mime_type to determine the resource type for subresources since 79 // Use the mime_type to determine the resource type for subresources since
79 // types such as PREFETCH, SUB_RESOURCE, etc are not useful. 80 // types such as PREFETCH, SUB_RESOURCE, etc are not useful.
80 if (summary->resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { 81 if (summary->resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
81 summary->resource_type = 82 summary->resource_type =
82 ResourcePrefetchPredictor::GetResourceTypeFromMimeType( 83 ResourcePrefetchPredictor::GetResourceTypeFromMimeType(
83 summary->mime_type, 84 summary->mime_type,
84 summary->resource_type); 85 summary->resource_type);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 summary)); 195 summary));
195 196
196 ReportRequestStats(REQUEST_STATS_TOTAL_PROCESSED_RESPONSES); 197 ReportRequestStats(REQUEST_STATS_TOTAL_PROCESSED_RESPONSES);
197 if (request_info && 198 if (request_info &&
198 request_info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME) { 199 request_info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME) {
199 ReportMainFrameRequestStats(MAIN_FRAME_REQUEST_STATS_PROCESSED_RESPONSES); 200 ReportMainFrameRequestStats(MAIN_FRAME_REQUEST_STATS_PROCESSED_RESPONSES);
200 } 201 }
201 } 202 }
202 203
203 } // namespace chrome_browser_net 204 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/predictors/resource_prefetch_predictor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698