OLD | NEW |
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 Loading... |
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 |
OLD | NEW |