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

Side by Side Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1328763002: Make the low priority iframe flag affect all resources in cross origin iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All iframes, not just cross origin iframes Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/loader/FrameFetchContextTest.cpp » ('j') | Source/core/loader/FrameFetchContextTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698