Closed
Bug 1148935
Opened 8 years ago
Closed 8 years ago
Correctly reflect "worker" and "sharedworker" RequestContext values
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file, 1 obsolete file)
26.40 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8585201 -
Flags: review?(bugs)
![]() |
||
Comment 2•8 years ago
|
||
What's our compat story for extensions with these changes? We're making changes that look API and ABI compatible, but will break existing content policy implementations in extensions, no?
Flags: needinfo?(ehsan)
Comment 3•8 years ago
|
||
The addons compat story has been discussed in other relevant bugs. All these nsIContentPolicy changes will break tons of addons, so need to be rather careful. All the changes should go in at once, after notifying addon authors about the changes. (Or some non-breaking way to deal with this stuff need to be found.) In principle it would be nice if nsIContentPolicy load types would map to some spec, but perhaps there are too many addons to update that we can't really do it this way.
Comment 4•8 years ago
|
||
Looking addons' nsIContentPolicy usage some more, I think this approach might not be doable after all. Just too many addons would be broken, way too many.
Comment 5•8 years ago
|
||
Comment on attachment 8585201 [details] [diff] [review] Split nsIContentPolicy::TYPE_SCRIPT into TYPE_SCRIPT, TYPE_WORKER, TYPE_SHAREDWORKER and TYPE_SERVICEWORKER so that Request.context can reflect the "worker", "sharedworker" and "serviceworker" values correctly So, this is r- for all the similar nsIContentPolicy changes, until it is figured out what can be done and what should be done. (I know I gave r+ to some other changes, but I didn't realize ServiceWorker would need to change nsIContentPolicy so much. )
Attachment #8585201 -
Flags: review?(bugs) → review-
Assignee | ||
Comment 6•8 years ago
|
||
I thought about this a bit more, and if we cannot change the nsContentPolicyTypes, the only way around it would be to store the RequestContext separately alongside the nsContentPolicyTypes and use the RequestContext in our code where more granular information about the load is needed (such as obviously when reflecting Request.context!). How does that sound? I think that sucks on some level because now we'd have two types that contain very similar but subtly different information, but perhaps it's not too had if we cannot change the existing context types? Also, a question on the mechanics of the change. RequestContext is an enum class generated by the WebIDL codegen. Is that OK to be used in Necko (for example in LoadInfo) or do I need to make up my own enum that basically maps directly to RequestContext inside Necko?
Flags: needinfo?(ehsan)
Flags: needinfo?(bzbarsky)
Flags: needinfo?(bugs)
![]() |
||
Comment 7•8 years ago
|
||
I agree that sucks. If it were not for the fact that the failure mode of an addon not being updated to the new setup is security holes, basically (e.g. noscript allowing script to run), I would say we should just change the existing nsContentPolicyTypes... Necko is already including various binding headers. See <http://mxr.mozilla.org/mozilla-central/search?string=binding.h&find=netwerk>. So just using the binding enum directly in necko seems like it would be fine to me.
Flags: needinfo?(bzbarsky)
Assignee | ||
Updated•8 years ago
|
Summary: Split nsIContentPolicy::TYPE_SCRIPT into TYPE_SCRIPT, TYPE_WORKER, TYPE_SHAREDWORKER and TYPE_SERVICEWORKER so that Request.context can reflect the "worker", "sharedworker" and "serviceworker" values correctly → Correctly reflect "worker" and "sharedworker" RequestContext values
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(bugs)
Assignee | ||
Comment 8•8 years ago
|
||
Attachment #8623424 -
Flags: review?(bugs)
Comment 9•8 years ago
|
||
Comment on attachment 8623424 [details] [diff] [review] Correctly reflect worker and sharedworker RequestContext values + switch (aWorkerType) { + default: + MOZ_ASSERT_UNREACHABLE("Invalid worker type"); + case WorkerTypeDedicated: + return nsIContentPolicy::TYPE_INTERNAL_WORKER; + case WorkerTypeShared: + return nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER; + case WorkerTypeService: + return nsIContentPolicy::TYPE_SCRIPT; + } + } Please put default: to last.
Attachment #8623424 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8585201 -
Attachment is obsolete: true
Comment 11•8 years ago
|
||
Backed out for Werror bustage. https://treeherder.mozilla.org/logviewer.html#?job_id=10904442&repo=mozilla-inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/9f1eac8fb874
Comment 13•8 years ago
|
||
sorry had to back this out again, seems this and the other landing caused test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=10918636&repo=mozilla-inbound
Flags: needinfo?(ehsan)
Comment 14•8 years ago
|
||
Backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/53c66ab06d38
Assignee | ||
Comment 15•8 years ago
|
||
Bug 1178339 and bug 1163410 should address the remaining issues in this test on Android. I'm going to reland this patch while they are waiting for review...
Comment 17•8 years ago
|
||
Backed out for Werror bustage. https://treeherder.mozilla.org/logviewer.html#?job_id=11224618&repo=mozilla-inbound https://hg.mozilla.org/integration/mozilla-inbound/rev/da4e8214484b
Comment 19•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/657293a5031a
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•8 years ago
|
Target Milestone: mozilla41 → mozilla42
Updated•4 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•