closeProxyContext is never invoked

RESOLVED FIXED in Firefox 51

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: robwu, Assigned: robwu)

Tracking

(Blocks: 1 bug)

Trunk
mozilla51
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50 affected, firefox51 fixed)

Details

(Whiteboard: triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(3 attachments)

(Assignee)

Description

2 years ago
http://searchfox.org/mozilla-central/rev/868b17897f7a7fcd7f6f67fd8185a7370db46604/toolkit/components/extensions/ExtensionUtils.jsm#1292
this.messageManager.sendAsyncMessage("Extension:CloseProxyContext", {childId: this.id});

does not match
http://searchfox.org/mozilla-central/rev/868b17897f7a7fcd7f6f67fd8185a7370db46604/toolkit/components/extensions/ExtensionUtils.jsm#1292
Services.mm.addMessageListener("API:CloseProxyContext", this, true);

And in an OOP world, the parent process should have minimal assumptions on the child process, in order to provide a better security. In this case, we should also dispose the proxy context if the child process terminates.
(Assignee)

Comment 2

2 years ago
> we should also dispose the proxy context if the child process terminates.

This is already handled by subscribing to message-manager-close and disposing its associated ProxyContexts.

The patch is easy, s/Extension:/API:/.
How can I add a regression test for this bug?
Flags: needinfo?(wmccloskey)
The only way I can think of where this might go wrong is if a content script used storage.local.onChanged.addListener. When the content page navigates, we could try to see if the listener fires after that.
Flags: needinfo?(wmccloskey)
(Assignee)

Updated

2 years ago
Blocks: 1288901

Updated

2 years ago
Whiteboard: triaged
(Assignee)

Comment 4

2 years ago
Created attachment 8775369 [details]
Bug 1288276 - Close proxy context upon page reload, with tests

Review commit: https://reviewboard.mozilla.org/r/67532/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67532/
Attachment #8775369 - Flags: review?(wmccloskey)
Attachment #8775370 - Flags: review?(wmccloskey)
(Assignee)

Comment 5

2 years ago
Created attachment 8775370 [details]
Bug 1288276 - Add tests for background page context

Review commit: https://reviewboard.mozilla.org/r/67534/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67534/
(Assignee)

Comment 6

2 years ago
Created attachment 8775374 [details]
Bug 1288276 - Add chromeScript.awaitOneMessage to SpecialPowers

Review commit: https://reviewboard.mozilla.org/r/67540/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67540/
Attachment #8775374 - Flags: review?(wmccloskey)
Comment on attachment 8775374 [details]
Bug 1288276 - Add chromeScript.awaitOneMessage to SpecialPowers

https://reviewboard.mozilla.org/r/67540/#review65506

::: testing/specialpowers/content/specialpowersAPI.js:506
(Diff revision 1)
>      let chromeScript = {
>        addMessageListener: (name, listener) => {
>          listeners.push({ name: name, listener: listener });
>        },
>  
> +      awaitOneMessage: name => new Promise(resolve => {

promiseOneMessage might be a better name given how we've done stuff like this in the past.
Attachment #8775374 - Flags: review?(wmccloskey) → review+
Attachment #8775370 - Flags: review?(wmccloskey) → review+
Comment on attachment 8775369 [details]
Bug 1288276 - Close proxy context upon page reload, with tests

https://reviewboard.mozilla.org/r/67532/#review65510
Attachment #8775369 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 10

2 years ago
Comment on attachment 8775374 [details]
Bug 1288276 - Add chromeScript.awaitOneMessage to SpecialPowers

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67540/diff/1-2/
(Assignee)

Comment 11

2 years ago
Comment on attachment 8775369 [details]
Bug 1288276 - Close proxy context upon page reload, with tests

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67532/diff/1-2/
(Assignee)

Comment 12

2 years ago
Comment on attachment 8775370 [details]
Bug 1288276 - Add tests for background page context

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67534/diff/1-2/
(Assignee)

Updated

2 years ago
Keywords: checkin-needed
has problems to apply:

applying 6ed8aa4923ad
6ed8aa4923ad transplanted to 16513ef7dd8c
applying f968025c4ddc
patching file toolkit/components/extensions/test/mochitest/mochitest.ini
Hunk #1 FAILED at 29
1 out of 1 hunks FAILED -- saving rejects to file toolkit/components/extensions/test/mochitest/mochitest.ini.rej
patch failed to apply
abort: fix up the working directory and run hg transplant --continue
Flags: needinfo?(rob)
Keywords: checkin-needed
(Assignee)

Comment 14

2 years ago
Comment on attachment 8775374 [details]
Bug 1288276 - Add chromeScript.awaitOneMessage to SpecialPowers

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67540/diff/2-3/
(Assignee)

Comment 15

2 years ago
Comment on attachment 8775369 [details]
Bug 1288276 - Close proxy context upon page reload, with tests

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67532/diff/2-3/
(Assignee)

Comment 16

2 years ago
Comment on attachment 8775370 [details]
Bug 1288276 - Add tests for background page context

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67534/diff/2-3/
(Assignee)

Updated

2 years ago
Flags: needinfo?(rob)
Keywords: checkin-needed

Comment 17

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/2ef8ee2d4bac
Add chromeScript.awaitOneMessage to SpecialPowers. r=billm
https://hg.mozilla.org/integration/fx-team/rev/d1cd8175cc47
Close proxy context upon page reload, with tests. r=billm
https://hg.mozilla.org/integration/fx-team/rev/a32b3e3c6b34
Add tests for background page context. r=billm
Keywords: checkin-needed
backed out for failing in tests like https://treeherder.mozilla.org/logviewer.html#?job_id=10987836&repo=fx-team
Flags: needinfo?(rob)

Comment 19

2 years ago
Backout by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/697966241877
Backed out changeset a32b3e3c6b34 
https://hg.mozilla.org/integration/fx-team/rev/1e08d12783fb
Backed out changeset d1cd8175cc47 
https://hg.mozilla.org/integration/fx-team/rev/ed55a2720142
Backed out changeset 2ef8ee2d4bac for failing on own test
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 23

2 years ago
Tests were failing because Android does not support the tabs API. I disabled the test for Android, rebased the patch and verified locally that no test failures are generated on Fennec. Please land it again.
Flags: needinfo?(rob)
Keywords: checkin-needed
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 26

2 years ago
Pushed by kwierso@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/edfb98ed711e
Add chromeScript.awaitOneMessage to SpecialPowers r=billm
https://hg.mozilla.org/integration/autoland/rev/9fcfe72d38fa
Close proxy context upon page reload, with tests r=billm
https://hg.mozilla.org/integration/autoland/rev/9017c54c3f57
Add tests for background page context r=billm
Keywords: checkin-needed

Comment 27

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/edfb98ed711e
https://hg.mozilla.org/mozilla-central/rev/9fcfe72d38fa
https://hg.mozilla.org/mozilla-central/rev/9017c54c3f57
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.