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

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

Issue 2676163002: Refactor the forPreload flag to mean speculative preload. (Closed)
Patch Set: Review comments Created 3 years, 10 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 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return ResourceLoadPriorityUnresolved; 150 return ResourceLoadPriorityUnresolved;
151 } 151 }
152 152
153 } // namespace 153 } // namespace
154 154
155 ResourceLoadPriority ResourceFetcher::computeLoadPriority( 155 ResourceLoadPriority ResourceFetcher::computeLoadPriority(
156 Resource::Type type, 156 Resource::Type type,
157 const ResourceRequest& resourceRequest, 157 const ResourceRequest& resourceRequest,
158 ResourcePriority::VisibilityStatus visibility, 158 ResourcePriority::VisibilityStatus visibility,
159 FetchRequest::DeferOption deferOption, 159 FetchRequest::DeferOption deferOption,
160 bool forPreload) { 160 bool speculativePreload) {
161 ResourceLoadPriority priority = typeToPriority(type); 161 ResourceLoadPriority priority = typeToPriority(type);
162 162
163 // Visible resources (images in practice) get a boost to High priority. 163 // Visible resources (images in practice) get a boost to High priority.
164 if (visibility == ResourcePriority::Visible) 164 if (visibility == ResourcePriority::Visible)
165 priority = ResourceLoadPriorityHigh; 165 priority = ResourceLoadPriorityHigh;
166 166
167 // Resources before the first image are considered "early" in the document and 167 // Resources before the first image are considered "early" in the document and
168 // resources after the first image are "late" in the document. Important to 168 // resources after the first image are "late" in the document. Important to
169 // note that this is based on when the preload scanner discovers a resource 169 // note that this is based on when the preload scanner discovers a resource
170 // for the most part so the main parser may not have reached the image element 170 // for the most part so the main parser may not have reached the image element
171 // yet. 171 // yet.
172 if (type == Resource::Image) 172 if (type == Resource::Image)
173 m_imageFetched = true; 173 m_imageFetched = true;
174 174
175 if (FetchRequest::IdleLoad == deferOption) { 175 if (FetchRequest::IdleLoad == deferOption) {
176 priority = ResourceLoadPriorityVeryLow; 176 priority = ResourceLoadPriorityVeryLow;
177 } else if (type == Resource::Script) { 177 } else if (type == Resource::Script) {
178 // Special handling for scripts. 178 // Special handling for scripts.
179 // Default/Parser-Blocking/Preload early in document: High (set in 179 // Default/Parser-Blocking/Preload early in document: High (set in
180 // typeToPriority) 180 // typeToPriority)
181 // Async/Defer: Low Priority (applies to both preload and parser-inserted) 181 // Async/Defer: Low Priority (applies to both preload and parser-inserted)
182 // Preload late in document: Medium 182 // Preload late in document: Medium
183 if (FetchRequest::LazyLoad == deferOption) 183 if (FetchRequest::LazyLoad == deferOption) {
184 priority = ResourceLoadPriorityLow; 184 priority = ResourceLoadPriorityLow;
185 else if (forPreload && m_imageFetched) 185 } else if (speculativePreload && m_imageFetched) {
186 // Speculative preload is used as a signal for scripts at the bottom of
187 // the document.
186 priority = ResourceLoadPriorityMedium; 188 priority = ResourceLoadPriorityMedium;
189 }
187 } else if (FetchRequest::LazyLoad == deferOption) { 190 } else if (FetchRequest::LazyLoad == deferOption) {
188 priority = ResourceLoadPriorityVeryLow; 191 priority = ResourceLoadPriorityVeryLow;
189 } 192 }
190 193
191 // A manually set priority acts as a floor. This is used to ensure that 194 // A manually set priority acts as a floor. This is used to ensure that
192 // synchronous requests are always given the highest possible priority, as 195 // synchronous requests are always given the highest possible priority, as
193 // well as to ensure that there isn't priority churn if images move in and out 196 // well as to ensure that there isn't priority churn if images move in and out
194 // of the viewport, or is displayed more than once, both in and out of the 197 // of the viewport, or is displayed more than once, both in and out of the
195 // viewport. 198 // viewport.
196 return std::max(context().modifyPriorityForExperiments(priority), 199 return std::max(context().modifyPriorityForExperiments(priority),
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return resource.get(); 272 return resource.get();
270 } 273 }
271 274
272 bool ResourceFetcher::isControlledByServiceWorker() const { 275 bool ResourceFetcher::isControlledByServiceWorker() const {
273 return context().isControlledByServiceWorker(); 276 return context().isControlledByServiceWorker();
274 } 277 }
275 278
276 bool ResourceFetcher::resourceNeedsLoad(Resource* resource, 279 bool ResourceFetcher::resourceNeedsLoad(Resource* resource,
277 const FetchRequest& request, 280 const FetchRequest& request,
278 RevalidationPolicy policy) { 281 RevalidationPolicy policy) {
279 // Defer a font load until it is actually needed unless this is a preload. 282 // Defer a font load until it is actually needed unless this is a link
280 if (resource->getType() == Resource::Font && !request.forPreload()) 283 // preload.
284 if (resource->getType() == Resource::Font && !request.isLinkPreload())
281 return false; 285 return false;
282 if (resource->isImage() && shouldDeferImageLoad(resource->url())) 286 if (resource->isImage() && shouldDeferImageLoad(resource->url()))
283 return false; 287 return false;
284 return policy != Use || resource->stillNeedsLoad(); 288 return policy != Use || resource->stillNeedsLoad();
285 } 289 }
286 290
287 // Limit the number of URLs in m_validatedURLs to avoid memory bloat. 291 // Limit the number of URLs in m_validatedURLs to avoid memory bloat.
288 // http://crbug.com/52411 292 // http://crbug.com/52411
289 static const int kMaxValidatedURLsSize = 10000; 293 static const int kMaxValidatedURLsSize = 10000;
290 294
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 const FetchRequest& request, 412 const FetchRequest& request,
409 const ResourceFactory& factory, 413 const ResourceFactory& factory,
410 ResourceRequestBlockedReason blockedReason) { 414 ResourceRequestBlockedReason blockedReason) {
411 Resource* resource = factory.create(request.resourceRequest(), 415 Resource* resource = factory.create(request.resourceRequest(),
412 request.options(), request.charset()); 416 request.options(), request.charset());
413 resource->error(ResourceError::cancelledDueToAccessCheckError(request.url(), 417 resource->error(ResourceError::cancelledDueToAccessCheckError(request.url(),
414 blockedReason)); 418 blockedReason));
415 return resource; 419 return resource;
416 } 420 }
417 421
418 void ResourceFetcher::moveCachedNonBlockingResourceToBlocking( 422 void ResourceFetcher::makePreloadedResourceBlockOnloadIfNeeded(
419 Resource* resource, 423 Resource* resource,
420 const FetchRequest& request) { 424 const FetchRequest& request) {
421 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue 425 // TODO(yoav): Test that non-blocking resources (video/audio/track) continue
422 // to not-block even after being preloaded and discovered. 426 // to not-block even after being preloaded and discovered.
423 if (resource && resource->loader() && 427 if (resource && resource->loader() &&
424 resource->isLoadEventBlockingResourceType() && 428 resource->isLoadEventBlockingResourceType() &&
425 m_nonBlockingLoaders.contains(resource->loader()) && 429 resource->isLinkPreload() && !request.isLinkPreload() &&
426 resource->isLinkPreload() && !request.forPreload()) { 430 m_nonBlockingLoaders.contains(resource->loader())) {
427 m_nonBlockingLoaders.remove(resource->loader()); 431 m_nonBlockingLoaders.remove(resource->loader());
428 m_loaders.insert(resource->loader()); 432 m_loaders.insert(resource->loader());
429 } 433 }
430 } 434 }
431 435
432 void ResourceFetcher::updateMemoryCacheStats(Resource* resource, 436 void ResourceFetcher::updateMemoryCacheStats(Resource* resource,
433 RevalidationPolicy policy, 437 RevalidationPolicy policy,
434 const FetchRequest& request, 438 const FetchRequest& request,
435 const ResourceFactory& factory, 439 const ResourceFactory& factory,
436 bool isStaticData) const { 440 bool isStaticData) const {
437 if (isStaticData) 441 if (isStaticData)
438 return; 442 return;
439 443
440 if (request.forPreload()) { 444 if (request.isSpeculativePreload() || request.isLinkPreload()) {
441 DEFINE_RESOURCE_HISTOGRAM("Preload."); 445 DEFINE_RESOURCE_HISTOGRAM("Preload.");
442 } else { 446 } else {
443 DEFINE_RESOURCE_HISTOGRAM(""); 447 DEFINE_RESOURCE_HISTOGRAM("");
444 } 448 }
445 449
446 // Aims to count Resource only referenced from MemoryCache (i.e. what would be 450 // Aims to count Resource only referenced from MemoryCache (i.e. what would be
447 // dead if MemoryCache holds weak references to Resource). Currently we check 451 // dead if MemoryCache holds weak references to Resource). Currently we check
448 // references to Resource from ResourceClient and |m_preloads| only, because 452 // references to Resource from ResourceClient and |m_preloads| only, because
449 // they are major sources of references. 453 // they are major sources of references.
450 if (resource && !resource->isAlive() && 454 if (resource && !resource->isAlive() &&
(...skipping 16 matching lines...) Expand all
467 471
468 context().populateResourceRequest( 472 context().populateResourceRequest(
469 factory.type(), request.clientHintsPreferences(), 473 factory.type(), request.clientHintsPreferences(),
470 request.getResourceWidth(), resourceRequest); 474 request.getResourceWidth(), resourceRequest);
471 475
472 if (!request.url().isValid()) 476 if (!request.url().isValid())
473 return Abort; 477 return Abort;
474 478
475 resourceRequest.setPriority(computeLoadPriority( 479 resourceRequest.setPriority(computeLoadPriority(
476 factory.type(), request.resourceRequest(), ResourcePriority::NotVisible, 480 factory.type(), request.resourceRequest(), ResourcePriority::NotVisible,
477 request.defer(), request.forPreload())); 481 request.defer(), request.isSpeculativePreload()));
478 initializeResourceRequest(resourceRequest, factory.type(), request.defer()); 482 initializeResourceRequest(resourceRequest, factory.type(), request.defer());
479 network_instrumentation::resourcePrioritySet(identifier, 483 network_instrumentation::resourcePrioritySet(identifier,
480 resourceRequest.priority()); 484 resourceRequest.priority());
481 485
482 blockedReason = context().canRequest( 486 blockedReason = context().canRequest(
483 factory.type(), resourceRequest, 487 factory.type(), resourceRequest,
484 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()), 488 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()),
485 request.options(), request.forPreload(), request.getOriginRestriction()); 489 request.options(), request.isSpeculativePreload()
490 ? FetchContext::ReportingPolicy::SuppressReporting
491 : FetchContext::ReportingPolicy::Report,
492 request.getOriginRestriction());
486 if (blockedReason != ResourceRequestBlockedReason::None) { 493 if (blockedReason != ResourceRequestBlockedReason::None) {
487 DCHECK(!substituteData.forceSynchronousLoad()); 494 DCHECK(!substituteData.forceSynchronousLoad());
488 return Block; 495 return Block;
489 } 496 }
490 497
491 context().willStartLoadingResource( 498 context().willStartLoadingResource(
492 identifier, resourceRequest, factory.type(), 499 identifier, resourceRequest, factory.type(),
493 request.options().initiatorInfo.name, request.forPreload()); 500 request.options().initiatorInfo.name,
501 (request.isSpeculativePreload()
502 ? FetchContext::V8ActivityLoggingPolicy::SuppressLogging
503 : FetchContext::V8ActivityLoggingPolicy::Log));
494 if (!request.url().isValid()) 504 if (!request.url().isValid())
495 return Abort; 505 return Abort;
496 506
497 resourceRequest.setAllowStoredCredentials( 507 resourceRequest.setAllowStoredCredentials(
498 request.options().allowCredentials == AllowStoredCredentials); 508 request.options().allowCredentials == AllowStoredCredentials);
499 return Continue; 509 return Continue;
500 } 510 }
501 511
502 Resource* ResourceFetcher::requestResource( 512 Resource* ResourceFetcher::requestResource(
503 FetchRequest& request, 513 FetchRequest& request,
(...skipping 28 matching lines...) Expand all
532 // to be decoded only on demand. These data URLs are allowed to be 542 // to be decoded only on demand. These data URLs are allowed to be
533 // processed using the normal ResourceFetcher machinery. 543 // processed using the normal ResourceFetcher machinery.
534 if (!resource && !isDataUrl && m_archive) 544 if (!resource && !isDataUrl && m_archive)
535 return nullptr; 545 return nullptr;
536 } 546 }
537 if (!resource) { 547 if (!resource) {
538 resource = 548 resource =
539 memoryCache()->resourceForURL(request.url(), getCacheIdentifier()); 549 memoryCache()->resourceForURL(request.url(), getCacheIdentifier());
540 } 550 }
541 551
542 // See if we can use an existing resource from the cache. If so, we need to 552 // If we got a preloaded resource from the cache for a non-preload request,
543 // move it to be load blocking. 553 // we may need to make it block the onload event.
544 moveCachedNonBlockingResourceToBlocking(resource, request); 554 makePreloadedResourceBlockOnloadIfNeeded(resource, request);
545 555
546 const RevalidationPolicy policy = determineRevalidationPolicy( 556 const RevalidationPolicy policy = determineRevalidationPolicy(
547 factory.type(), request, resource, isStaticData); 557 factory.type(), request, resource, isStaticData);
548 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy", 558 TRACE_EVENT_INSTANT1("blink", "ResourceFetcher::determineRevalidationPolicy",
549 TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy); 559 TRACE_EVENT_SCOPE_THREAD, "revalidationPolicy", policy);
550 560
551 updateMemoryCacheStats(resource, policy, request, factory, isStaticData); 561 updateMemoryCacheStats(resource, policy, request, factory, isStaticData);
552 562
553 switch (policy) { 563 switch (policy) {
554 case Reload: 564 case Reload:
555 memoryCache()->remove(resource); 565 memoryCache()->remove(resource);
556 // Fall through 566 // Fall through
557 case Load: 567 case Load:
558 resource = createResourceForLoading(request, request.charset(), factory); 568 resource = createResourceForLoading(request, request.charset(), factory);
559 break; 569 break;
560 case Revalidate: 570 case Revalidate:
561 initializeRevalidation(resourceRequest, resource); 571 initializeRevalidation(resourceRequest, resource);
562 break; 572 break;
563 case Use: 573 case Use:
564 if (resource->isLinkPreload() && !request.isLinkPreload()) 574 if (resource->isLinkPreload() && !request.isLinkPreload())
565 resource->setLinkPreload(false); 575 resource->setLinkPreload(false);
566 break; 576 break;
567 } 577 }
568 if (!resource) 578 if (!resource)
569 return nullptr; 579 return nullptr;
570 if (resource->getType() != factory.type()) { 580 if (resource->getType() != factory.type()) {
571 DCHECK(request.forPreload()); 581 DCHECK(request.isSpeculativePreload() || request.isLinkPreload());
582 // TODO(yoav): What's the scenario where this can actually happen?
572 return nullptr; 583 return nullptr;
573 } 584 }
574 585
575 if (!resource->isAlive()) 586 if (!resource->isAlive())
576 m_deadStatsRecorder.update(policy); 587 m_deadStatsRecorder.update(policy);
577 588
578 if (policy != Use) 589 if (policy != Use)
579 resource->setIdentifier(identifier); 590 resource->setIdentifier(identifier);
580 591
581 if (!request.forPreload() || policy != Use) { 592 // TODO(yoav): It is not clear why preloads are exempt from this check. Can we
593 // remove the exemption?
594 if (!request.isSpeculativePreload() || policy != Use) {
582 // When issuing another request for a resource that is already in-flight 595 // When issuing another request for a resource that is already in-flight
583 // make sure to not demote the priority of the in-flight request. If the new 596 // make sure to not demote the priority of the in-flight request. If the new
584 // request isn't at the same priority as the in-flight request, only allow 597 // request isn't at the same priority as the in-flight request, only allow
585 // promotions. This can happen when a visible image's priority is increased 598 // promotions. This can happen when a visible image's priority is increased
586 // and then another reference to the image is parsed (which would be at a 599 // and then another reference to the image is parsed (which would be at a
587 // lower priority). 600 // lower priority).
588 if (resourceRequest.priority() > resource->resourceRequest().priority()) 601 if (resourceRequest.priority() > resource->resourceRequest().priority())
589 resource->didChangePriority(resourceRequest.priority(), 0); 602 resource->didChangePriority(resourceRequest.priority(), 0);
603 // TODO(yoav): I'd expect the stated scenario to not go here, as its policy
604 // would be Use.
590 } 605 }
591 606
592 // If only the fragment identifiers differ, it is the same resource. 607 // If only the fragment identifiers differ, it is the same resource.
593 DCHECK(equalIgnoringFragmentIdentifier(resource->url(), request.url())); 608 DCHECK(equalIgnoringFragmentIdentifier(resource->url(), request.url()));
594 requestLoadStarted( 609 requestLoadStarted(
595 identifier, resource, request, 610 identifier, resource, request,
596 policy == Use ? ResourceLoadingFromCache : ResourceLoadingFromNetwork, 611 policy == Use ? ResourceLoadingFromCache : ResourceLoadingFromNetwork,
597 isStaticData); 612 isStaticData);
598 m_documentResources.set( 613 m_documentResources.set(
599 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()), resource); 614 MemoryCache::removeFragmentIdentifierIfNeeded(request.url()), resource);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 const String cacheIdentifier = getCacheIdentifier(); 716 const String cacheIdentifier = getCacheIdentifier();
702 DCHECK(!memoryCache()->resourceForURL(request.resourceRequest().url(), 717 DCHECK(!memoryCache()->resourceForURL(request.resourceRequest().url(),
703 cacheIdentifier)); 718 cacheIdentifier));
704 719
705 RESOURCE_LOADING_DVLOG(1) << "Loading Resource for " 720 RESOURCE_LOADING_DVLOG(1) << "Loading Resource for "
706 << request.resourceRequest().url().elidedString(); 721 << request.resourceRequest().url().elidedString();
707 722
708 Resource* resource = 723 Resource* resource =
709 factory.create(request.resourceRequest(), request.options(), charset); 724 factory.create(request.resourceRequest(), request.options(), charset);
710 resource->setLinkPreload(request.isLinkPreload()); 725 resource->setLinkPreload(request.isLinkPreload());
711 if (request.forPreload()) { 726 if (request.isSpeculativePreload()) {
712 resource->setPreloadDiscoveryTime(request.preloadDiscoveryTime()); 727 resource->setPreloadDiscoveryTime(request.preloadDiscoveryTime());
713 } 728 }
714 resource->setCacheIdentifier(cacheIdentifier); 729 resource->setCacheIdentifier(cacheIdentifier);
715 730
716 // - Don't add main resource to cache to prevent reuse. 731 // - Don't add main resource to cache to prevent reuse.
717 // - Don't add the resource if its body will not be stored. 732 // - Don't add the resource if its body will not be stored.
718 if (factory.type() != Resource::MainResource && 733 if (factory.type() != Resource::MainResource &&
719 request.options().dataBufferingPolicy != DoNotBufferData) { 734 request.options().dataBufferingPolicy != DoNotBufferData) {
720 memoryCache()->add(resource); 735 memoryCache()->add(resource);
721 } 736 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 if (existingResource->mustRefetchDueToIntegrityMetadata(fetchRequest)) { 819 if (existingResource->mustRefetchDueToIntegrityMetadata(fetchRequest)) {
805 RecordSriResourceIntegrityMismatchEvent(RefetchDueToIntegrityMismatch); 820 RecordSriResourceIntegrityMismatchEvent(RefetchDueToIntegrityMismatch);
806 return Reload; 821 return Reload;
807 } 822 }
808 823
809 // Service Worker's CORS fallback message must not be cached. 824 // Service Worker's CORS fallback message must not be cached.
810 if (existingResource->response().wasFallbackRequiredByServiceWorker()) 825 if (existingResource->response().wasFallbackRequiredByServiceWorker())
811 return Reload; 826 return Reload;
812 827
813 // We already have a preload going for this URL. 828 // We already have a preload going for this URL.
814 if (fetchRequest.forPreload() && existingResource->isPreloaded()) 829 if (fetchRequest.isSpeculativePreload() && existingResource->isPreloaded())
815 return Use; 830 return Use;
816 831
817 // If the same URL has been loaded as a different type, we need to reload. 832 // If the same URL has been loaded as a different type, we need to reload.
818 if (existingResource->getType() != type) { 833 if (existingResource->getType() != type) {
819 // FIXME: If existingResource is a Preload and the new type is LinkPrefetch 834 // FIXME: If existingResource is a Preload and the new type is LinkPrefetch
820 // We really should discard the new prefetch since the preload has more 835 // We really should discard the new prefetch since the preload has more
821 // specific type information! crbug.com/379893 836 // specific type information! crbug.com/379893
822 // fast/dom/HTMLLinkElement/link-and-subresource-test hits this case. 837 // fast/dom/HTMLLinkElement/link-and-subresource-test hits this case.
823 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy " 838 RESOURCE_LOADING_DVLOG(1) << "ResourceFetcher::determineRevalidationPolicy "
824 "reloading due to type mismatch."; 839 "reloading due to type mismatch.";
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 const KURL& url, 1487 const KURL& url,
1473 WebURLRequest::RequestContext requestContext, 1488 WebURLRequest::RequestContext requestContext,
1474 const AtomicString& initiatorName) { 1489 const AtomicString& initiatorName) {
1475 if (cachedResource(url)) 1490 if (cachedResource(url))
1476 return; 1491 return;
1477 ResourceRequest resourceRequest(url); 1492 ResourceRequest resourceRequest(url);
1478 resourceRequest.setRequestContext(requestContext); 1493 resourceRequest.setRequestContext(requestContext);
1479 FetchRequest request(resourceRequest, initiatorName, resource->options()); 1494 FetchRequest request(resourceRequest, initiatorName, resource->options());
1480 context().canRequest(resource->getType(), resource->lastResourceRequest(), 1495 context().canRequest(resource->getType(), resource->lastResourceRequest(),
1481 resource->lastResourceRequest().url(), request.options(), 1496 resource->lastResourceRequest().url(), request.options(),
1482 false, request.getOriginRestriction()); 1497 FetchContext::ReportingPolicy::Report,
1498 request.getOriginRestriction());
1483 requestLoadStarted(resource->identifier(), resource, request, 1499 requestLoadStarted(resource->identifier(), resource, request,
1484 ResourceLoadingFromCache); 1500 ResourceLoadingFromCache);
1485 } 1501 }
1486 1502
1487 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder() 1503 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder()
1488 : m_useCount(0), m_revalidateCount(0), m_loadCount(0) {} 1504 : m_useCount(0), m_revalidateCount(0), m_loadCount(0) {}
1489 1505
1490 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder() { 1506 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder() {
1491 DEFINE_THREAD_SAFE_STATIC_LOCAL( 1507 DEFINE_THREAD_SAFE_STATIC_LOCAL(
1492 CustomCountHistogram, hitCountHistogram, 1508 CustomCountHistogram, hitCountHistogram,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 visitor->trace(m_context); 1541 visitor->trace(m_context);
1526 visitor->trace(m_archive); 1542 visitor->trace(m_archive);
1527 visitor->trace(m_loaders); 1543 visitor->trace(m_loaders);
1528 visitor->trace(m_nonBlockingLoaders); 1544 visitor->trace(m_nonBlockingLoaders);
1529 visitor->trace(m_documentResources); 1545 visitor->trace(m_documentResources);
1530 visitor->trace(m_preloads); 1546 visitor->trace(m_preloads);
1531 visitor->trace(m_resourceTimingInfoMap); 1547 visitor->trace(m_resourceTimingInfoMap);
1532 } 1548 }
1533 1549
1534 } // namespace blink 1550 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698