Closed Bug 1347515 Opened 8 years ago Closed 7 years ago

Remove nsIJSON

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Performance Impact none
Tracking Status
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: hsivonen, Assigned: baku)

References

(Blocks 1 open bug)

Details

(Keywords: dataloss)

Attachments

(5 files, 1 obsolete file)

We should remove nsIJSON once support for XPCOM extensions has been dropped.
Priority: -- → P3
No longer depends on: post-57-api-changes
Whiteboard: [qf]
Whiteboard: [qf] → [qf-]
Depends on: 1387785
Depends on: 1387788
Assignee: nobody → amarchesini
Attachment #8926830 - Flags: review?(kyle)
Attachment #8926831 - Flags: review?(kyle)
Attachment #8926832 - Flags: review?(kyle)
Attachment #8926833 - Flags: review?(kyle)
Attachment #8926831 - Attachment description: nsIJSON.decodeToJSVal → part 2 - nsIJSON.decodeToJSVal
Attachment #8926830 - Flags: review?(kyle) → review+
Attachment #8926831 - Flags: review?(kyle) → review+
Comment on attachment 8926832 [details] [diff] [review]
part 3 - nsIJSON.decodeFromStream

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

::: toolkit/components/contextualidentity/ContextualIdentityService.jsm
@@ +316,5 @@
>                            .createInstance(Ci.nsIFileInputStream);
>        inputStream.init(new FileUtils.File(this._path),
>                         FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
>        try {
> +        let data = jSON.parse(NetUtil.readInputStreamToString(inputStream,

I don't think this will run correctly? jSON shouldn't be valid?
Attachment #8926832 - Flags: review?(kyle) → review-
Attachment #8926833 - Flags: review?(kyle) → review+
Most everything looks good here, and will r+ pretty quick after that JSON typo is fixed.
Yes, I haven't pushed the patch to try. This is green.
Attachment #8926832 - Attachment is obsolete: true
Attachment #8926967 - Flags: review?(kyle)
Attachment #8926967 - Flags: review?(kyle) → review+
Attached patch commSplinter Review
comm repository has to be updated. I have to admit that I have not tested this patch. Jorgk, can you please review and test this patch? Thanks.
Attachment #8927053 - Flags: review?(jorgk)
Thanks, I will.
I think this means we can remove the special parsing code we had for this API from the JS engine.
Comment on attachment 8927053 [details] [diff] [review]
comm

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

::: chat/modules/imSmileys.jsm
@@ +5,5 @@
>  Components.utils.import("resource:///modules/imServices.jsm");
> +Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
> +
> +XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => {
> +  return new TextDecoder();

Why do it like this when you're doing it differently in calendar/test/unit/head_consts.js?
> Why do it like this when you're doing it differently in
> calendar/test/unit/head_consts.js?

This is for testing. We don't care too much of avoiding creating a single TextDecoder. But for imSmileys.jsm, we can optimize the number of TextDecoder objects.
(In reply to Tom Schuster [:evilpie] from comment #14)
> I think this means we can remove the special parsing code we had for this
> API from the JS engine.

Can you file a follow up? Maybe pointing to the code you are talking about? Thanks
Flags: needinfo?(evilpies)
I filed bug 1416155
Flags: needinfo?(evilpies)
Blocks: 1416155
Comment on attachment 8927053 [details] [diff] [review]
comm

Thanks, I'll get this landed now. Sadly we're busted by the packaging changes also landed here, so I can't test it. So we might have to follow up in case of problems.
Attachment #8927053 - Flags: review?(jorgk) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/ebac2c6a8ba8
remove dom_json.xpt from TB/IB/SM package manifests. rs=bustage-fix
https://hg.mozilla.org/comm-central/rev/916c30e50af1
Remove use of nsIJSON in Thunderbird's calendar and chat. rs=jorgk
This regressed containers: https://github.com/mozilla/multi-account-containers/issues/949#issuecomment-343994922
Flags: needinfo?(amarchesini)
Depends on: 1416468
Flags: needinfo?(amarchesini)
(In reply to Alexandre LISSY :gerard-majax from comment #22)
> This regressed containers:
> https://github.com/mozilla/multi-account-containers/issues/949#issuecomment-
> 343994922

Can we pull this out of the first beta because of the regression?  And then land it as part of the second beta that goes out, along with bug 1416468?  If this goes into beta, it will cause irrevocable damage to Containers beta users.  (20% of folks who have installed https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/ are on beta.)

Alternatively, we would have to get bug 1416468 into the first beta, and it might be too late for that.
Julien - Data loss in profile here, so we probably should take some action here quickly.  We should probably rebuild beta 3 and retest even if that causes some delay in 58.0b3 release.
Flags: needinfo?(jcristau)
Keywords: dataloss
A note to clarify what landed where. We build 58.0b1 and shipped it last Tuesday to dev edition users. Because of some build issues we didn't ship 58.0b2.  58.0b3 in theory would ship this Wednesday to beta users for the first time.  So, this regression was never shipped to non-nightly users.
This cause bug 1416468 regression. Back out first for the first 58 beta.
This shouldn't have landed during a Nightly soft freeze right before the final merge to Beta. Anyway, backout pushed to Beta.

https://hg.mozilla.org/releases/mozilla-beta/rev/f7eb3bbcd5f830244a4234b1269c3a73e750330b
Flags: needinfo?(jcristau)
See Also: → 1419589
See Also: → 1419591
Component: DOM → DOM: Core & HTML
Performance Impact: --- → -
Whiteboard: [qf-]
No longer depends on: 1387785
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: