Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 934 } | 934 } |
| 935 | 935 |
| 936 size_t Resource::overheadSize() const | 936 size_t Resource::overheadSize() const |
| 937 { | 937 { |
| 938 static const int kAverageClientsHashMapSize = 384; | 938 static const int kAverageClientsHashMapSize = 384; |
| 939 return sizeof(Resource) + m_response.memoryUsage() + kAverageClientsHashMapS ize + m_resourceRequest.url().string().length() * 2; | 939 return sizeof(Resource) + m_response.memoryUsage() + kAverageClientsHashMapS ize + m_resourceRequest.url().string().length() * 2; |
| 940 } | 940 } |
| 941 | 941 |
| 942 void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPri orityValue) | 942 void Resource::didChangePriority(ResourceLoadPriority loadPriority, int intraPri orityValue) |
| 943 { | 943 { |
| 944 m_resourceRequest.setPriority(loadPriority, intraPriorityValue); | |
| 944 if (m_loader) | 945 if (m_loader) |
| 945 m_loader->didChangePriority(loadPriority, intraPriorityValue); | 946 m_loader->didChangePriority(loadPriority, intraPriorityValue); |
| 946 } | 947 } |
| 947 | 948 |
| 949 ResourcePriority Resource::priorityFromClients() | |
|
Nate Chapin
2015/10/07 19:40:40
I could go either way on whether this belongs here
| |
| 950 { | |
| 951 ResourcePriority priority; | |
| 952 ResourceClientWalker<ResourceClient> w(m_clients); | |
|
esprehn
2015/10/08 05:39:11
walker
Nate Chapin
2015/10/08 21:26:37
Done.
| |
| 953 while (ResourceClient* c = w.next()) { | |
|
esprehn
2015/10/08 05:39:11
client = walker.next()
we should also really make
Nate Chapin
2015/10/08 21:26:37
I'll add that to my list of things to do eventuall
| |
| 954 ResourcePriority nextPriority = c->updatePriority(this); | |
| 955 if (nextPriority.visibility == ResourcePriority::NotVisible) | |
| 956 continue; | |
| 957 priority.visibility = ResourcePriority::Visible; | |
| 958 priority.intraPriorityValue += nextPriority.intraPriorityValue; | |
| 959 } | |
| 960 return priority; | |
| 961 } | |
| 962 | |
| 948 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler() | 963 Resource::ResourceCallback* Resource::ResourceCallback::callbackHandler() |
| 949 { | 964 { |
| 950 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback))); | 965 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<ResourceCallback>, callbackHandle r, (adoptPtrWillBeNoop(new ResourceCallback))); |
| 951 return callbackHandler.get(); | 966 return callbackHandler.get(); |
| 952 } | 967 } |
| 953 | 968 |
| 954 DEFINE_TRACE(Resource::ResourceCallback) | 969 DEFINE_TRACE(Resource::ResourceCallback) |
| 955 { | 970 { |
| 956 #if ENABLE(OILPAN) | 971 #if ENABLE(OILPAN) |
| 957 visitor->trace(m_resourcesWithPendingClients); | 972 visitor->trace(m_resourcesWithPendingClients); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1093 return "ImportResource"; | 1108 return "ImportResource"; |
| 1094 case Resource::Media: | 1109 case Resource::Media: |
| 1095 return "Media"; | 1110 return "Media"; |
| 1096 } | 1111 } |
| 1097 ASSERT_NOT_REACHED(); | 1112 ASSERT_NOT_REACHED(); |
| 1098 return "Unknown"; | 1113 return "Unknown"; |
| 1099 } | 1114 } |
| 1100 #endif // !LOG_DISABLED | 1115 #endif // !LOG_DISABLED |
| 1101 | 1116 |
| 1102 } // namespace blink | 1117 } // namespace blink |
| OLD | NEW |