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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2260303002: Sending an async GET request for doc.written blocked scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows compile error for GetResourcePriority return type fixed. Created 4 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698