modules loaded in child processes don't get reloaded via detools addon

RESOLVED FIXED in Firefox 48

Status

DevTools
General
P2
normal
RESOLVED FIXED
2 years ago
7 days ago

People

(Reporter: ochameau, Assigned: ochameau)

Tracking

unspecified
Firefox 48
Dependency tree / graph

Firefox Tracking Flags

(firefox48 fixed)

Details

(Whiteboard: [btpp-fix-later])

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

2 years ago
Any module loaded in the child doesn't get reloaded for two reasons:
* devtools/server/child.js frame script doesn't get reloaded
  loadFrameScript caches scripts and unfortunately there is no way to force reload nor purge the cache. I opened bug 1258496 to address that.

* Loader.jsm doesn't get reloaded
  So that even if the frame script is reloaded the JSM keeps the same modules instances. We have to communicate with child processes to call its reload method.
(Assignee)

Comment 1

2 years ago
Created attachment 8733092 [details] [diff] [review]
Reload chrome locales when reloading devtools via the addon.

I needed that in order to get chrome://devtools/locale/ to be updated.
That allowed me to work on menuitems and shortcuts via the addon.
Attachment #8733092 - Flags: review?(jryans)
(Assignee)

Comment 2

2 years ago
Created attachment 8733093 [details] [diff] [review]
Ensure reloading devtools frame script and loader in child processes.

chrome-flush-caches in child process is still at risk in bug 1258496.
May change this patch accordingly.
Attachment #8733093 - Flags: review?(jryans)
Attachment #8733092 - Flags: review?(jryans) → review+
Comment on attachment 8733093 [details] [diff] [review]
Ensure reloading devtools frame script and loader in child processes.

Review of attachment 8733093 [details] [diff] [review]:
-----------------------------------------------------------------

::: devtools/bootstrap.js
@@ +87,5 @@
> +  // Flush message manager cached frame scripts in child processes
> +  Services.ppmm.loadProcessScript("data:,new " + function () {
> +    let obs = Components.classes["@mozilla.org/observer-service;1"]
> +                        .getService(Components.interfaces.nsIObserverService);
> +    obs.notifyObservers(null, "chrome-flush-caches", null);

Add a comment about the bug which may break this.
Attachment #8733093 - Flags: review?(jryans) → review+
Priority: -- → P2
Whiteboard: [btpp-fix-later]
(Assignee)

Updated

2 years ago
Blocks: 1261665
(Assignee)

Comment 4

2 years ago
Created attachment 8739207 [details] [diff] [review]
Ensure reloading devtools frame script and loader in child processes - v2

Rebased. Use new notification name.
Attachment #8739207 - Flags: review+
(Assignee)

Updated

2 years ago
Attachment #8733093 - Attachment is obsolete: true
(Assignee)

Comment 5

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/625ed96745ea86e9db9de05cbb459acd19512de2
Bug 1258546 - Reload chrome locales when reloading devtools via the addon. r=jryans

https://hg.mozilla.org/integration/fx-team/rev/4276c4ae6d52c0cd1d69cee55d6a077b59a7dd88
Bug 1258546 - Ensure reloading devtools frame script and loader in child processes. r=jryans

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/625ed96745ea
https://hg.mozilla.org/mozilla-central/rev/4276c4ae6d52
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48

Updated

7 days ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.