Closed Bug 1276286 Opened 4 years ago Closed 4 years ago

Remove the unused JSContext goop in nsJSObjWrapper::GetNewOrUsed

Categories

(Core :: Plug-ins, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

No description provided.
Comment on attachment 8757390 [details] [diff] [review]
Remove the unused JSContext stuff in nsJSObjWrapper::GetNewOrUsed

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

For the record, bug 1239494 removed the last usage of cx in GetNewOrUsed.

::: dom/plugins/base/nsJSNPRuntime.cpp
@@ +597,5 @@
>    if (!obj) {
>      obj = val.toObjectOrNull();
>    }
>  
> +  NPObject *npobj = nsJSObjWrapper::GetNewOrUsed(npp, obj);

Maybe move the * over while you are touching this line.

::: dom/plugins/base/nsJSNPRuntime.h
@@ +57,5 @@
>    JS::Heap<JSObject *> mJSObj;
>    const NPP mNpp;
>    bool mDestroyPending;
>  
> +  static NPObject *GetNewOrUsed(NPP npp,  JS::Handle<JSObject*> obj);

nit: extra space before JS::Handle. Also, maybe move the * over to NPObject while you are here.

::: dom/plugins/base/nsNPAPIPlugin.cpp
@@ +1061,5 @@
>    NS_ENSURE_TRUE(doc, nullptr);
>    nsCOMPtr<nsPIDOMWindowOuter> outer = doc->GetWindow();
>    NS_ENSURE_TRUE(outer, nullptr);
>  
> +  JS::Rooted<JSObject*> global(nsContentUtils::RootingCx(),

I guess eventually Rooted won't take a cx arg, eliminating this ugliness...
Attachment #8757390 - Flags: review?(continuation) → review+
https://hg.mozilla.org/mozilla-central/rev/8834d0097b90
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.