Closed Bug 1265802 Opened 8 years ago Closed 8 years ago

replace nsIXULRuntime.OS and Services.appinfo.OS

Categories

(DevTools :: Framework, enhancement, P1)

enhancement

Tracking

(firefox50 fixed)

RESOLVED FIXED
Firefox 50
Iteration:
50.3 - Jul 18
Tracking Status
firefox50 --- fixed

People

(Reporter: tromey, Assigned: tromey)

References

Details

(Whiteboard: [devtools-html])

Attachments

(1 file)

Replace uses of nsIXULRuntime.OS and Services.appinfo.OS for the devtools
de-chrome-ification project.
Flags: qe-verify-
Priority: -- → P2
Priority: P2 → P1
Tom, 

I'd plan to add `osString` as a property of Tools.inspector/webconsole in devtools/client/definitions.
Therefore all related API call will be constrained into definitions. 

If that is the right direction, do you have any suggestion to remove the direct call of nsIXULRuntime.OS and Services.appinfo.OS call inside of devtools/client/definitions?
Flags: needinfo?(ttromey)
(In reply to Fred Lin [:gasolin] from comment #1)
> Tom, 
> 
> I'd plan to add `osString` as a property of Tools.inspector/webconsole in
> devtools/client/definitions.
> Therefore all related API call will be constrained into definitions. 
> 
> If that is the right direction, do you have any suggestion to remove the
> direct call of nsIXULRuntime.OS and Services.appinfo.OS call inside of
> devtools/client/definitions?

I tend to think definitions.js is not the right spot.  I looked into it a little
and I think the major issue with that location is that there are also uses of
`OS` in devtools/shared (particularly devtools/shared/inspector/css-logic.js) --
and so due to import rules the solution has to be in devtool/shared as well.

devtools/shared/system.js comes to mind here; but I am not sure about this one.
It seems like a candidate for splitting up somehow.  But, maybe it would be ok.

The main issue I see is deciding how to differentiate between the chrome and
content cases here.  Maybe the code could check if `navigator.userAgent` exists.
Flags: needinfo?(ttromey)
Fred - if you are working on this, could you please self-assign the bug?
If not, let me know; it's the last unassigned P1 bug so normally I'd take
it before working on something else.
Flags: needinfo?(gasolin)
Tom, now I'd focus on track 2 work, so feel free to take it
Flags: needinfo?(gasolin)
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Iteration: --- → 50.3 - Jul 18
I got through this and then realized belatedly that it's better to stick the info
on the existing Services shim.
Comment on attachment 8771464 [details]
Bug 1265802 - Add Services.appinfo.OS shim for devtools;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64610/diff/1-2/
Found an eslint error just after uploading.
Comment on attachment 8771464 [details]
Bug 1265802 - Add Services.appinfo.OS shim for devtools;

https://reviewboard.mozilla.org/r/64610/#review61650

Looks reasonable to me, thanks for working on it!
Attachment #8771464 - Flags: review?(jryans) → review+
Blocks: 1266839
Comment on attachment 8771464 [details]
Bug 1265802 - Add Services.appinfo.OS shim for devtools;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/64610/diff/2-3/
A couple minor test updates to avoid redefining Services.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=624c523f17ec
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/fx-team/rev/98a277292d0b
Add Services.appinfo.OS shim for devtools; r=jryans
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/98a277292d0b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: