Last Comment Bug 713550 - Move Base64 code in XPConnect away from nsXPConnect
: Move Base64 code in XPConnect away from nsXPConnect
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-26 12:18 PST by :Ms2ger (⌚ UTC+1/+2)
Modified: 2011-12-28 02:54 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (23.73 KB, patch)
2011-12-26 12:18 PST, :Ms2ger (⌚ UTC+1/+2)
khuey: review-
Details | Diff | Splinter Review
Patch v2 (25.24 KB, patch)
2011-12-27 11:39 PST, :Ms2ger (⌚ UTC+1/+2)
bobbyholley: review-
Details | Diff | Splinter Review
Patch v3 (20.63 KB, patch)
2011-12-27 14:27 PST, :Ms2ger (⌚ UTC+1/+2)
khuey: review+
bobbyholley: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2011-12-26 12:18:12 PST
Created attachment 584339 [details] [diff] [review]
Patch v1

This code is rather self-contained, and I don't see how static methods on nsXPConnect is a good place for them.
Comment 1 Bobby Holley (:bholley) (busy with Stylo) 2011-12-26 22:51:38 PST
It seems to me that the only thing that should really live in XPConnect is the jsval translation stuff, and everything else should live in xpcom/string, or maybe some other general utility drawer.

Kyle, what do you think?
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-12-27 07:04:01 PST
Comment on attachment 584339 [details] [diff] [review]
Patch v1

Lets put this stuff in xpcom/io/Base64.[cpp|h]?
Comment 3 :Ms2ger (⌚ UTC+1/+2) 2011-12-27 11:39:34 PST
Created attachment 584462 [details] [diff] [review]
Patch v2

Mmk.
Comment 4 Bobby Holley (:bholley) (busy with Stylo) 2011-12-27 12:12:29 PST
Comment on attachment 584462 [details] [diff] [review]
Patch v2

As mentioned on IRC, please put the public declarations of the XPConnect-y versions in xpcpublic, and leave the implementations in nsXPConnect.
Comment 5 :Ms2ger (⌚ UTC+1/+2) 2011-12-27 14:27:47 PST
Created attachment 584483 [details] [diff] [review]
Patch v3
Comment 6 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-12-27 14:33:16 PST
Comment on attachment 584483 [details] [diff] [review]
Patch v3

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

I assumed you just copied and pasted the code and didn't look too closely.

::: js/xpconnect/src/nsXPConnect.cpp
@@ +2807,5 @@
>  {
> +    MOZ_ASSERT(cx);
> +    MOZ_ASSERT(out);
> +
> +    JS::Value root = val;

Is this necessary? val is already on the stack ...

@@ +2833,5 @@
>  {
> +    MOZ_ASSERT(cx);
> +    MOZ_ASSERT(out);
> +
> +    JS::Value root = val;

Same question.
Comment 7 Bobby Holley (:bholley) (busy with Stylo) 2011-12-27 14:34:08 PST
Comment on attachment 584483 [details] [diff] [review]
Patch v3

r=bholley on the xpconnect bits.
Comment 8 :Ms2ger (⌚ UTC+1/+2) 2011-12-28 02:54:44 PST
https://hg.mozilla.org/mozilla-central/rev/d144d8a5af9e

Note You need to log in before you can comment on or make changes to this bug.