From f059f40e33be775a6ebf4cfdf61eb981657649f7 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 14 Jan 2015 14:38:08 +0100 Subject: Fix WebSockets after the 40 update WebSockets go through OnBeforeURLRequest but don't have a ResourceRequestInfo. We would force them to fail with an ERR_ABORTED. Fix the issue by not getting in the way and return net::OK in the cases where we won't intercept the request. Change-Id: I4cbb16171a9e7e295223e18946ae92004781b26b Reviewed-by: Andras Becsi --- src/core/network_delegate_qt.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp index fce563b47..79af93e06 100644 --- a/src/core/network_delegate_qt.cpp +++ b/src/core/network_delegate_qt.cpp @@ -78,15 +78,14 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); const content::ResourceRequestInfo *info = content::ResourceRequestInfo::ForRequest(request); - int renderProcessId; - int renderFrameId; - if (!info || !info->GetRenderFrameForRequest(request, &renderProcessId, &renderFrameId)) - // Abort the request if it has no associated render info / render view. - return net::ERR_ABORTED; + if (!info) + return net::OK; content::ResourceType resourceType = info->GetResourceType(); - // Only intercept MAIN_FRAME and SUB_FRAME. - if (!content::IsResourceTypeFrame(resourceType)) + int renderProcessId; + int renderFrameId; + // Only intercept MAIN_FRAME and SUB_FRAME with an associated render frame. + if (!content::IsResourceTypeFrame(resourceType) || !info->GetRenderFrameForRequest(request, &renderProcessId, &renderFrameId)) return net::OK; // Track active requests since |callback| and |new_url| are valid -- cgit v1.2.3