Bug 22619 - XMLHttpRequest needs to use scriptExecutionContext() instead of document() where possible.
Summary: XMLHttpRequest needs to use scriptExecutionContext() instead of document() wh...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-02 23:59 PST by David Levin
Modified: 2008-12-03 23:22 PST (History)
1 user (show)

See Also:


Attachments
Patch for bug. (5.39 KB, patch)
2008-12-03 00:07 PST, David Levin
no flags Details | Formatted Diff | Diff
Removed the change to reportUnsafeUsage. (3.00 KB, patch)
2008-12-03 12:05 PST, David Levin
ap: review-
Details | Formatted Diff | Diff
Addressed comments. (1.88 KB, patch)
2008-12-03 21:53 PST, David Levin
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2008-12-02 23:59:04 PST
XMLHttpRequest should avoid using document() when a worker is being used.  The change should tackle the straightforward modifications to enable this.
Comment 1 David Levin 2008-12-03 00:07:32 PST
Created attachment 25701 [details]
Patch for bug.

It doesn't yet remove all references to document() in XMLHttpRequest.  It will take some more changes to do that (to add in the wiring to send things back through the Worker's owner document).
Comment 2 David Levin 2008-12-03 12:05:44 PST
Created attachment 25717 [details]
Removed the change to reportUnsafeUsage.

"reportException is for reporting exceptions, not arbitrary errors", so I removed its usage in reportUnsafeUsage.
Comment 3 Alexey Proskuryakov 2008-12-03 13:34:10 PST
Comment on attachment 25717 [details]
Removed the change to reportUnsafeUsage.

Code changes all look right, but the ChangeLog may be a little too expressive :). I think that the full history should go to bug comments, not into ChangeLog. Also, the description of responseXML changes is a bit misleading - the purpose is not to zero out m_responseXML, but to return null without executing code that is not thread safe.

I'm going to say r- for now, because ChangeLog takes the biggest part of this patch, and it needs to be significantly modified.
Comment 4 David Levin 2008-12-03 21:53:49 PST
Created attachment 25735 [details]
Addressed comments.
Comment 5 Alexey Proskuryakov 2008-12-03 22:56:41 PST
Comment on attachment 25735 [details]
Addressed comments.

r=me
Comment 6 Alexey Proskuryakov 2008-12-03 23:22:15 PST
Committed revision 38987.