Closed
Bug 1146603
Opened 10 years ago
Closed 9 years ago
tab.attach should be made e10s safe
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Add-on SDK Graveyard
General
Tracking
(e10s+, firefox43 fixed)
RESOLVED
FIXED
mozilla43
People
(Reporter: mossop, Assigned: mossop)
References
Details
Attachments
(1 file, 1 obsolete file)
7.64 KB,
patch
|
jsantell
:
review+
|
Details | Diff | Splinter Review |
It uses CPOWs to do its stuff right now.
Updated•10 years ago
|
tracking-e10s:
--- → m8+
Updated•10 years ago
|
Updated•9 years ago
|
Comment 1•9 years ago
|
||
Seems like this is blocking a bunch of debugger tests from running on e10s. How hard is this?
Assignee | ||
Comment 2•9 years ago
|
||
Not too difficult, I can give a rough outline of how someone could do it, I just have no time to do the implementation myself right now.
Flags: needinfo?(dtownsend)
Assignee | ||
Comment 3•9 years ago
|
||
Turned out to be about as easy to write the patch as to explain it.
Here it creates a worker in the parent processes and sends a message to the child to create a child worker there. They're linked by an id in the same way as we do for workers elsewhere. Passes all tests.
Assignee: nobody → dtownsend
Flags: needinfo?(dtownsend)
Attachment #8653806 -
Flags: review?(jsantell)
Comment 4•9 years ago
|
||
Comment on attachment 8653806 [details] [diff] [review]
patch
Review of attachment 8653806 [details] [diff] [review]:
-----------------------------------------------------------------
::: addon-sdk/source/lib/sdk/content/utils.js
@@ +85,5 @@
> }
> }
> exports.WorkerHost = WorkerHost;
> +
> +function makeChildOptions(options, id = undefined) {
is `id = undefined` necessary?
@@ +92,5 @@
> + return [];
> + return [String(v) for (v of [].concat(arrayOrValue))];
> + }
> +
> + id = id || String(uuid());
`uuid()` is always a string already
@@ +95,5 @@
> +
> + id = id || String(uuid());
> + return {
> + id,
> + contentScript: makeStringArray(options.contentScript),
I think generally we just do `[].concat(arrayOrString)`, do we need to cast the values to a string? If it's a non-string, would casting to a string even work?
::: addon-sdk/source/lib/sdk/content/worker.js
@@ +128,3 @@
> frame = frames.getFrameForBrowser(getBrowserForTab(tab));
>
> function makeStringArray(arrayOrValue) {
I think this can be removed now as it was moved to makeChildOptions
Attachment #8653806 -
Flags: review?(jsantell) → review+
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #4)
> @@ +95,5 @@
> > +
> > + id = id || String(uuid());
> > + return {
> > + id,
> > + contentScript: makeStringArray(options.contentScript),
>
> I think generally we just do `[].concat(arrayOrString)`, do we need to cast
> the values to a string? If it's a non-string, would casting to a string even
> work?
We need to cast to strings to ensure this object is safe to send over the process boundary, you can cast anything to a string. We also need to make sure the variable isn't null or we send [null] which causes problems.
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Jordan Santell [:jsantell] [@jsantell] from comment #4)
> @@ +92,5 @@
> > + return [];
> > + return [String(v) for (v of [].concat(arrayOrValue))];
> > + }
> > +
> > + id = id || String(uuid());
>
> `uuid()` is always a string already
Actually it returns an nsIDPtr which generally casts to a string but can cause problems for the message manager when I checked last :(
Comment 8•9 years ago
|
||
Backed out for browser_dbg_event-listeners-04.js failures.
https://treeherder.mozilla.org/logviewer.html#?job_id=4438935&repo=fx-team
https://hg.mozilla.org/integration/fx-team/rev/4d45d62a27da
Assignee | ||
Comment 9•9 years ago
|
||
In some cases we don't have the frame object when attempting to attach (it relies on an async message from content to set it up) so wait for it in that case before connecting the worker.
Attachment #8653806 -
Attachment is obsolete: true
Attachment #8656031 -
Flags: review?(jsantell)
Comment 10•9 years ago
|
||
Comment on attachment 8656031 [details] [diff] [review]
patch
Review of attachment 8656031 [details] [diff] [review]:
-----------------------------------------------------------------
::: addon-sdk/source/lib/sdk/tabs/tab-firefox.js
@@ +200,5 @@
> + });
> +
> + let attach = frame => {
> + let childOptions = makeChildOptions(options);
> + frame.port.emit('sdk/tab/attach', childOptions);
nit double quotes
Attachment #8656031 -
Flags: review?(jsantell) → review+
Comment 12•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 13•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/addon-sdk
https://github.com/mozilla/addon-sdk/commit/c41767c1a9a68f52cfeb948b86f3ebb178c73f5c
Bug 1146603: Use messaging to set up the parent and child workers for tab.attach. r=jsantell
You need to log in
before you can comment on or make changes to this bug.
Description
•