| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(ResourceLoa
dPriority priority, Resource::Type type, const FetchRequest& request) | 669 ResourceLoadPriority FrameFetchContext::modifyPriorityForExperiments(ResourceLoa
dPriority priority, Resource::Type type, const FetchRequest& request) |
| 670 { | 670 { |
| 671 // An image fetch is used to distinguish between "early" and "late" scripts
in a document | 671 // An image fetch is used to distinguish between "early" and "late" scripts
in a document |
| 672 if (type == Resource::Image) | 672 if (type == Resource::Image) |
| 673 m_imageFetched = true; | 673 m_imageFetched = true; |
| 674 | 674 |
| 675 // If Settings is null, we can't verify any experiments are in force. | 675 // If Settings is null, we can't verify any experiments are in force. |
| 676 if (!frame()->settings()) | 676 if (!frame()->settings()) |
| 677 return priority; | 677 return priority; |
| 678 | 678 |
| 679 if (!frame()->isMainFrame() && frame()->settings()->lowPriorityIframes() &&
type == Resource::MainResource) | 679 // If enabled, drop the priority of all resources in a subframe. |
| 680 if (frame()->settings()->lowPriorityIframes() && !frame()->isMainFrame()) |
| 680 return ResourceLoadPriorityVeryLow; | 681 return ResourceLoadPriorityVeryLow; |
| 681 | 682 |
| 682 // Async/Defer scripts. | 683 // Async/Defer scripts. |
| 683 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer()) | 684 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer()) |
| 684 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc
eLoadPriorityMedium : ResourceLoadPriorityLow; | 685 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc
eLoadPriorityMedium : ResourceLoadPriorityLow; |
| 685 | 686 |
| 686 // Runtime experiment that change how we prioritize resources. | 687 // Runtime experiment that change how we prioritize resources. |
| 687 // The toggles do not depend on each other and can be flipped individually | 688 // The toggles do not depend on each other and can be flipped individually |
| 688 // though the cumulative result will depend on the interaction between them. | 689 // though the cumulative result will depend on the interaction between them. |
| 689 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g
pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing | 690 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g
pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing |
| (...skipping 27 matching lines...) Expand all Loading... |
| 717 } | 718 } |
| 718 | 719 |
| 719 DEFINE_TRACE(FrameFetchContext) | 720 DEFINE_TRACE(FrameFetchContext) |
| 720 { | 721 { |
| 721 visitor->trace(m_document); | 722 visitor->trace(m_document); |
| 722 visitor->trace(m_documentLoader); | 723 visitor->trace(m_documentLoader); |
| 723 FetchContext::trace(visitor); | 724 FetchContext::trace(visitor); |
| 724 } | 725 } |
| 725 | 726 |
| 726 } // namespace blink | 727 } // namespace blink |
| OLD | NEW |