Closed Bug 1140242 Opened 9 years ago Closed 9 years ago

Don't try to send nsILoginInfo between processes

Categories

(Toolkit :: Password Manager, defect)

defect
Not set
normal
Points:
3

Tracking

()

RESOLVED FIXED
mozilla39
Iteration:
39.2 - 23 Mar
Tracking Status
firefox39 --- fixed

People

(Reporter: MattN, Assigned: MattN)

References

Details

Attachments

(1 file, 1 obsolete file)

I found out in bug 1139718 that password manager messages that try to send an XPCOM object e.g. nsILoginInfo lose their ability to send structured clones since structured cloning of XPCOM objects fails so the code falls back to stringifying the arguments. This means we lose nicety of Structured Clones e.g. for RegExp, Map, Set, etc. [1] as we get vanilla objects.

Fixing this allows me to send RegExp and Set across processes like I originally wanted to.

[1] https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm
Flags: qe-verify-
Flags: firefox-backlog+
Attached file MozReview Request: bz://1140242/MattN (obsolete) —
/r/4937 - Bug 1140242 - Convert nsILoginInfo to vanilla JS objects before trying to send them in messages. r=dolske

Pull down this commit:

hg pull review -r ba1259ef0be9fa3be2bd39a075e8518eb1e90e57
Attachment #8573679 - Flags: review?(dolske)
All tests pass locally. See also bug 1139718 comment 9.
Iteration: 39.1 - 9 Mar → 39.2 - 23 Mar
Huh, so do I understand this correctly? The issue is that the clone of the xpcom object (login) fails, and so it falls back to JSON. Which is actually OK for the login itself, but has the side effect of _other_ things in the message being cloned breaking because of the JSON fallback?

That's... awful. But at least the workaround is simple.
Comment on attachment 8573679 [details]
MozReview Request: bz://1140242/MattN

https://reviewboard.mozilla.org/r/4935/#review4133

Ship It!
Attachment #8573679 - Flags: review?(dolske) → review+
(In reply to Justin Dolske [:Dolske] from comment #3)
> Huh, so do I understand this correctly? The issue is that the clone of the
> xpcom object (login) fails, and so it falls back to JSON. Which is actually
> OK for the login itself, but has the side effect of _other_ things in the
> message being cloned breaking because of the JSON fallback?
> 
> That's... awful. But at least the workaround is simple.

Yep, that's correct.

Also, btw. I didn't add a test for this specifically since it will be easily caught by recipe tests using Set/RegExp.

https://hg.mozilla.org/integration/fx-team/rev/ed7f8e7ab386
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/ed7f8e7ab386
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla39
Attachment #8573679 - Attachment is obsolete: true
Attachment #8619692 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: