OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(ResourceLoa
dPriority priority, Resource::Type type, const FetchRequest& request) | 682 ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(ResourceLoa
dPriority priority, Resource::Type type, const FetchRequest& request) |
683 { | 683 { |
684 // An image fetch is used to distinguish between "early" and "late" scripts
in a document | 684 // An image fetch is used to distinguish between "early" and "late" scripts
in a document |
685 if (type == Resource::Image) | 685 if (type == Resource::Image) |
686 m_imageFetched = true; | 686 m_imageFetched = true; |
687 | 687 |
688 // If Settings is null, we can't verify any experiments are in force. | 688 // If Settings is null, we can't verify any experiments are in force. |
689 if (!frame()->settings()) | 689 if (!frame()->settings()) |
690 return priority; | 690 return priority; |
691 | 691 |
692 if (!frame()->isMainFrame() && frame()->settings()->lowPriorityIframes() &&
type == Resource::MainResource) | 692 // If enabled, drop the priority of all resources in a subframe. |
| 693 if (frame()->settings()->lowPriorityIframes() && !frame()->isMainFrame()) |
693 return ResourceLoadPriorityVeryLow; | 694 return ResourceLoadPriorityVeryLow; |
694 | 695 |
695 // Async/Defer scripts. | 696 // Async/Defer scripts. |
696 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer()) | 697 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer()) |
697 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc
eLoadPriorityMedium : ResourceLoadPriorityLow; | 698 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc
eLoadPriorityMedium : ResourceLoadPriorityLow; |
698 | 699 |
699 // Runtime experiment that change how we prioritize resources. | 700 // Runtime experiment that change how we prioritize resources. |
700 // The toggles do not depend on each other and can be flipped individually | 701 // The toggles do not depend on each other and can be flipped individually |
701 // though the cumulative result will depend on the interaction between them. | 702 // though the cumulative result will depend on the interaction between them. |
702 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g
pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing | 703 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g
pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing |
(...skipping 27 matching lines...) Expand all Loading... |
730 } | 731 } |
731 | 732 |
732 DEFINE_TRACE(FrameFetchContext) | 733 DEFINE_TRACE(FrameFetchContext) |
733 { | 734 { |
734 visitor->trace(m_document); | 735 visitor->trace(m_document); |
735 visitor->trace(m_documentLoader); | 736 visitor->trace(m_documentLoader); |
736 FetchContext::trace(visitor); | 737 FetchContext::trace(visitor); |
737 } | 738 } |
738 | 739 |
739 } // namespace blink | 740 } // namespace blink |
OLD | NEW |