summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2015-01-14 14:38:08 +0100
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2015-01-21 16:00:11 +0100
commitf059f40e33be775a6ebf4cfdf61eb981657649f7 (patch)
tree32fed24bc618e9558aec7b1d18ff1f716292ec02 /src
parent87dfbc6f76fc5c44b636aef417f0c9a95e64077b (diff)
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 <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/network_delegate_qt.cpp13
1 files changed, 6 insertions, 7 deletions
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