Last Comment Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext()
: Remove nsresult return value from nsXPConnect::GetSafeJSContext()
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-01 15:07 PDT by :Ms2ger (⌚ UTC+1/+2)
Modified: 2012-05-05 10:26 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (19.30 KB, patch)
2012-04-01 15:07 PDT, :Ms2ger (⌚ UTC+1/+2)
bobbyholley: review+
Details | Diff | Splinter Review

Description :Ms2ger (⌚ UTC+1/+2) 2012-04-01 15:07:39 PDT
Created attachment 611320 [details] [diff] [review]
Patch v1
Comment 1 Bobby Holley (:bholley) (busy with Stylo) 2012-04-02 15:59:28 PDT
Comment on attachment 611320 [details] [diff] [review]
Patch v1


>diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp


>-      if (stack)
>-      {
>-        JSContext *cx = nsnull;
>-        stack->GetSafeJSContext(&cx);
>-        if (cx)
>-          ::JS_GC(cx);
>+      if (stack) {
>+        if (JSContext* cx = stack->GetSafeJSContext()) {
>+          JS_GC(cx);
>+        }

Given the other style in this file, there should be no braces here.
Comment 2 Masatoshi Kimura [:emk] (use Splinter to ask me for review, see bugzil.la/1321953) 2012-04-13 14:23:08 PDT
Comment on attachment 611320 [details] [diff] [review]
Patch v1

> [uuid(b7056a2a-a02d-43b1-abb9-47f81f8bf258)]
> interface nsIThreadJSContextStack : nsIJSContextStack
> {
>     /* inherits methods of nsIJSContextStack */
>-    readonly attribute JSContext safeJSContext;
>+    [notxpcom,nostdcall] JSContext getSafeJSContext();
Please bump the iid.
Comment 3 :Ms2ger (⌚ UTC+1/+2) 2012-05-05 10:26:36 PDT
https://hg.mozilla.org/mozilla-central/rev/4b0cc175806e

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