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

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

Issue 1783433003: Increase priority of XHR in ResourcePriorities experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 754
755 // Async/Defer scripts. 755 // Async/Defer scripts.
756 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer()) 756 if (type == Resource::Script && FetchRequest::LazyLoad == request.defer())
757 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc eLoadPriorityMedium : ResourceLoadPriorityLow; 757 return frame()->settings()->fetchIncreaseAsyncScriptPriority() ? Resourc eLoadPriorityMedium : ResourceLoadPriorityLow;
758 758
759 // Runtime experiment that change how we prioritize resources. 759 // Runtime experiment that change how we prioritize resources.
760 // The toggles do not depend on each other and can be flipped individually 760 // The toggles do not depend on each other and can be flipped individually
761 // though the cumulative result will depend on the interaction between them. 761 // though the cumulative result will depend on the interaction between them.
762 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing 762 // Background doc: https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0g pwNFiEP4TZS-YLRp_RuMlc/edit?usp=sharing
763 763
764 // Increases the priorities for CSS, Scripts, Fonts and Images all by one le vel 764 // Increases the priorities for CSS, Scripts, XHR, Fonts and Images all by o ne level
765 // and parser-blocking scripts and visible images by 2. 765 // and parser-blocking scripts and visible images by 2.
766 // This is used in conjunction with logic on the Chrome side to raise the th reshold 766 // This is used in conjunction with logic on the Chrome side to raise the th reshold
767 // of "layout-blocking" resources and provide a boost to resources that are needed 767 // of "layout-blocking" resources and provide a boost to resources that are needed
768 // as soon as possible for something currently on the screen. 768 // as soon as possible for something currently on the screen.
769 int modifiedPriority = static_cast<int>(priority); 769 int modifiedPriority = static_cast<int>(priority);
770 if (frame()->settings()->fetchIncreasePriorities()) { 770 if (frame()->settings()->fetchIncreasePriorities()) {
771 if (type == Resource::CSSStyleSheet || type == Resource::Script || type == Resource::Font || type == Resource::Image) 771 if (type == Resource::CSSStyleSheet || type == Resource::Script || type == Resource::Font || type == Resource::Image || type == Resource::Raw)
772 modifiedPriority++; 772 modifiedPriority++;
773 } 773 }
774 774
775 // Always give visible resources a bump, and an additional bump if generally increasing priorities. 775 // Always give visible resources a bump, and an additional bump if generally increasing priorities.
776 if (visibility == ResourcePriority::Visible) { 776 if (visibility == ResourcePriority::Visible) {
777 modifiedPriority++; 777 modifiedPriority++;
778 if (frame()->settings()->fetchIncreasePriorities()) 778 if (frame()->settings()->fetchIncreasePriorities())
779 modifiedPriority++; 779 modifiedPriority++;
780 } 780 }
781 781
(...skipping 25 matching lines...) Expand all
807 } 807 }
808 808
809 DEFINE_TRACE(FrameFetchContext) 809 DEFINE_TRACE(FrameFetchContext)
810 { 810 {
811 visitor->trace(m_document); 811 visitor->trace(m_document);
812 visitor->trace(m_documentLoader); 812 visitor->trace(m_documentLoader);
813 FetchContext::trace(visitor); 813 FetchContext::trace(visitor);
814 } 814 }
815 815
816 } // namespace blink 816 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698