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

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

Issue 16514008: Add metrics for calculating precision/recall of link navigation pre-connect triggers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 7 years, 6 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/net/predictor.h » ('j') | chrome/browser/net/predictor.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/connect_interceptor.h" 5 #include "chrome/browser/net/connect_interceptor.h"
6 6
7 #include "chrome/browser/net/predictor.h" 7 #include "chrome/browser/net/predictor.h"
8 #include "net/base/load_flags.h" 8 #include "net/base/load_flags.h"
9 #include "net/url_request/url_request.h" 9 #include "net/url_request/url_request.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // We've already made any/all predictions when we navigated to the 64 // We've already made any/all predictions when we navigated to the
65 // referring host, so we can bail out here. 65 // referring host, so we can bail out here.
66 // We don't update the RecentlySeen() time because any preconnections 66 // We don't update the RecentlySeen() time because any preconnections
67 // need to be made at the first navigation (i.e., when referer was loaded) 67 // need to be made at the first navigation (i.e., when referer was loaded)
68 // and wouldn't have waited for this current request navigation. 68 // and wouldn't have waited for this current request navigation.
69 return; 69 return;
70 } 70 }
71 } 71 }
72 timed_cache_.SetRecentlySeen(request_scheme_host); 72 timed_cache_.SetRecentlySeen(request_scheme_host);
73 73
74 predictor_->RecordPreconnectNavigationStats(request_scheme_host);
75
76 // Subresources for main frames usually get predicted when we detected the 74 // Subresources for main frames usually get predicted when we detected the
77 // main frame request - way back in RenderViewHost::Navigate. So only handle 75 // main frame request - way back in RenderViewHost::Navigate. So only handle
78 // predictions now for subresources or for redirected hosts. 76 // predictions now for subresources or for redirected hosts.
79 if ((request->load_flags() & net::LOAD_SUB_FRAME) || redirected_host) 77 if ((request->load_flags() & net::LOAD_SUB_FRAME) || redirected_host)
80 predictor_->PredictFrameSubresources(request_scheme_host, 78 predictor_->PredictFrameSubresources(request_scheme_host,
81 request->first_party_for_cookies()); 79 request->first_party_for_cookies());
82 return; 80 return;
83 } 81 }
84 82
85 } // namespace chrome_browser_net 83 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/predictor.h » ('j') | chrome/browser/net/predictor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698