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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 #include "gpu/command_buffer/client/gles2_interface.h" 131 #include "gpu/command_buffer/client/gles2_interface.h"
132 #include "platform/Cursor.h" 132 #include "platform/Cursor.h"
133 #include "platform/Language.h" 133 #include "platform/Language.h"
134 #include "platform/LayoutLocale.h" 134 #include "platform/LayoutLocale.h"
135 #include "platform/RuntimeEnabledFeatures.h" 135 #include "platform/RuntimeEnabledFeatures.h"
136 #include "platform/TraceEvent.h" 136 #include "platform/TraceEvent.h"
137 #include "platform/geometry/IntRect.h" 137 #include "platform/geometry/IntRect.h"
138 #include "platform/geometry/LayoutRect.h" 138 #include "platform/geometry/LayoutRect.h"
139 #include "platform/graphics/GraphicsLayer.h" 139 #include "platform/graphics/GraphicsLayer.h"
140 #include "platform/heap/Handle.h" 140 #include "platform/heap/Handle.h"
141 #include "platform/network/ResourceLoadPriority.h"
141 #include "platform/scroll/ProgrammaticScrollAnimator.h" 142 #include "platform/scroll/ProgrammaticScrollAnimator.h"
143 #include "platform/testing/URLTestHelpers.h"
142 #include "platform/weborigin/SchemeRegistry.h" 144 #include "platform/weborigin/SchemeRegistry.h"
143 #include "public/platform/Platform.h" 145 #include "public/platform/Platform.h"
144 #include "public/platform/WebConnectionType.h" 146 #include "public/platform/WebConnectionType.h"
145 #include "public/platform/WebGraphicsContext3DProvider.h" 147 #include "public/platform/WebGraphicsContext3DProvider.h"
146 #include "public/platform/WebLayer.h" 148 #include "public/platform/WebLayer.h"
147 #include "wtf/InstanceCounter.h" 149 #include "wtf/InstanceCounter.h"
148 #include "wtf/PtrUtil.h" 150 #include "wtf/PtrUtil.h"
149 #include "wtf/dtoa.h" 151 #include "wtf/dtoa.h"
150 #include "wtf/text/StringBuffer.h" 152 #include "wtf/text/StringBuffer.h"
151 #include <deque> 153 #include <deque>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 404
403 bool Internals::isLoadingFromMemoryCache(const String& url) 405 bool Internals::isLoadingFromMemoryCache(const String& url)
404 { 406 {
405 if (!contextDocument()) 407 if (!contextDocument())
406 return false; 408 return false;
407 const String cacheIdentifier = contextDocument()->fetcher()->getCacheIdentif ier(); 409 const String cacheIdentifier = contextDocument()->fetcher()->getCacheIdentif ier();
408 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple teURL(url), cacheIdentifier); 410 Resource* resource = memoryCache()->resourceForURL(contextDocument()->comple teURL(url), cacheIdentifier);
409 return resource && resource->getStatus() == Resource::Cached; 411 return resource && resource->getStatus() == Resource::Cached;
410 } 412 }
411 413
414 int Internals::getResourcePriority(const String& url, Document* document)
415 {
416 if (!document)
417 return ResourceLoadPriority::ResourceLoadPriorityUnresolved;
418
419 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
420
421 if (!resource)
422 return ResourceLoadPriority::ResourceLoadPriorityUnresolved;
423
424 return resource->resourceRequest().priority();
425 }
426
412 bool Internals::isSharingStyle(Element* element1, Element* element2) const 427 bool Internals::isSharingStyle(Element* element1, Element* element2) const
413 { 428 {
414 ASSERT(element1 && element2); 429 ASSERT(element1 && element2);
415 return element1->computedStyle() == element2->computedStyle(); 430 return element1->computedStyle() == element2->computedStyle();
416 } 431 }
417 432
418 bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionState& ex ceptionState) 433 bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionState& ex ceptionState)
419 { 434 {
420 ASSERT(insertionPoint); 435 ASSERT(insertionPoint);
421 if (!insertionPoint->isInsertionPoint()) { 436 if (!insertionPoint->isInsertionPoint()) {
(...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 2668
2654 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); 2669 return ClientRect::create(FloatRect(node->layoutObject()->visualRect()));
2655 } 2670 }
2656 2671
2657 void Internals::crash() 2672 void Internals::crash()
2658 { 2673 {
2659 CHECK(false) << "Intentional crash"; 2674 CHECK(false) << "Intentional crash";
2660 } 2675 }
2661 2676
2662 } // namespace blink 2677 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698