ubuntu-webapps-bugs team mailing list archive
-
ubuntu-webapps-bugs team
-
Mailing list archive
-
Message #02239
[Bug 1415662] [NEW] Cancelling a request in onBeforeRedirect doesn't actually do anything
Public bug reported:
I'm looking at bug 1399195 - the onBeforeRedirect test cancels the
request in one case, but then never verifies that the request is
actually cancelled. Having tried it, it turns out that this just doesn't
work at all.
The issue is that the callback hangs off
NetworkDelegate::OnBeforeRedirect(), which is called from
net::URLRequest::Redirect(). If the application wants to prevent the
redirect, Oxide calls net::URLRequet::Cancel(), but it's too late to do
this and as soon as we return from NetworkDelegate::OnBeforeRedirect,
Chromium restarts the request with the new URL.
To do this, we need to implement a ResourceThrottle, and call in to the
application on ResourceThrottle::WillRedirectRequest. This is called
much earlier than the NetworkDelegate callback, and gives us an
opportunity to actually cancel the request properly.
** Affects: oxide
Importance: Medium
Assignee: Chris Coulson (chrisccoulson)
Status: In Progress
** Changed in: oxide
Importance: Undecided => Medium
** Changed in: oxide
Status: New => Triaged
** Changed in: oxide
Milestone: None => branch-1.6
** Changed in: oxide
Assignee: (unassigned) => Chris Coulson (chrisccoulson)
** Changed in: oxide
Status: Triaged => In Progress
** Description changed:
- I'm looking at bug 1415620 - the onBeforeRedirect test cancels the
+ I'm looking at bug 1399195 - the onBeforeRedirect test cancels the
request in one case, but then never verifies that the request is
actually cancelled. Having tried it, it turns out that this just doesn't
work at all.
The issue is that the callback hangs off
NetworkDelegate::OnBeforeRedirect(), which is called from
net::URLRequest::Redirect(). If the application wants to prevent the
redirect, Oxide calls net::URLRequet::Cancel(), but it's too late to do
this and as soon as we return from NetworkDelegate::OnBeforeRedirect,
Chromium restarts the request with the new URL.
To do this, we need to implement a ResourceThrottle, and call in to the
application on ResourceThrottle::WillRedirectRequest. This is called
much earlier than the NetworkDelegate callback, and gives us an
opportunity to actually cancel the request properly.
--
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to Oxide.
https://bugs.launchpad.net/bugs/1415662
Title:
Cancelling a request in onBeforeRedirect doesn't actually do anything
Status in Oxide Webview:
In Progress
Bug description:
I'm looking at bug 1399195 - the onBeforeRedirect test cancels the
request in one case, but then never verifies that the request is
actually cancelled. Having tried it, it turns out that this just
doesn't work at all.
The issue is that the callback hangs off
NetworkDelegate::OnBeforeRedirect(), which is called from
net::URLRequest::Redirect(). If the application wants to prevent the
redirect, Oxide calls net::URLRequet::Cancel(), but it's too late to
do this and as soon as we return from
NetworkDelegate::OnBeforeRedirect, Chromium restarts the request with
the new URL.
To do this, we need to implement a ResourceThrottle, and call in to
the application on ResourceThrottle::WillRedirectRequest. This is
called much earlier than the NetworkDelegate callback, and gives us an
opportunity to actually cancel the request properly.
To manage notifications about this bug go to:
https://bugs.launchpad.net/oxide/+bug/1415662/+subscriptions
Follow ups
References