Chromium Code Reviews| Index: third_party/WebKit/Source/core/testing/Internals.cpp |
| diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp |
| index 9b30ec480db420f2f882f9ce5765343baac5277b..2671b51c434b5fbe82d70d7cd3561029cd9cd60c 100644 |
| --- a/third_party/WebKit/Source/core/testing/Internals.cpp |
| +++ b/third_party/WebKit/Source/core/testing/Internals.cpp |
| @@ -138,7 +138,9 @@ |
| #include "platform/geometry/LayoutRect.h" |
| #include "platform/graphics/GraphicsLayer.h" |
| #include "platform/heap/Handle.h" |
| +#include "platform/network/ResourceLoadPriority.h" |
| #include "platform/scroll/ProgrammaticScrollAnimator.h" |
| +#include "platform/testing/URLTestHelpers.h" |
| #include "platform/weborigin/SchemeRegistry.h" |
| #include "public/platform/Platform.h" |
| #include "public/platform/WebConnectionType.h" |
| @@ -409,6 +411,19 @@ bool Internals::isLoadingFromMemoryCache(const String& url) |
| return resource && resource->getStatus() == Resource::Cached; |
| } |
| +int Internals::getResourcePriority(const String& url, Document* document) |
| +{ |
| + if (!document) |
| + return ResourceLoadPriority::ResourceLoadPriorityUnresolved; |
| + |
| + Resource* resource = document->fetcher()->allResources().get(URLTestHelpers::toKURL(url.utf8().data())); |
|
Nate Chapin
2016/09/16 21:37:53
KURL(ParsedURLString, url) is the canonical way to
|
| + |
| + if (!resource) |
| + return ResourceLoadPriority::ResourceLoadPriorityUnresolved; |
| + |
| + return resource->resourceRequest().priority(); |
| +} |
| + |
| bool Internals::isSharingStyle(Element* element1, Element* element2) const |
| { |
| ASSERT(element1 && element2); |