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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2109633002: Executed HTTPS upgrade before notifying the start of the provisional load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nasko@'s comments. Created 4 years, 5 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 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // |m_preloads| only, because they are major sources of references. 403 // |m_preloads| only, because they are major sources of references.
404 if (resource && !resource->hasClientsOrObservers() && (!m_preloads || !m_pre loads->contains(resource))) { 404 if (resource && !resource->hasClientsOrObservers() && (!m_preloads || !m_pre loads->contains(resource))) {
405 DEFINE_RESOURCE_HISTOGRAM("Dead."); 405 DEFINE_RESOURCE_HISTOGRAM("Dead.");
406 } 406 }
407 } 407 }
408 408
409 Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource Factory& factory, const SubstituteData& substituteData) 409 Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource Factory& factory, const SubstituteData& substituteData)
410 { 410 {
411 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || facto ry.type() == Resource::Raw || factory.type() == Resource::XSLStyleSheet); 411 ASSERT(request.options().synchronousPolicy == RequestAsynchronously || facto ry.type() == Resource::Raw || factory.type() == Resource::XSLStyleSheet);
412 412
413 context().upgradeInsecureRequest(request); 413 if (request.resourceRequest().httpHeaderField("Upgrade-Insecure-Requests") ! = AtomicString("1"))
Mike West 2016/07/04 08:33:25 1. Can you add a comment describing the rationale
carlosk 2016/07/04 09:22:59 Both done. Much better indeed.
414 context().upgradeInsecureRequest(request.mutableResourceRequest());
414 context().addClientHintsIfNecessary(request); 415 context().addClientHintsIfNecessary(request);
415 context().addCSPHeaderIfNecessary(factory.type(), request); 416 context().addCSPHeaderIfNecessary(factory.type(), request);
416 417
417 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url", urlForTrace Event(request.url())); 418 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url", urlForTrace Event(request.url()));
418 419
419 if (!request.url().isValid()) 420 if (!request.url().isValid())
420 return nullptr; 421 return nullptr;
421 422
422 if (!context().canRequest(factory.type(), request.resourceRequest(), MemoryC ache::removeFragmentIdentifierIfNeeded(request.url()), request.options(), reques t.forPreload(), request.getOriginRestriction())) 423 if (!context().canRequest(factory.type(), request.resourceRequest(), MemoryC ache::removeFragmentIdentifierIfNeeded(request.url()), request.options(), reques t.forPreload(), request.getOriginRestriction()))
423 return nullptr; 424 return nullptr;
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 visitor->trace(m_context); 1262 visitor->trace(m_context);
1262 visitor->trace(m_archive); 1263 visitor->trace(m_archive);
1263 visitor->trace(m_loaders); 1264 visitor->trace(m_loaders);
1264 visitor->trace(m_nonBlockingLoaders); 1265 visitor->trace(m_nonBlockingLoaders);
1265 visitor->trace(m_documentResources); 1266 visitor->trace(m_documentResources);
1266 visitor->trace(m_preloads); 1267 visitor->trace(m_preloads);
1267 visitor->trace(m_resourceTimingInfoMap); 1268 visitor->trace(m_resourceTimingInfoMap);
1268 } 1269 }
1269 1270
1270 } // namespace blink 1271 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698