Changeset 222739 in webkit
- Timestamp:
- Oct 2, 2017 1:24:10 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r222734 r222739 1 2017-10-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Include Beacon and Ping requests in Network tab 4 https://bugs.webkit.org/show_bug.cgi?id=177641 5 <rdar://problem/33086839> 6 7 Reviewed by Chris Dumez. 8 9 * http/tests/inspector/network/beacon-type-expected.txt: Added. 10 * http/tests/inspector/network/beacon-type.html: Added. 11 * http/tests/inspector/network/ping-type-expected.txt: Added. 12 * http/tests/inspector/network/ping-type.html: Added. 13 * http/tests/inspector/network/resources/beacon.php: Added. 14 * http/tests/inspector/network/resources/ping.php: Added. 15 Test for Beacon and Ping resource loads. 16 17 * platform/mac-wk1/TestExpectations: 18 * platform/mac-wk2/TestExpectations: 19 * platform/win/TestExpectations: 20 Skip beacon tests where beacon is not supported. 21 1 22 2017-10-02 Jiewen Tan <jiewen_tan@apple.com> 2 23 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r222626 r222739 373 373 # Beacon is not supported on WK1. 374 374 http/tests/blink/sendbeacon/ [ Skip ] 375 http/tests/inspector/network/beacon-type.html [ Skip ] 375 376 http/wpt/beacon/ [ Skip ] 376 377 imported/blink/fast/beacon/ [ Skip ] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r222734 r222739 725 725 # Beacon is not supported on WK2 for the non NETWORK_SESSION code path. 726 726 [ ElCapitan ] http/tests/blink/sendbeacon/ [ Skip ] 727 [ ElCapitan ] http/tests/inspector/network/beacon-type.html [ Skip ] 727 728 [ ElCapitan ] http/wpt/beacon/ [ Skip ] 728 729 [ ElCapitan ] imported/blink/fast/beacon/ [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r222605 r222739 1431 1431 [ ElCapitan ] http/tests/inspector/network/resource-request-headers.html [ Failure ] 1432 1432 1433 [ ElCapitan ] http/tests/inspector/network/ping-type.html [ Skip ] 1434 1433 1435 # <rdar://problem/30610988> 1434 1436 [ Sierra+ ] imported/w3c/web-platform-tests/fetch/api/redirect/redirect-count-cross-origin.html [ Failure ] -
trunk/LayoutTests/platform/win/TestExpectations
r222635 r222739 3681 3681 # Beacon is not supported on WK1. 3682 3682 http/tests/blink/sendbeacon/ [ Skip ] 3683 http/tests/inspector/network/beacon-type.html [ Skip ] 3683 3684 http/wpt/beacon/ [ Skip ] 3684 3685 imported/blink/fast/beacon/ [ Skip ] -
trunk/Source/JavaScriptCore/ChangeLog
r222724 r222739 1 2017-10-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Include Beacon and Ping requests in Network tab 4 https://bugs.webkit.org/show_bug.cgi?id=177641 5 <rdar://problem/33086839> 6 7 Reviewed by Chris Dumez. 8 9 * inspector/protocol/Page.json: 10 Include new "Beacon" and "Ping" resource types. 11 1 12 2017-10-02 Caio Lima <ticaiolima@gmail.com> 2 13 -
trunk/Source/JavaScriptCore/inspector/protocol/Page.json
r222560 r222739 7 7 "id": "ResourceType", 8 8 "type": "string", 9 "enum": ["Document", "Stylesheet", "Image", "Font", "Script", "XHR", "Fetch", " WebSocket", "Other"],9 "enum": ["Document", "Stylesheet", "Image", "Font", "Script", "XHR", "Fetch", "Ping", "Beacon", "WebSocket", "Other"], 10 10 "description": "Resource type as it was perceived by the rendering engine." 11 11 }, -
trunk/Source/WebCore/ChangeLog
r222738 r222739 1 2017-10-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Include Beacon and Ping requests in Network tab 4 https://bugs.webkit.org/show_bug.cgi?id=177641 5 <rdar://problem/33086839> 6 7 Reviewed by Chris Dumez. 8 9 Tests: http/tests/inspector/network/beacon-type.html 10 http/tests/inspector/network/ping-type.html 11 12 * Modules/beacon/NavigatorBeacon.cpp: 13 (WebCore::NavigatorBeacon::sendBeacon): 14 Fix a typo. 15 16 * loader/PingLoader.cpp: 17 (WebCore::PingLoader::startPingLoad): 18 * loader/cache/CachedResource.cpp: 19 (WebCore::CachedResource::load): 20 Include InspectorInstrumentation hooks for ping network loads. 21 22 * loader/LoaderStrategy.h: 23 * platform/network/PingHandle.h: 24 Include an optional ResourceResponse in the ping load completion callback. 25 If available this will be enough for Web Inspector to include details such 26 as the response statusCode. 27 28 * inspector/InspectorInstrumentation.cpp: 29 (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl): 30 (WebCore::InspectorInstrumentation::continueAfterPingLoaderImpl): Deleted. 31 * inspector/InspectorInstrumentation.h: 32 (WebCore::InspectorInstrumentation::willSendRequestOfType): 33 (WebCore::InspectorInstrumentation::continueAfterPingLoader): Deleted. 34 * inspector/InspectorNetworkAgent.cpp: 35 (WebCore::resourceTypeForCachedResource): 36 (WebCore::resourceTypeForLoadType): 37 (WebCore::InspectorNetworkAgent::willSendRequest): 38 (WebCore::InspectorNetworkAgent::willSendRequestOfType): 39 * inspector/InspectorNetworkAgent.h: 40 Make a general willSendRequestOfType hook when sending a request that does 41 not go through normal CachedResource loading. The Ping and Beacon requests 42 go through this process, we may also use this path for Preflight requests. 43 44 * inspector/InspectorPageAgent.cpp: 45 (WebCore::InspectorPageAgent::resourceTypeJson): 46 (WebCore::InspectorPageAgent::cachedResourceType): 47 * inspector/InspectorPageAgent.h: 48 Small refactoring. 49 1 50 2017-10-02 Zalan Bujtas <zalan@apple.com> 2 51 -
trunk/Source/WebCore/Modules/beacon/NavigatorBeacon.cpp
r221329 r222739 104 104 105 105 // Set parsedUrl to the result of the URL parser steps with url and base. If the algorithm returns an error, or if 106 // parsedUrl's scheme is not "http" or "https", throw a " 106 // parsedUrl's scheme is not "http" or "https", throw a "TypeError" exception and terminate these steps. 107 107 if (!parsedUrl.isValid()) 108 108 return Exception { TypeError, ASCIILiteral("This URL is invalid") }; -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r222560 r222739 33 33 #include "InspectorInstrumentation.h" 34 34 35 #include "CachedResource.h" 35 36 #include "DOMWindow.h" 36 37 #include "DOMWrapperWorld.h" … … 561 562 } 562 563 563 void InspectorInstrumentation::continueAfterPingLoaderImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response) 564 { 565 willSendRequestImpl(instrumentingAgents, identifier, loader, request, response); 564 void InspectorInstrumentation::willSendRequestOfTypeImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, LoadType loadType) 565 { 566 if (!loader) 567 return; 568 569 if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent()) 570 networkAgent->willSendRequestOfType(identifier, *loader, request, loadType); 566 571 } 567 572 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r222064 r222739 171 171 static void applyEmulatedMedia(Frame&, String&); 172 172 static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse); 173 static void continueAfterPingLoader(Frame&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);174 173 static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*); 175 174 static void didReceiveResourceResponse(Frame&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*); … … 181 180 static void continueWithPolicyDownload(Frame&, unsigned long identifier, DocumentLoader&, const ResourceResponse&); 182 181 static void continueWithPolicyIgnore(Frame&, unsigned long identifier, DocumentLoader&, const ResourceResponse&); 182 183 // Some network requests do not go through the normal network loading path. 184 // These network requests have to issue their own willSendRequest / didReceiveResponse / didFinishLoading / didFailLoading 185 // instrumentation calls. Some of these loads are for resources that lack a CachedResource::Type. 186 enum class LoadType { Ping, Beacon }; 187 static void willSendRequestOfType(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType); 183 188 184 189 static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber); … … 343 348 static void applyEmulatedMediaImpl(InstrumentingAgents&, String&); 344 349 static void willSendRequestImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse); 345 static void continueAfterPingLoaderImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);350 static void willSendRequestOfTypeImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, LoadType); 346 351 static void markResourceAsCachedImpl(InstrumentingAgents&, unsigned long identifier); 347 352 static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents&, DocumentLoader*, CachedResource*); … … 891 896 } 892 897 893 inline void InspectorInstrumentation:: continueAfterPingLoader(Frame& frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)894 { 895 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) 896 InspectorInstrumentation::continueAfterPingLoaderImpl(*instrumentingAgents, identifier, loader, request, response);898 inline void InspectorInstrumentation::willSendRequestOfType(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, LoadType loadType) 899 { 900 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) 901 willSendRequestOfTypeImpl(*instrumentingAgents, identifier, loader, request, loadType); 897 902 } 898 903 -
trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp
r221839 r222739 44 44 #include "HTTPHeaderMap.h" 45 45 #include "HTTPHeaderNames.h" 46 #include "InspectorPageAgent.h"47 46 #include "InspectorTimelineAgent.h" 48 47 #include "InstrumentingAgents.h" … … 182 181 { 183 182 Ref<InspectorObject> headersObject = InspectorObject::create(); 184 183 185 184 for (const auto& header : headers) 186 185 headersObject->setString(header.key, header.value); … … 337 336 } 338 337 339 void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, const ResourceResponse& redirectResponse )338 void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, const ResourceResponse& redirectResponse, InspectorPageAgent::ResourceType type) 340 339 { 341 340 if (request.hiddenFromInspector()) { … … 347 346 m_resourcesData->resourceCreated(requestId, m_pageAgent->loaderId(&loader)); 348 347 349 CachedResource* cachedResource = InspectorPageAgent::cachedResource(loader.frame(), request.url());350 InspectorPageAgent::ResourceType type = cachedResource ? InspectorPageAgent::cachedResourceType(*cachedResource) : m_resourcesData->resourceType(requestId);351 348 if (type == InspectorPageAgent::OtherResource) { 352 349 if (m_loadingXHRSynchronously) … … 369 366 request.setHTTPHeaderField(entry.key, entry.value); 370 367 371 Inspector::Protocol::Page::ResourceType resourceType = InspectorPageAgent::resourceTypeJson(type);368 Inspector::Protocol::Page::ResourceType protocolResourceType = InspectorPageAgent::resourceTypeJson(type); 372 369 373 370 RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader.frame() ? loader.frame()->document() : nullptr); 374 371 String targetId = request.initiatorIdentifier(); 375 372 376 m_frontendDispatcher->requestWillBeSent(requestId, m_pageAgent->frameId(loader.frame()), m_pageAgent->loaderId(&loader), loader.url().string(), buildObjectForResourceRequest(request), timestamp(), initiatorObject, buildObjectForResourceResponse(redirectResponse, nullptr), type != InspectorPageAgent::OtherResource ? &resourceType : nullptr, targetId.isEmpty() ? nullptr : &targetId); 373 m_frontendDispatcher->requestWillBeSent(requestId, m_pageAgent->frameId(loader.frame()), m_pageAgent->loaderId(&loader), loader.url().string(), buildObjectForResourceRequest(request), timestamp(), initiatorObject, buildObjectForResourceResponse(redirectResponse, nullptr), type != InspectorPageAgent::OtherResource ? &protocolResourceType : nullptr, targetId.isEmpty() ? nullptr : &targetId); 374 } 375 376 static InspectorPageAgent::ResourceType resourceTypeForCachedResource(CachedResource* resource) 377 { 378 if (resource) 379 return InspectorPageAgent::inspectorResourceType(*resource); 380 return InspectorPageAgent::OtherResource; 381 } 382 383 static InspectorPageAgent::ResourceType resourceTypeForLoadType(InspectorInstrumentation::LoadType loadType) 384 { 385 switch (loadType) { 386 case InspectorInstrumentation::LoadType::Ping: 387 return InspectorPageAgent::PingResource; 388 case InspectorInstrumentation::LoadType::Beacon: 389 return InspectorPageAgent::BeaconResource; 390 } 391 392 ASSERT_NOT_REACHED(); 393 return InspectorPageAgent::OtherResource; 394 } 395 396 void InspectorNetworkAgent::willSendRequest(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, const ResourceResponse& redirectResponse) 397 { 398 auto* cachedResource = InspectorPageAgent::cachedResource(loader.frame(), request.url()); 399 willSendRequest(identifier, loader, request, redirectResponse, resourceTypeForCachedResource(cachedResource)); 400 } 401 402 void InspectorNetworkAgent::willSendRequestOfType(unsigned long identifier, DocumentLoader& loader, ResourceRequest& request, InspectorInstrumentation::LoadType loadType) 403 { 404 willSendRequest(identifier, loader, request, ResourceResponse(), resourceTypeForLoadType(loadType)); 377 405 } 378 406 … … 401 429 402 430 InspectorPageAgent::ResourceType type = m_resourcesData->resourceType(requestId); 403 InspectorPageAgent::ResourceType newType = cachedResource ? InspectorPageAgent:: cachedResourceType(*cachedResource) : type;431 InspectorPageAgent::ResourceType newType = cachedResource ? InspectorPageAgent::inspectorResourceType(*cachedResource) : type; 404 432 405 433 // FIXME: XHRResource is returned for CachedResource::RawResource, it should be OtherResource unless it truly is an XHR. -
trunk/Source/WebCore/inspector/InspectorNetworkAgent.h
r220250 r222739 32 32 #pragma once 33 33 34 #include "InspectorInstrumentation.h" 35 #include "InspectorPageAgent.h" 34 36 #include "InspectorWebAgentBase.h" 35 37 #include <inspector/InspectorBackendDispatchers.h> … … 50 52 class DocumentLoader; 51 53 class DocumentThreadableLoader; 52 class InspectorPageAgent;53 54 class NetworkLoadMetrics; 54 55 class NetworkResourcesData; … … 77 78 void didRecalculateStyle(); 78 79 void willSendRequest(unsigned long identifier, DocumentLoader&, ResourceRequest&, const ResourceResponse& redirectResponse); 80 void willSendRequestOfType(unsigned long identifier, DocumentLoader&, ResourceRequest&, InspectorInstrumentation::LoadType); 79 81 void didReceiveResponse(unsigned long identifier, DocumentLoader&, const ResourceResponse&, ResourceLoader*); 80 82 void didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength); … … 116 118 void enable(); 117 119 120 void willSendRequest(unsigned long identifier, DocumentLoader&, ResourceRequest&, const ResourceResponse& redirectResponse, InspectorPageAgent::ResourceType); 121 118 122 WebSocket* webSocketForRequestId(const String& requestId); 119 123 -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r222560 r222739 102 102 // We should not assume XHR / Fetch have text content. 103 103 104 InspectorPageAgent::ResourceType type = InspectorPageAgent:: cachedResourceType(*cachedResource);104 InspectorPageAgent::ResourceType type = InspectorPageAgent::inspectorResourceType(*cachedResource); 105 105 return type == InspectorPageAgent::DocumentResource 106 106 || type == InspectorPageAgent::StylesheetResource … … 264 264 case FetchResource: 265 265 return Inspector::Protocol::Page::ResourceType::Fetch; 266 case PingResource: 267 return Inspector::Protocol::Page::ResourceType::Ping; 268 case BeaconResource: 269 return Inspector::Protocol::Page::ResourceType::Beacon; 266 270 case WebSocketResource: 267 271 return Inspector::Protocol::Page::ResourceType::WebSocket; … … 272 276 } 273 277 274 InspectorPageAgent::ResourceType InspectorPageAgent:: cachedResourceType(const CachedResource& cachedResource)275 { 276 switch ( cachedResource.type()) {278 InspectorPageAgent::ResourceType InspectorPageAgent::inspectorResourceType(CachedResource::Type type) 279 { 280 switch (type) { 277 281 case CachedResource::ImageResource: 278 282 return InspectorPageAgent::ImageResource; … … 291 295 case CachedResource::MainResource: 292 296 return InspectorPageAgent::DocumentResource; 297 case CachedResource::Beacon: 298 return InspectorPageAgent::BeaconResource; 293 299 case CachedResource::MediaResource: 294 300 case CachedResource::Icon: 295 case CachedResource::RawResource: { 301 case CachedResource::RawResource: 302 default: 303 return InspectorPageAgent::OtherResource; 304 } 305 } 306 307 InspectorPageAgent::ResourceType InspectorPageAgent::inspectorResourceType(const CachedResource& cachedResource) 308 { 309 if (cachedResource.type() == CachedResource::RawResource) { 296 310 switch (cachedResource.resourceRequest().requester()) { 297 311 case ResourceRequest::Requester::Fetch: … … 303 317 } 304 318 } 305 default: 306 break; 307 } 308 return InspectorPageAgent::OtherResource; 319 320 return inspectorResourceType(cachedResource.type()); 309 321 } 310 322 311 323 Inspector::Protocol::Page::ResourceType InspectorPageAgent::cachedResourceTypeJson(const CachedResource& cachedResource) 312 324 { 313 return resourceTypeJson( cachedResourceType(cachedResource));325 return resourceTypeJson(inspectorResourceType(cachedResource)); 314 326 } 315 327 -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r222560 r222739 32 32 #pragma once 33 33 34 #include "CachedResource.h" 34 35 #include "InspectorWebAgentBase.h" 35 36 #include "LayoutRect.h" … … 46 47 namespace WebCore { 47 48 48 class CachedResource;49 49 class DocumentLoader; 50 50 class Frame; … … 74 74 XHRResource, 75 75 FetchResource, 76 PingResource, 77 BeaconResource, 76 78 WebSocketResource, 77 79 OtherResource, … … 85 87 static CachedResource* cachedResource(Frame*, const URL&); 86 88 static Inspector::Protocol::Page::ResourceType resourceTypeJson(ResourceType); 87 static ResourceType cachedResourceType(const CachedResource&); 89 static ResourceType inspectorResourceType(CachedResource::Type); 90 static ResourceType inspectorResourceType(const CachedResource&); 88 91 static Inspector::Protocol::Page::ResourceType cachedResourceTypeJson(const CachedResource&); 89 92 static RefPtr<TextResourceDecoder> createTextDecoder(const String& mimeType, const String& textEncodingName); -
trunk/Source/WebCore/loader/LoaderStrategy.h
r222673 r222739 66 66 virtual void resumePendingRequests() = 0; 67 67 68 using PingLoadCompletionHandler = WTF::Function<void(const ResourceError& )>;68 using PingLoadCompletionHandler = WTF::Function<void(const ResourceError&, const ResourceResponse&)>; 69 69 virtual void startPingLoad(Frame&, ResourceRequest&, const HTTPHeaderMap& originalRequestHeaders, const FetchOptions&, PingLoadCompletionHandler&& = { }) = 0; 70 70 -
trunk/Source/WebCore/loader/PingLoader.cpp
r222602 r222739 42 42 #include "InspectorInstrumentation.h" 43 43 #include "LoaderStrategy.h" 44 #include "NetworkLoadMetrics.h" 44 45 #include "Page.h" 45 46 #include "PlatformStrategies.h" … … 192 193 unsigned long identifier = frame.page()->progress().createUniqueIdentifier(); 193 194 // FIXME: Why activeDocumentLoader? I would have expected documentLoader(). 194 // It seems like the PingLoader should be associated with the current195 // It seems like the PingLoader should be associated with the current 195 196 // Document in the Frame, but the activeDocumentLoader will be associated 196 197 // with the provisional DocumentLoader if there is a provisional … … 201 202 options.redirect = shouldFollowRedirects == ShouldFollowRedirects::Yes ? FetchOptions::Redirect::Follow : FetchOptions::Redirect::Error; 202 203 203 InspectorInstrumentation::continueAfterPingLoader(frame, identifier, frame.loader().activeDocumentLoader(), request, ResourceResponse()); 204 205 platformStrategies()->loaderStrategy()->startPingLoad(frame, request, WTFMove(originalRequestHeaders), options); 206 } 207 208 } 204 // FIXME: Move ping loads to normal subresource loading to get normal inspector request instrumentation hooks. 205 InspectorInstrumentation::willSendRequestOfType(&frame, identifier, frame.loader().activeDocumentLoader(), request, InspectorInstrumentation::LoadType::Ping); 206 207 platformStrategies()->loaderStrategy()->startPingLoad(frame, request, WTFMove(originalRequestHeaders), options, [protectedFrame = makeRef(frame), identifier] (const ResourceError& error, const ResourceResponse& response) { 208 if (!response.isNull()) 209 InspectorInstrumentation::didReceiveResourceResponse(protectedFrame, identifier, protectedFrame->loader().activeDocumentLoader(), response, nullptr); 210 if (error.isNull()) { 211 NetworkLoadMetrics emptyMetrics; 212 InspectorInstrumentation::didFinishLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, emptyMetrics, nullptr); 213 } else 214 InspectorInstrumentation::didFailLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, error); 215 }); 216 } 217 218 } -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r222467 r222739 38 38 #include "HTTPHeaderNames.h" 39 39 #include "InspectorInstrumentation.h" 40 #include "URL.h"41 40 #include "LoaderStrategy.h" 42 41 #include "Logging.h" … … 44 43 #include "MemoryCache.h" 45 44 #include "PlatformStrategies.h" 45 #include "ProgressTracker.h" 46 46 #include "ResourceHandle.h" 47 47 #include "SchemeRegistry.h" 48 48 #include "SecurityOrigin.h" 49 49 #include "SubresourceLoader.h" 50 #include "URL.h" 50 51 #include <wtf/CurrentTime.h> 51 52 #include <wtf/MathExtras.h> 52 53 #include <wtf/RefCountedLeakCounter.h> 53 54 #include <wtf/StdLibExtras.h> 55 #include <wtf/Vector.h> 54 56 #include <wtf/text/CString.h> 55 #include <wtf/Vector.h>56 57 57 58 #if USE(QUICK_LOOK) … … 271 272 ASSERT(m_originalRequestHeaders); 272 273 CachedResourceHandle<CachedResource> protectedThis(this); 273 platformStrategies()->loaderStrategy()->startPingLoad(frame, request, *m_originalRequestHeaders, m_options, [this, protectedThis = WTFMove(protectedThis)] (const ResourceError& error) { 274 if (error.isNull()) 274 275 // FIXME: Move beacon loads to normal subresource loading to get normal inspector request instrumentation hooks. 276 unsigned long identifier = frame.page()->progress().createUniqueIdentifier(); 277 InspectorInstrumentation::willSendRequestOfType(&frame, identifier, frameLoader.activeDocumentLoader(), request, InspectorInstrumentation::LoadType::Beacon); 278 279 platformStrategies()->loaderStrategy()->startPingLoad(frame, request, *m_originalRequestHeaders, m_options, [this, protectedThis = WTFMove(protectedThis), protectedFrame = makeRef(frame), identifier] (const ResourceError& error, const ResourceResponse& response) { 280 if (!response.isNull()) 281 InspectorInstrumentation::didReceiveResourceResponse(protectedFrame, identifier, protectedFrame->loader().activeDocumentLoader(), response, nullptr); 282 if (error.isNull()) { 275 283 finishLoading(nullptr); 276 else { 284 NetworkLoadMetrics emptyMetrics; 285 InspectorInstrumentation::didFinishLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, emptyMetrics, nullptr); 286 } else { 277 287 setResourceError(error); 278 288 this->error(LoadError); 289 InspectorInstrumentation::didFailLoading(protectedFrame.ptr(), protectedFrame->loader().activeDocumentLoader(), identifier, error); 279 290 } 280 291 }); -
trunk/Source/WebCore/platform/network/PingHandle.h
r222570 r222739 45 45 }; 46 46 47 PingHandle(NetworkingContext* networkingContext, const ResourceRequest& request, bool shouldUseCredentialStorage, UsesAsyncCallbacks useAsyncCallbacks, bool shouldFollowRedirects, WTF::CompletionHandler<void(const ResourceError& )>&& completionHandler)47 PingHandle(NetworkingContext* networkingContext, const ResourceRequest& request, bool shouldUseCredentialStorage, UsesAsyncCallbacks useAsyncCallbacks, bool shouldFollowRedirects, WTF::CompletionHandler<void(const ResourceError&, const ResourceResponse&)>&& completionHandler) 48 48 : m_currentRequest(request) 49 49 , m_timeoutTimer(*this, &PingHandle::timeoutTimerFired) … … 74 74 pingLoadComplete(ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Not allowed to follow redirects"), ResourceError::Type::AccessControl }); 75 75 } 76 void didReceiveResponse(ResourceHandle*, ResourceResponse&& ) final { pingLoadComplete(); }76 void didReceiveResponse(ResourceHandle*, ResourceResponse&& response) final { pingLoadComplete({ }, response); } 77 77 void didReceiveBuffer(ResourceHandle*, Ref<SharedBuffer>&&, int) final { pingLoadComplete(); } 78 78 void didFinishLoading(ResourceHandle*) final { pingLoadComplete(); } … … 82 82 void timeoutTimerFired() { pingLoadComplete(ResourceError { String(), 0, m_currentRequest.url(), ASCIILiteral("Load timed out"), ResourceError::Type::Timeout }); } 83 83 84 void pingLoadComplete(const ResourceError& error = { } )84 void pingLoadComplete(const ResourceError& error = { }, const ResourceResponse& response = { }) 85 85 { 86 86 if (auto completionHandler = std::exchange(m_completionHandler, nullptr)) 87 completionHandler(error );87 completionHandler(error, response); 88 88 delete this; 89 89 } … … 105 105 bool m_shouldFollowRedirects; 106 106 UsesAsyncCallbacks m_usesAsyncCallbacks; 107 WTF::CompletionHandler<void(const ResourceError& )> m_completionHandler;107 WTF::CompletionHandler<void(const ResourceError&, const ResourceResponse&)> m_completionHandler; 108 108 }; 109 109 -
trunk/Source/WebInspectorUI/ChangeLog
r222678 r222739 1 2017-10-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Include Beacon and Ping requests in Network tab 4 https://bugs.webkit.org/show_bug.cgi?id=177641 5 <rdar://problem/33086839> 6 7 Reviewed by Chris Dumez. 8 9 * Localizations/en.lproj/localizedStrings.js: 10 New strings for Beacon/Ping. 11 12 * UserInterface/Images/Beacon.svg: Added. 13 * UserInterface/Views/ResourceIcons.css: 14 (.resource-icon.resource-type-ping .icon,): 15 (body:not(.mac-platform, .windows-platform) .resource-icon.resource-type-ping .icon,): 16 (body:not(.mac-platform, .windows-platform) .large .resource-icon.resource-type-ping .icon,): 17 New icon for Beacon/Ping. They share an icon since they are similiar in concept: 18 a request that is sent and the page doesn't expect a response. 19 20 * UserInterface/Controllers/FrameResourceManager.js: 21 (WI.FrameResourceManager.prototype._addNewResourceToFrameOrTarget): 22 When a sub-resource and a main-resource have the same URL we were not 23 distinguishing them. Use the resource type to distinguish them better. 24 25 * UserInterface/Models/SourceCode.js: 26 (WI.SourceCode.prototype._processContent): 27 Safer handling if the body was base64 encoded but an empty string. 28 29 * UserInterface/Models/Resource.js: 30 (WI.Resource.displayNameForType): 31 * UserInterface/Models/ResourceCollection.js: 32 (WI.ResourceCollection.verifierForType): 33 * UserInterface/Views/NetworkTableContentView.js: 34 (WI.NetworkTableContentView.shortDisplayNameForResourceType): 35 * UserInterface/Views/ResourceClusterContentView.js: 36 (WI.ResourceClusterContentView.prototype.get responseContentView): 37 New resource types. 38 39 * UserInterface/Views/ResourceContentView.js: 40 (WI.ResourceContentView.prototype.showMessage): 41 * UserInterface/Views/TextResourceContentView.js: 42 (WI.TextResourceContentView.prototype._contentDidPopulate): 43 Nicer display for empty content, which may be common for these requests. 44 1 45 2017-09-29 Nikita Vasilyev <nvasilyev@apple.com> 2 46 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r222573 r222739 125 125 localizedStrings["Background"] = "Background"; 126 126 localizedStrings["Basis"] = "Basis"; 127 localizedStrings["Beacon"] = "Beacon"; 128 localizedStrings["Beacons"] = "Beacons"; 127 129 localizedStrings["Bezier"] = "Bezier"; 128 130 localizedStrings["Binary Frame"] = "Binary Frame"; … … 652 654 localizedStrings["Pause Reason"] = "Pause Reason"; 653 655 localizedStrings["Pause script execution (%s or %s)"] = "Pause script execution (%s or %s)"; 656 localizedStrings["Ping"] = "Ping"; 654 657 localizedStrings["Ping Frame"] = "Ping Frame"; 658 localizedStrings["Pings"] = "Pings"; 655 659 localizedStrings["Play Sound"] = "Play Sound"; 656 660 localizedStrings["Polite"] = "Polite"; … … 719 723 localizedStrings["Resource Type"] = "Resource Type"; 720 724 localizedStrings["Resource failed to load."] = "Resource failed to load."; 725 localizedStrings["Resource has no content"] = "Resource has no content"; 721 726 localizedStrings["Resource was loaded with the “data“ scheme."] = "Resource was loaded with the “data“ scheme."; 722 727 localizedStrings["Resource was served from the cache."] = "Resource was served from the cache."; … … 982 987 localizedStrings["line "] = "line "; 983 988 localizedStrings["originally %s"] = "originally %s"; 989 localizedStrings["ping"] = "ping"; 984 990 localizedStrings["popup"] = "popup"; 985 991 localizedStrings["popup, toggle"] = "popup, toggle"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js
r220119 r222739 503 503 if (frame) { 504 504 // This is a new request for an existing frame, which might be the main resource or a new resource. 505 if ( frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier)505 if (type === PageAgent.ResourceType.Document && frame.mainResource.url === url && frame.loaderIdentifier === loaderIdentifier) 506 506 resource = frame.mainResource; 507 else if ( frame.provisionalMainResource && frame.provisionalMainResource.url === url && frame.provisionalLoaderIdentifier === loaderIdentifier)507 else if (type === PageAgent.ResourceType.Document && frame.provisionalMainResource && frame.provisionalMainResource.url === url && frame.provisionalLoaderIdentifier === loaderIdentifier) 508 508 resource = frame.provisionalMainResource; 509 509 else { … … 675 675 // a main resource when we created the Frame. The resource payload does not include anything 676 676 // didn't already get from the frame payload. 677 if (resourcePayload.type === "Document"&& resourcePayload.url === payload.frame.url)677 if (resourcePayload.type === PageAgent.ResourceType.Document && resourcePayload.url === payload.frame.url) 678 678 continue; 679 679 -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r222485 r222739 141 141 return WI.UIString("Fetches"); 142 142 return WI.UIString("Fetch"); 143 case WI.Resource.Type.Ping: 144 if (plural) 145 return WI.UIString("Pings"); 146 return WI.UIString("Ping"); 147 case WI.Resource.Type.Beacon: 148 if (plural) 149 return WI.UIString("Beacons"); 150 return WI.UIString("Beacon"); 143 151 case WI.Resource.Type.WebSocket: 144 152 if (plural) … … 1009 1017 XHR: "resource-type-xhr", 1010 1018 Fetch: "resource-type-fetch", 1019 Ping: "resource-type-ping", 1020 Beacon: "resource-type-beacon", 1011 1021 WebSocket: "resource-type-websocket", 1012 Other: "resource-type-other" 1022 Other: "resource-type-other", 1013 1023 }; 1014 1024 -
trunk/Source/WebInspectorUI/UserInterface/Models/ResourceCollection.js
r222573 r222739 54 54 case WI.Resource.Type.Fetch: 55 55 return WI.ResourceCollection.TypeVerifier.Fetch; 56 case WI.Resource.Type.Ping: 57 return WI.ResourceCollection.TypeVerifier.Ping; 58 case WI.Resource.Type.Beacon: 59 return WI.ResourceCollection.TypeVerifier.Beacon; 56 60 case WI.Resource.Type.WebSocket: 57 61 return WI.ResourceCollection.TypeVerifier.WebSocket; … … 201 205 XHR: (object) => WI.Collection.TypeVerifier.Resource(object) && object.type === WI.Resource.Type.XHR, 202 206 Fetch: (object) => WI.Collection.TypeVerifier.Resource(object) && object.type === WI.Resource.Type.Fetch, 207 Beacon: (object) => WI.Collection.TypeVerifier.Resource(object) && object.type === WI.Resource.Type.Beacon, 203 208 WebSocket: (object) => WI.Collection.TypeVerifier.Resource(object) && object.type === WI.Resource.Type.WebSocket, 204 209 Other: (object) => WI.Collection.TypeVerifier.Resource(object) && object.type === WI.Resource.Type.Other, -
trunk/Source/WebInspectorUI/UserInterface/Models/SourceCode.js
r220119 r222739 198 198 var error = parameters.error; 199 199 if (parameters.base64Encoded) 200 content = decodeBase64ToBlob(content, this.mimeType);200 content = content ? decodeBase64ToBlob(content, this.mimeType) : ""; 201 201 202 202 var revision = this.revisionForRequestedContent; -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r222485 r222739 109 109 case WI.Resource.Type.Fetch: 110 110 return "XHR"; 111 case WI.Resource.Type.Ping: 112 return WI.UIString("ping"); 113 case WI.Resource.Type.Beacon: 114 return WI.UIString("Beacon"); 111 115 case WI.Resource.Type.WebSocket: 112 116 case WI.Resource.Type.Other: -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js
r220119 r222739 72 72 case WI.Resource.Type.XHR: 73 73 case WI.Resource.Type.Fetch: 74 case WI.Resource.Type.Ping: 75 case WI.Resource.Type.Beacon: 74 76 // FIXME: <https://webkit.org/b/165495> Web Inspector: XHR / Fetch for non-text content should not show garbled text 75 // XHR / Fetch contentmay not always be text.77 // The response content for these requests may not always be text. 76 78 this._responseContentView = new WI.TextResourceContentView(this._resource); 77 79 break; -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js
r220119 r222739 87 87 } 88 88 89 showMessage(message) 90 { 91 this.element.removeChildren(); 92 this.element.appendChild(WI.createMessageTextView(message)); 93 } 94 89 95 addIssue(issue) 90 96 { -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceIcons.css
r220294 r222739 72 72 } 73 73 74 .resource-icon.resource-type-ping .icon, 75 .resource-icon.resource-type-beacon .icon { 76 content: url(../Images/Beacon.svg); 77 } 78 74 79 .canvas.canvas-2d .icon { 75 80 content: url(../Images/Canvas2D.svg); … … 131 136 content: image-set(url(../Images/WebSocketLarge.png) 1x, url(../Images/WebSocketLarge@2x.png) 2x); 132 137 } 138 139 /* FIXME: <https://webkit.org/b/177642> Web Inspector: Add GTK icons for Beacon / Ping requests */ 140 body:not(.mac-platform, .windows-platform) .resource-icon.resource-type-ping .icon, 141 body:not(.mac-platform, .windows-platform) .resource-icon.resource-type-beacon .icon { 142 content: image-set(url(../Images/DocumentGeneric.png) 1x, url(../Images/DocumentGeneric@2x.png) 2x); 143 } 144 body:not(.mac-platform, .windows-platform) .large .resource-icon.resource-type-ping .icon, 145 body:not(.mac-platform, .windows-platform) .large .resource-icon.resource-type-beacon .icon { 146 content: image-set(url(../Images/DocumentGenericLarge.png) 1x, url(../Images/DocumentGenericLarge@2x.png) 2x); 147 } -
trunk/Source/WebInspectorUI/UserInterface/Views/TextResourceContentView.js
r221338 r222739 209 209 this._codeCoverageButtonNavigationItem.enabled = this._textEditor.canShowCoverageHints(); 210 210 this._codeCoverageButtonNavigationItem.activated = WI.enableControlFlowProfilerSetting.value; 211 212 if (!this._textEditor.string) 213 this.showMessage(WI.UIString("Resource has no content")); 211 214 } 212 215 -
trunk/Source/WebKit/ChangeLog
r222736 r222739 1 2017-10-02 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Include Beacon and Ping requests in Network tab 4 https://bugs.webkit.org/show_bug.cgi?id=177641 5 <rdar://problem/33086839> 6 7 Reviewed by Chris Dumez. 8 9 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 10 (WebKit::NetworkConnectionToWebProcess::loadPing): 11 (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): 12 * NetworkProcess/NetworkConnectionToWebProcess.h: 13 * NetworkProcess/PingLoad.cpp: 14 (WebKit::PingLoad::PingLoad): 15 (WebKit::PingLoad::didFinish): 16 (WebKit::PingLoad::didReceiveResponseNetworkSession): 17 * NetworkProcess/PingLoad.h: 18 * WebProcess/Network/NetworkProcessConnection.cpp: 19 (WebKit::NetworkProcessConnection::didFinishPingLoad): 20 * WebProcess/Network/NetworkProcessConnection.h: 21 * WebProcess/Network/NetworkProcessConnection.messages.in: 22 * WebProcess/Network/WebLoaderStrategy.cpp: 23 (WebKit::WebLoaderStrategy::networkProcessCrashed): 24 (WebKit::WebLoaderStrategy::startPingLoad): 25 (WebKit::WebLoaderStrategy::didFinishPingLoad): 26 * WebProcess/Network/WebLoaderStrategy.h: 27 Pass an optional ResourceResponse back to the ping completion handler. 28 1 29 2017-10-02 Alex Christensen <achristensen@webkit.org> 2 30 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r222684 r222739 241 241 void NetworkConnectionToWebProcess::loadPing(NetworkResourceLoadParameters&& loadParameters, HTTPHeaderMap&& originalRequestHeaders) 242 242 { 243 auto completionHandler = [this, protectedThis = makeRef(*this), identifier = loadParameters.identifier] (const ResourceError& error ) {244 didFinishPingLoad(identifier, error );243 auto completionHandler = [this, protectedThis = makeRef(*this), identifier = loadParameters.identifier] (const ResourceError& error, const ResourceResponse& response) { 244 didFinishPingLoad(identifier, error, response); 245 245 }; 246 246 … … 257 257 } 258 258 259 void NetworkConnectionToWebProcess::didFinishPingLoad(uint64_t pingLoadIdentifier, const ResourceError& error )259 void NetworkConnectionToWebProcess::didFinishPingLoad(uint64_t pingLoadIdentifier, const ResourceError& error, const ResourceResponse& response) 260 260 { 261 261 if (!m_connection->isValid()) 262 262 return; 263 263 264 m_connection->send(Messages::NetworkProcessConnection::DidFinishPingLoad(pingLoadIdentifier, error ), 0);264 m_connection->send(Messages::NetworkProcessConnection::DidFinishPingLoad(pingLoadIdentifier, error, response), 0); 265 265 } 266 266 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r222673 r222739 66 66 67 67 void didCleanupResourceLoader(NetworkResourceLoader&); 68 void didFinishPingLoad(uint64_t pingLoadIdentifier, const WebCore::ResourceError& );68 void didFinishPingLoad(uint64_t pingLoadIdentifier, const WebCore::ResourceError&, const WebCore::ResourceResponse&); 69 69 70 70 bool captureExtraNetworkLoadMetricsEnabled() const { return m_captureExtraNetworkLoadMetricsEnabled; } -
trunk/Source/WebKit/NetworkProcess/PingLoad.cpp
r222602 r222739 45 45 using namespace WebCore; 46 46 47 PingLoad::PingLoad(NetworkResourceLoadParameters&& parameters, HTTPHeaderMap&& originalRequestHeaders, WTF::CompletionHandler<void(const ResourceError& )>&& completionHandler)47 PingLoad::PingLoad(NetworkResourceLoadParameters&& parameters, HTTPHeaderMap&& originalRequestHeaders, WTF::CompletionHandler<void(const ResourceError&, const ResourceResponse&)>&& completionHandler) 48 48 : m_parameters(WTFMove(parameters)) 49 49 , m_originalRequestHeaders(WTFMove(originalRequestHeaders)) … … 78 78 } 79 79 80 void PingLoad::didFinish(const ResourceError& error )81 { 82 m_completionHandler(error );80 void PingLoad::didFinish(const ResourceError& error, const ResourceResponse& response) 81 { 82 m_completionHandler(error, response); 83 83 delete this; 84 84 } … … 176 176 RELEASE_LOG_IF_ALLOWED("didReceiveResponseNetworkSession - httpStatusCode: %d", response.httpStatusCode()); 177 177 completionHandler(PolicyAction::Ignore); 178 didFinish( );178 didFinish({ }, response); 179 179 } 180 180 -
trunk/Source/WebKit/NetworkProcess/PingLoad.h
r222570 r222739 32 32 #include <WebCore/ContentExtensionsBackend.h> 33 33 #include <WebCore/ResourceError.h> 34 #include <WebCore/ResourceResponse.h> 34 35 #include <wtf/CompletionHandler.h> 35 36 … … 46 47 class PingLoad final : private NetworkDataTaskClient { 47 48 public: 48 PingLoad(NetworkResourceLoadParameters&&, WebCore::HTTPHeaderMap&& originalRequestHeaders, WTF::CompletionHandler<void(const WebCore::ResourceError& )>&&);49 PingLoad(NetworkResourceLoadParameters&&, WebCore::HTTPHeaderMap&& originalRequestHeaders, WTF::CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)>&&); 49 50 50 51 private: … … 78 79 79 80 const WebCore::ResourceRequest& currentRequest() const; 80 void didFinish(const WebCore::ResourceError& = { } );81 void didFinish(const WebCore::ResourceError& = { }, const WebCore::ResourceResponse& response = { }); 81 82 82 83 NetworkResourceLoadParameters m_parameters; 83 84 WebCore::HTTPHeaderMap m_originalRequestHeaders; // Needed for CORS checks. 84 WTF::CompletionHandler<void(const WebCore::ResourceError& )> m_completionHandler;85 WTF::CompletionHandler<void(const WebCore::ResourceError&, const WebCore::ResourceResponse&)> m_completionHandler; 85 86 RefPtr<NetworkDataTask> m_task; 86 87 WebCore::Timer m_timeoutTimer; -
trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp
r222684 r222739 137 137 } 138 138 139 void NetworkProcessConnection::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error )139 void NetworkProcessConnection::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response) 140 140 { 141 WebProcess::singleton().webLoaderStrategy().didFinishPingLoad(pingLoadIdentifier, WTFMove(error) );141 WebProcess::singleton().webLoaderStrategy().didFinishPingLoad(pingLoadIdentifier, WTFMove(error), WTFMove(response)); 142 142 } 143 143 -
trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h
r222613 r222739 74 74 75 75 void didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames); 76 void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&& );76 void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&); 77 77 void didFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError&&); 78 78 -
trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.messages.in
r222613 r222739 28 28 29 29 DidWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, Vector<String> filenames) 30 DidFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError error )30 DidFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError error, WebCore::ResourceResponse response) 31 31 DidFinishPreconnection(uint64_t preconnectionIdentifier, WebCore::ResourceError error) 32 32 } -
trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
r222673 r222739 356 356 auto pingLoadCompletionHandlers = WTFMove(m_pingLoadCompletionHandlers); 357 357 for (auto& pingLoadCompletionHandler : pingLoadCompletionHandlers.values()) 358 pingLoadCompletionHandler(internalError(URL()) );358 pingLoadCompletionHandler(internalError(URL()), { }); 359 359 360 360 auto preconnectCompletionHandlers = WTFMove(m_preconnectCompletionHandlers); … … 410 410 if (!networkingContext) { 411 411 if (completionHandler) 412 completionHandler(internalError(request.url()) );412 completionHandler(internalError(request.url()), { }); 413 413 return; 414 414 } … … 422 422 if (!document) { 423 423 if (completionHandler) 424 completionHandler(internalError(request.url()) );424 completionHandler(internalError(request.url()), { }); 425 425 return; 426 426 } … … 458 458 } 459 459 460 void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error )460 void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response) 461 461 { 462 462 if (auto completionHandler = m_pingLoadCompletionHandlers.take(pingLoadIdentifier)) 463 completionHandler(WTFMove(error) );463 completionHandler(WTFMove(error), WTFMove(response)); 464 464 } 465 465 -
trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
r222673 r222739 61 61 62 62 void startPingLoad(WebCore::Frame&, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap& originalRequestHeaders, const WebCore::FetchOptions&, PingLoadCompletionHandler&&) final; 63 void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&& );63 void didFinishPingLoad(uint64_t pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&); 64 64 65 65 void preconnectTo(WebCore::NetworkingContext&, const WebCore::URL&, WebCore::StoredCredentialsPolicy, PreconnectCompletionHandler&&) final;
Note: See TracChangeset
for help on using the changeset viewer.