Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible for iframes to create their own pipeline ID. #7807

Merged
merged 1 commit into from Oct 6, 2015

Conversation

@glennw
Copy link
Member

glennw commented Sep 30, 2015

This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.

Review on Reviewable

@highfive
Copy link

highfive commented Sep 30, 2015

warning Warning warning

  • These commits modify layout code, but no reftests are modified. Please consider adding a reftest!
@glennw
Copy link
Member Author

glennw commented Sep 30, 2015

@jdm This introduces the core functionality that allows iframes to generate their own pipeline IDs. This is the first step towards allowing us to simplify all management of SubpageIds. This should be a much simpler PR to review than doing the entire change at once. r?

@jdm
Copy link
Member

jdm commented Oct 1, 2015

Reviewed 9 of 9 files at r1.
Review status: all files reviewed at latest revision, 11 unresolved discussions, all commit checks successful.


components/compositing/constellation.rs, line 336 [r1] (raw file):
I'm finding the following difficult to reason about:

  • the script thread for a pipeline in namespace 1 with index 1 is created
  • it starts loading a URL in an iframe, sending an ID with namespace 1 with index 2 to the constellation
  • the constellation creates a new pipeline with ID of namespace 1 and index 2, but the contained pipeline_namespace_id in PipelineContent is namespace 2
  • when the new pipeine creates a new script thread, any iframes created in that script thread will have IDs of namespace 2, index N?

I guess I haven't found anything that seems wrong, per se, but the setup is feels less intuitive than it was before. I fear what will happen when we start grouping pipelines in the same script task by origin, even for simple setups like clicking a link on a.com that goes to a.com/page and uses the same script thread for the load.


components/compositing/constellation.rs, line 620 [r1] (raw file):
The interaction between this and initializing the next namespace as 1 in the constructor is extremely subtle. Remind me why we can't use new here instead?


components/devtools/lib.rs, line 436 [r1] (raw file):
If this ends up being the only legitimate use for PipelineId::nil, it should probably be called fake_me_a_pipeline instead.


components/gfx/paint_task.rs, line 186 [r1] (raw file):
Same note as further down.


components/layout/layout_task.rs, line 280 [r1] (raw file):
Same note as further down.


components/msg/constellation_msg.rs, line 226 [r1] (raw file):
We're going to need to either turn this into a struct variant or a simple struct wrapper and provide meaningful names.


components/msg/constellation_msg.rs, line 397 [r1] (raw file):
The similarity between PipelineIdNamespace and PipelineNamespaceId is unfortunate. What about PipelineNamespace? Documentation of the relationship between pipeline IDs and namespaces would also be lovely.


components/msg/constellation_msg.rs, line 428 [r1] (raw file):
Is it possible to use Cell instead?


components/msg/constellation_msg.rs, line 451 [r1] (raw file):
I'd love to get rid of this method if we can; I find its existence very confusing. At minimum we should clearly document when it's appropriate to use.


components/script/dom/htmliframeelement.rs, line 123 [r1] (raw file):
Let's use a local binding to the new pipeline ID instead of using unwrap here.


components/script/script_task.rs, line 496 [r1] (raw file):
We should have a custom representation like (namespace,index); I assume the actual output we get here right now will be less than optimal.


Comments from the review on Reviewable.io

@nox
Copy link
Member

nox commented Oct 2, 2015

I wonder if this fixes #7826.

@glennw
Copy link
Member Author

glennw commented Oct 5, 2015

Review status: 3 of 9 files reviewed at latest revision, 11 unresolved discussions, all commit checks successful.


components/compositing/constellation.rs, line 336 [r1] (raw file):
Does it help to think about it as the namespace ID being an identifier for the thread that created the pipeline ID? It is less intuitive, I agree - but I feel that it's a worthwhile tradeoff for the benefits (we will be able to remove all subpage concepts from the compositor, layout, script task etc).


components/compositing/constellation.rs, line 620 [r1] (raw file):
Only because of the code in devtools you noted below - I will ping @jgragam to find out what we can do with that.


components/devtools/lib.rs, line 0 [r1] (raw file):
Agreed - I'll discuss with jgraham


components/gfx/paint_task.rs, line 0 [r1] (raw file):
Done.


components/layout/layout_task.rs, line 0 [r1] (raw file):
Done.


components/msg/constellation_msg.rs, line 0 [r1] (raw file):
Done.


components/msg/constellation_msg.rs, line 0 [r1] (raw file):
I have added a TODO comment for now.


components/msg/constellation_msg.rs, line 0 [r1] (raw file):
Done.


components/msg/constellation_msg.rs, line 0 [r1] (raw file):
This comment seems to be about a line not included in this PR?


components/script/dom/htmliframeelement.rs, line 0 [r1] (raw file):
Done.


components/script/script_task.rs, line 0 [r1] (raw file):
Done.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Oct 5, 2015

-S-awaiting-review +S-needs-code-changes -S-awaiting-answer


Reviewed 6 of 6 files at r2.
Review status: all files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


components/compositing/constellation.rs, line 336 [r1] (raw file):
Actually, when you phrase it like that it makes a lot more sense to me. Let's make sure to document that somewhere :)


components/msg/constellation_msg.rs, line 226 [r1] (raw file):
Not if you look at the original context by dragging r1->r2 in reviewable.


components/msg/constellation_msg.rs, line 397 [r1] (raw file):
Can we turn it into doc comments? Otherwise it won't show up on doc.servo.org.


components/msg/constellation_msg.rs, line 406 [r2] (raw file):
I first read this as script threads and constellations create namespaces willy-nilly, but we should be clear that only the constellation creates new namespaces so there's no danger of collisions.


Comments from the review on Reviewable.io

@glennw
Copy link
Member Author

glennw commented Oct 5, 2015

Review status: 5 of 9 files reviewed at latest revision, 6 unresolved discussions, all commit checks successful.


components/compositing/constellation.rs, line 0 [r1] (raw file):
Done.


components/msg/constellation_msg.rs, line 226 [r1] (raw file):
Done.


components/msg/constellation_msg.rs, line 396 [r2] (raw file):
Done.


components/msg/constellation_msg.rs, line 397 [r1] (raw file):
Done.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Oct 6, 2015

Looks good! Squash and merge!
-S-awaiting-review +S-needs-squash


Reviewed 4 of 4 files at r3.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-squash and removed S-awaiting-review labels Oct 6, 2015
This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.
@glennw glennw force-pushed the glennw:pid branch from 29f45bf to 5645dba Oct 6, 2015
@glennw
Copy link
Member Author

glennw commented Oct 6, 2015

@bors-servo r=jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 6, 2015

📌 Commit 5645dba has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 6, 2015

Testing commit 5645dba with merge 098bdb5...

bors-servo pushed a commit that referenced this pull request Oct 6, 2015
bors-servo
Make it possible for iframes to create their own pipeline ID.

This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7807)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 6, 2015

@bors-servo bors-servo merged commit 5645dba into servo:master Oct 6, 2015
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@glennw glennw deleted the glennw:pid branch Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.