Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upStorage notifications routed via the constellation. #14023
Conversation
highfive
commented
Nov 2, 2016
|
Heads up! This PR modifies the following files:
|
|
|
a8b66da
to
75867ef
| let msg = ConstellationControlMsg::DispatchStorageEvent( | ||
| pipeline.id, storage, url.clone(), key.clone(), old_value.clone(), new_value.clone() | ||
| ); | ||
| let _ = pipeline.script_chan.send(msg); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| }; | ||
|
|
||
| for pipeline in self.pipelines.values() { | ||
| if (pipeline.id != pipeline_id) && (pipeline.url.origin() == origin) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Nov 8, 2016
Author
Member
Hmm, I prefer explicit parens rather than relying on operator pecedence to resolve ambiguity.
| let origin = match Url::parse(&*url) { | ||
| Ok(url) => url.origin(), | ||
| Err(err) => return warn!("Failed to parse url {}: {:?}.", url, err), | ||
| }; |
This comment has been minimized.
This comment has been minimized.
nox
Nov 7, 2016
Member
Why ignore failure here? Why isn't that method taking an Url directly? I see below that the String comes directly from an Url, so please just unwrap the result of Url::parse or pass an actual Url around.
Oh I see you did that in second commit. Could you squash them?
This comment has been minimized.
This comment has been minimized.
| DOMString::from(ev_url.to_string()), | ||
| Some(&storage) | ||
| DOMString::from(this.url), | ||
| Some(&*storage) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| @@ -59,6 +60,9 @@ pub enum LogEntry { | |||
| /// Messages from the script to the constellation. | |||
| #[derive(Deserialize, Serialize)] | |||
| pub enum ScriptMsg { | |||
| /// Broadcast a storage event to every same-origin pipeline. | |||
| /// The strings are url, key, old value and new value. | |||
| BroadcastStorageEvent(PipelineId, StorageType, String, Option<String>, Option<String>, Option<String>), | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Nov 15, 2016
Author
Member
I agree with you, but we should be consistent about it, not just adopt struct variants piecemeal.
|
GitHub somehow decided that some of my comments are outdated when they are not, please expand them when you read this @asajeffrey. |
|
We should probably hold off on merging this until #14013 has landed, c.f. https://github.com/servo/servo/pull/14013/files#diff-ab86862fdf6e275f1f412558ce78bc2aR195. |
0ee6c6d
to
2711a0e
|
|
2711a0e
to
4c09ef4
4c09ef4
to
d8a9112
|
Squash and r=me. |
d8a9112
to
c91ef86
|
Squashed. @bors-servo r=nox |
|
|
…=nox Storage notifications routed via the constellation. <!-- Please describe your changes on the following line: --> At the moment, storage notifications are only sent within a script thread, not to same-origin pipelines in different script threads. This PR fixes that. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #5196 - [X] These changes do not require tests because existing tests now pass <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14023) <!-- Reviewable:end -->
|
|
asajeffrey commentedNov 2, 2016
•
edited by larsbergstrom
At the moment, storage notifications are only sent within a script thread, not to same-origin pipelines in different script threads. This PR fixes that.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is