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

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

Issue 578553004: Remove the "snionly" concept from the HSTS preload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ... Created 6 years, 2 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/net/predictor.h" 5 #include "chrome/browser/net/predictor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <set> 9 #include <set>
10 #include <sstream> 10 #include <sstream>
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 proxy_advisor_->Advise(url, motivation, is_preconnect); 1175 proxy_advisor_->Advise(url, motivation, is_preconnect);
1176 } 1176 }
1177 1177
1178 GURL Predictor::GetHSTSRedirectOnIOThread(const GURL& url) { 1178 GURL Predictor::GetHSTSRedirectOnIOThread(const GURL& url) {
1179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1180 1180
1181 if (!transport_security_state_) 1181 if (!transport_security_state_)
1182 return url; 1182 return url;
1183 if (!url.SchemeIs("http")) 1183 if (!url.SchemeIs("http"))
1184 return url; 1184 return url;
1185 bool sni_available = 1185 if (!transport_security_state_->ShouldUpgradeToSSL(url.host()))
1186 net::SSLConfigService::IsSNIAvailable(ssl_config_service_);
1187 if (!transport_security_state_->ShouldUpgradeToSSL(url.host(), sni_available))
1188 return url; 1186 return url;
1189 1187
1190 url::Replacements<char> replacements; 1188 url::Replacements<char> replacements;
1191 const char kNewScheme[] = "https"; 1189 const char kNewScheme[] = "https";
1192 replacements.SetScheme(kNewScheme, url::Component(0, strlen(kNewScheme))); 1190 replacements.SetScheme(kNewScheme, url::Component(0, strlen(kNewScheme)));
1193 return url.ReplaceComponents(replacements); 1191 return url.ReplaceComponents(replacements);
1194 } 1192 }
1195 1193
1196 // ---------------------- End IO methods. ------------------------------------- 1194 // ---------------------- End IO methods. -------------------------------------
1197 1195
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 } 1327 }
1330 1328
1331 void SimplePredictor::ShutdownOnUIThread() { 1329 void SimplePredictor::ShutdownOnUIThread() {
1332 SetShutdown(true); 1330 SetShutdown(true);
1333 } 1331 }
1334 1332
1335 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } 1333 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; }
1336 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } 1334 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; }
1337 1335
1338 } // namespace chrome_browser_net 1336 } // namespace chrome_browser_net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698