Bug 43974 - Geolocation requests in progress when the frame is disconnected should invoke the error callback
Summary: Geolocation requests in progress when the frame is disconnected should invoke...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-13 08:18 PDT by Steve Block
Modified: 2010-08-16 12:13 PDT (History)
6 users (show)

See Also:


Attachments
Patch (12.92 KB, patch)
2010-08-13 08:46 PDT, Steve Block
no flags Details | Formatted Diff | Diff
Patch (12.97 KB, patch)
2010-08-16 02:37 PDT, Steve Block
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Block 2010-08-13 08:18:42 PDT
Currently, Geolocation::disconnectFrame() calls stopTimers() which prevents any future callbacks. This was added in http://trac.webkit.org/changeset/59859 for Bug 39388 to prevent callbacks after the script context has gone away.

Instead, we should attempt to invoke the error callback for all ongoing requests. This is safe because we now make sure that the script context is still good before we make each callback, see Bug 40162.
Comment 1 Steve Block 2010-08-13 08:46:45 PDT
Created attachment 64349 [details]
Patch
Comment 2 Steve Block 2010-08-16 02:37:39 PDT
Created attachment 64481 [details]
Patch
Comment 3 Alexey Proskuryakov 2010-08-16 03:41:22 PDT
Comment on attachment 64481 [details]
Patch

> Instead, we should attempt to invoke the error callback for all ongoing requests.

I think that this is a good change because it matches XMLHttpRequest (which dispatches an abort event when window is closed). But for posterity, it would be best to document why else we want this. Does any spec say so?

+    if (m_fatalError)
+        return;

It might be helpful to add a comment explaining why the first error wins.

r=me. The split js-test makes me sad.
Comment 4 Steve Block 2010-08-16 05:31:26 PDT
Committed r65416: <http://trac.webkit.org/changeset/65416>
Comment 5 Steve Block 2010-08-16 05:33:31 PDT
> I think that this is a good change because it matches XMLHttpRequest (which
> dispatches an abort event when window is closed). But for posterity, it would
> be best to document why else we want this. Does any spec say so?
No, the spec isn't specific to JavaScript or browsers so doesn't mention anything about Frames or windows.

> It might be helpful to add a comment explaining why the first error wins.
Done
Comment 6 WebKit Review Bot 2010-08-16 06:13:15 PDT
http://trac.webkit.org/changeset/65416 might have broken SnowLeopard Intel Release (Tests)
Comment 7 Steve Block 2010-08-16 12:13:16 PDT
Problems with fast/dom/Geolocation/disconnected-frame-permission-denied.html are being tracked in Bug 44059