Closed Bug 1269162 Opened 8 years ago Closed 8 years ago

Remove separate worker binding for XMLHttpRequest and friends

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: khuey, Assigned: baku)

References

Details

(Whiteboard: btpp-backlog)

Attachments

(6 files, 2 obsolete files)

This likely requires introducing an abstract base class that can be shared between the main thread and worker thread implementations.
Blocks: 1249739
Whiteboard: btpp-backlog
This is the last pure worker binding. All the others have been removed or they have a patch ready to be reviewed.
I think it's time to think about how/when rewrite XHR from scratch.
I did this task in 6 patches. The first patch is about renaming dom/workers/XMLHttpRequest.* to XMLHttpRequestWorker. This will be useful in the next patches.
Assignee: nobody → amarchesini
Attachment #8763700 - Flags: review?(bugs)
Also this second patch is just about renaming things.
Attachment #8763701 - Flags: review?(bugs)
Attached patch part 3 - dom/xhrSplinter Review
Third step is moving everything in dom/xhr
Attachment #8763702 - Flags: review?(bugs)
Separate files for XMLHttpRequestEventTarget
Attachment #8763703 - Flags: review?(bugs)
Unify XMLHttpRequestUpload in 1 single implementation.
Attachment #8763705 - Flags: review?(bugs)
Attached patch part 6 - XMLHttpRequest (obsolete) — Splinter Review
This last step puts everything together. We have 3 classes in total for XMLHttpRequest:

1. XMLHttpRequest - WebIDL class with virtual methods.
2. XMLHttpRequestWorker - Worker implementation
3. XMLHttpRequestMainThread - Main-Thread implementation
Attachment #8763706 - Flags: review?(bugs)
Attached patch part 6 - XMLHttpRequest (obsolete) — Splinter Review
Attachment #8763706 - Attachment is obsolete: true
Attachment #8763706 - Flags: review?(bugs)
Attachment #8763773 - Flags: review?(bugs)
Comment on attachment 8763700 [details] [diff] [review]
part 1 - XMLHttpRequestWorker

> 'XMLHttpRequest': [
> {
>     'nativeType': 'nsXMLHttpRequest',
>     'implicitJSContext': [ 'send'],
> },
> {
>+    'nativeType': 'mozilla::dom::workers::XMLHttpRequestWorker',
>+    'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestWorker.h',
I'm pretty sure the headerFile is wrong, pointing to some non-existing file.
Does this actually compile? But since the rest of the patch is just renaming, r+, but fix this.
Attachment #8763700 - Flags: review?(bugs) → review+
Attachment #8763701 - Flags: review?(bugs) → review+
Attachment #8763703 - Flags: review?(bugs) → review+
Comment on attachment 8763705 [details] [diff] [review]
part 5 - XMLHttpRequestUpload


>+private:
>+  virtual ~XMLHttpRequestUpload()
>+  {}
>+
>+  RefPtr<workers::XMLHttpRequestWorker> mXHR;
Why do we need this? I see it is copied from worker implementation, but rather annoying to add to this generic implementation.
Please add a comment.
Attachment #8763705 - Flags: review?(bugs) → review+
Comment on attachment 8763702 [details] [diff] [review]
part 3 - dom/xhr

This is of course totally unrelated patch, so could (or should) have been done in a separate bug.
But I can see doing this here helps with testing.

I tried to check that we aren't losing any tests. Hopefully I didn't miss anything.
Attachment #8763702 - Flags: review?(bugs) → review+
> >+    'nativeType': 'mozilla::dom::workers::XMLHttpRequestWorker',
> >+    'headerFile': 'mozilla/dom/workers/bindings/XMLHttpRequestWorker.h',

This is correct. in dom/workers/moz.build we have:

EXPORTS.mozilla.dom.workers.bindings += [
 ... XMLHttpRequestWorker.h
The previous version was breaking a test. The issue was about XMLHttpRequestMainThread::SetMozBackgroundRequest: for WebIDL (main-thread) it should not throw errors, for Worker and XPIDL it should.
Attachment #8763773 - Attachment is obsolete: true
Attachment #8763773 - Flags: review?(bugs)
Attachment #8764846 - Flags: review?(bugs)
Attachment #8764846 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e12af97993d
part 1 - Move XHR in workers to XMLHttpRequestWorker, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/c01653e7ad7c
part 2 - Move XHRUpload in workers to XMLHttpRequestUploadWorker, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/55a63a62c0dd
part 3 - Move XHR code into dom/xhr, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/e03db893b8da
part 4 - Move XMLHttpRequestEventTarget in separate files, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/ddb3b5ac04af
part 5 - Merge XMLHttpRequestUploadWorker and XMLHttpRequestUpload, r=smaug
https://hg.mozilla.org/integration/mozilla-inbound/rev/155012d3d373
part 6 - Merge XMLHttpRequestWorker and XMLHttpRequestMainThread, r=smaug
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: