| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 case ResourceType::FONT_RESOURCE: | 1773 case ResourceType::FONT_RESOURCE: |
| 1774 return net::MEDIUM; | 1774 return net::MEDIUM; |
| 1775 | 1775 |
| 1776 // Sub resources, objects and media are lower priority than potentially | 1776 // Sub resources, objects and media are lower priority than potentially |
| 1777 // blocking stylesheets, scripts and fonts, but are higher priority than | 1777 // blocking stylesheets, scripts and fonts, but are higher priority than |
| 1778 // images because if they exist they are probably more central to the page | 1778 // images because if they exist they are probably more central to the page |
| 1779 // focus than images on the page. | 1779 // focus than images on the page. |
| 1780 case ResourceType::SUB_RESOURCE: | 1780 case ResourceType::SUB_RESOURCE: |
| 1781 case ResourceType::OBJECT: | 1781 case ResourceType::OBJECT: |
| 1782 case ResourceType::MEDIA: | 1782 case ResourceType::MEDIA: |
| 1783 case ResourceType::WORKER: |
| 1784 case ResourceType::SHARED_WORKER: |
| 1783 return net::LOW; | 1785 return net::LOW; |
| 1784 | 1786 |
| 1785 // Images are the lowest priority because they typically do not block | 1787 // Images are the lowest priority because they typically do not block |
| 1786 // downloads or rendering and most pages have some useful content without | 1788 // downloads or rendering and most pages have some useful content without |
| 1787 // them. | 1789 // them. |
| 1788 case ResourceType::IMAGE: | 1790 case ResourceType::IMAGE: |
| 1789 return net::LOWEST; | 1791 return net::LOWEST; |
| 1790 | 1792 |
| 1791 default: | 1793 default: |
| 1792 // When new resource types are added, their priority must be considered. | 1794 // When new resource types are added, their priority must be considered. |
| 1793 NOTREACHED(); | 1795 NOTREACHED(); |
| 1794 return net::LOW; | 1796 return net::LOW; |
| 1795 } | 1797 } |
| 1796 } | 1798 } |
| OLD | NEW |