| OLD | NEW |
| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 532 |
| 533 if (!params.Url().IsValid()) | 533 if (!params.Url().IsValid()) |
| 534 return kAbort; | 534 return kAbort; |
| 535 | 535 |
| 536 resource_request.SetPriority(ComputeLoadPriority( | 536 resource_request.SetPriority(ComputeLoadPriority( |
| 537 factory.GetType(), params.GetResourceRequest(), | 537 factory.GetType(), params.GetResourceRequest(), |
| 538 ResourcePriority::kNotVisible, params.Defer(), | 538 ResourcePriority::kNotVisible, params.Defer(), |
| 539 params.GetSpeculativePreloadType(), params.IsLinkPreload())); | 539 params.GetSpeculativePreloadType(), params.IsLinkPreload())); |
| 540 InitializeResourceRequest(resource_request, factory.GetType(), | 540 InitializeResourceRequest(resource_request, factory.GetType(), |
| 541 params.Defer()); | 541 params.Defer()); |
| 542 network_instrumentation::resourcePrioritySet(identifier, | 542 network_instrumentation::ResourcePrioritySet(identifier, |
| 543 resource_request.Priority()); | 543 resource_request.Priority()); |
| 544 | 544 |
| 545 blocked_reason = Context().CanRequest( | 545 blocked_reason = Context().CanRequest( |
| 546 factory.GetType(), resource_request, | 546 factory.GetType(), resource_request, |
| 547 MemoryCache::RemoveFragmentIdentifierIfNeeded(params.Url()), | 547 MemoryCache::RemoveFragmentIdentifierIfNeeded(params.Url()), |
| 548 params.Options(), | 548 params.Options(), |
| 549 /* Don't send security violation reports for speculative preloads */ | 549 /* Don't send security violation reports for speculative preloads */ |
| 550 reporting_policy, params.GetOriginRestriction()); | 550 reporting_policy, params.GetOriginRestriction()); |
| 551 if (blocked_reason != ResourceRequestBlockedReason::kNone) { | 551 if (blocked_reason != ResourceRequestBlockedReason::kNone) { |
| 552 DCHECK(!substitute_data.ForceSynchronousLoad()); | 552 DCHECK(!substitute_data.ForceSynchronousLoad()); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 if (policy != kUse) | 688 if (policy != kUse) |
| 689 InsertAsPreloadIfNecessary(resource, params, factory.GetType()); | 689 InsertAsPreloadIfNecessary(resource, params, factory.GetType()); |
| 690 return resource; | 690 return resource; |
| 691 } | 691 } |
| 692 | 692 |
| 693 if (!StartLoad(resource)) | 693 if (!StartLoad(resource)) |
| 694 return nullptr; | 694 return nullptr; |
| 695 | 695 |
| 696 if (policy != kUse) | 696 if (policy != kUse) |
| 697 InsertAsPreloadIfNecessary(resource, params, factory.GetType()); | 697 InsertAsPreloadIfNecessary(resource, params, factory.GetType()); |
| 698 scoped_resource_load_tracker.resourceLoadContinuesBeyondScope(); | 698 scoped_resource_load_tracker.ResourceLoadContinuesBeyondScope(); |
| 699 | 699 |
| 700 DCHECK(!resource->ErrorOccurred() || | 700 DCHECK(!resource->ErrorOccurred() || |
| 701 params.Options().synchronous_policy == kRequestSynchronously); | 701 params.Options().synchronous_policy == kRequestSynchronously); |
| 702 return resource; | 702 return resource; |
| 703 } | 703 } |
| 704 | 704 |
| 705 void ResourceFetcher::ResourceTimingReportTimerFired(TimerBase* timer) { | 705 void ResourceFetcher::ResourceTimingReportTimerFired(TimerBase* timer) { |
| 706 DCHECK_EQ(timer, &resource_timing_report_timer_); | 706 DCHECK_EQ(timer, &resource_timing_report_timer_); |
| 707 Vector<RefPtr<ResourceTimingInfo>> timing_reports; | 707 Vector<RefPtr<ResourceTimingInfo>> timing_reports; |
| 708 timing_reports.swap(scheduled_resource_timing_reports_); | 708 timing_reports.swap(scheduled_resource_timing_reports_); |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 | 1420 |
| 1421 ResourcePriority resource_priority = resource->PriorityFromObservers(); | 1421 ResourcePriority resource_priority = resource->PriorityFromObservers(); |
| 1422 ResourceLoadPriority resource_load_priority = | 1422 ResourceLoadPriority resource_load_priority = |
| 1423 ComputeLoadPriority(Resource::kImage, resource->GetResourceRequest(), | 1423 ComputeLoadPriority(Resource::kImage, resource->GetResourceRequest(), |
| 1424 resource_priority.visibility); | 1424 resource_priority.visibility); |
| 1425 if (resource_load_priority == resource->GetResourceRequest().Priority()) | 1425 if (resource_load_priority == resource->GetResourceRequest().Priority()) |
| 1426 continue; | 1426 continue; |
| 1427 | 1427 |
| 1428 resource->DidChangePriority(resource_load_priority, | 1428 resource->DidChangePriority(resource_load_priority, |
| 1429 resource_priority.intra_priority_value); | 1429 resource_priority.intra_priority_value); |
| 1430 network_instrumentation::resourcePrioritySet(resource->Identifier(), | 1430 network_instrumentation::ResourcePrioritySet(resource->Identifier(), |
| 1431 resource_load_priority); | 1431 resource_load_priority); |
| 1432 Context().DispatchDidChangeResourcePriority( | 1432 Context().DispatchDidChangeResourcePriority( |
| 1433 resource->Identifier(), resource_load_priority, | 1433 resource->Identifier(), resource_load_priority, |
| 1434 resource_priority.intra_priority_value); | 1434 resource_priority.intra_priority_value); |
| 1435 } | 1435 } |
| 1436 } | 1436 } |
| 1437 | 1437 |
| 1438 void ResourceFetcher::ReloadLoFiImages() { | 1438 void ResourceFetcher::ReloadLoFiImages() { |
| 1439 for (const auto& document_resource : document_resources_) { | 1439 for (const auto& document_resource : document_resources_) { |
| 1440 Resource* resource = document_resource.value.Get(); | 1440 Resource* resource = document_resource.value.Get(); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 visitor->Trace(context_); | 1612 visitor->Trace(context_); |
| 1613 visitor->Trace(archive_); | 1613 visitor->Trace(archive_); |
| 1614 visitor->Trace(loaders_); | 1614 visitor->Trace(loaders_); |
| 1615 visitor->Trace(non_blocking_loaders_); | 1615 visitor->Trace(non_blocking_loaders_); |
| 1616 visitor->Trace(document_resources_); | 1616 visitor->Trace(document_resources_); |
| 1617 visitor->Trace(preloads_); | 1617 visitor->Trace(preloads_); |
| 1618 visitor->Trace(resource_timing_info_map_); | 1618 visitor->Trace(resource_timing_info_map_); |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 } // namespace blink | 1621 } // namespace blink |
| OLD | NEW |