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

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

Issue 2437783002: DevTools Disable cache should properly handle LoadOnlyFromCache resources (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 const SubstituteData& substituteData) { 475 const SubstituteData& substituteData) {
476 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Fetch.RequestResourceTime"); 476 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.Fetch.RequestResourceTime");
477 DCHECK(request.options().synchronousPolicy == RequestAsynchronously || 477 DCHECK(request.options().synchronousPolicy == RequestAsynchronously ||
478 factory.type() == Resource::Raw || 478 factory.type() == Resource::Raw ||
479 factory.type() == Resource::XSLStyleSheet); 479 factory.type() == Resource::XSLStyleSheet);
480 480
481 context().populateRequestData(request.mutableResourceRequest()); 481 context().populateRequestData(request.mutableResourceRequest());
482 if (request.resourceRequest().httpHeaderField("Upgrade-Insecure-Requests") != 482 if (request.resourceRequest().httpHeaderField("Upgrade-Insecure-Requests") !=
483 AtomicString("1")) 483 AtomicString("1"))
484 context().upgradeInsecureRequest(request.mutableResourceRequest()); 484 context().upgradeInsecureRequest(request.mutableResourceRequest());
485
485 context().addClientHintsIfNecessary(request); 486 context().addClientHintsIfNecessary(request);
486 context().addCSPHeaderIfNecessary(factory.type(), request); 487 context().addCSPHeaderIfNecessary(factory.type(), request);
487 488
488 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url", 489 TRACE_EVENT1("blink", "ResourceFetcher::requestResource", "url",
489 urlForTraceEvent(request.url())); 490 urlForTraceEvent(request.url()));
490 491
491 if (!request.url().isValid()) 492 if (!request.url().isValid())
492 return nullptr; 493 return nullptr;
493 494
495 unsigned long identifier = createUniqueIdentifier();
496 request.mutableResourceRequest().setPriority(computeLoadPriority(
497 factory.type(), request, ResourcePriority::NotVisible));
498 initializeResourceRequest(request.mutableResourceRequest(), factory.type(),
499 request.defer());
500
494 if (!context().canRequest( 501 if (!context().canRequest(
495 factory.type(), request.resourceRequest(), 502 factory.type(), request.resourceRequest(),
496 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()), 503 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()),
497 request.options(), request.forPreload(), 504 request.options(), request.forPreload(),
498 request.getOriginRestriction())) 505 request.getOriginRestriction()))
499 return nullptr; 506 return nullptr;
500 507
501 unsigned long identifier = createUniqueIdentifier();
502 request.mutableResourceRequest().setPriority(computeLoadPriority(
503 factory.type(), request, ResourcePriority::NotVisible));
504 initializeResourceRequest(request.mutableResourceRequest(), factory.type(),
505 request.defer());
506 context().willStartLoadingResource( 508 context().willStartLoadingResource(
507 identifier, request.mutableResourceRequest(), factory.type()); 509 identifier, request.mutableResourceRequest(), factory.type());
508 if (!request.url().isValid()) 510 if (!request.url().isValid())
509 return nullptr; 511 return nullptr;
510 512
511 if (!request.forPreload()) { 513 if (!request.forPreload()) {
512 V8DOMActivityLogger* activityLogger = nullptr; 514 V8DOMActivityLogger* activityLogger = nullptr;
513 if (request.options().initiatorInfo.name == 515 if (request.options().initiatorInfo.name ==
514 FetchInitiatorTypeNames::xmlhttprequest) 516 FetchInitiatorTypeNames::xmlhttprequest)
515 activityLogger = V8DOMActivityLogger::currentActivityLogger(); 517 activityLogger = V8DOMActivityLogger::currentActivityLogger();
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 visitor->trace(m_context); 1595 visitor->trace(m_context);
1594 visitor->trace(m_archive); 1596 visitor->trace(m_archive);
1595 visitor->trace(m_loaders); 1597 visitor->trace(m_loaders);
1596 visitor->trace(m_nonBlockingLoaders); 1598 visitor->trace(m_nonBlockingLoaders);
1597 visitor->trace(m_documentResources); 1599 visitor->trace(m_documentResources);
1598 visitor->trace(m_preloads); 1600 visitor->trace(m_preloads);
1599 visitor->trace(m_resourceTimingInfoMap); 1601 visitor->trace(m_resourceTimingInfoMap);
1600 } 1602 }
1601 1603
1602 } // namespace blink 1604 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698