Closed Bug 1302448 Opened 3 years ago Closed 3 years ago

Rename *JSRuntime classes to *JSContext

Categories

(Core :: XPConnect, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(3 files)

We now use JSContext instead of JSRuntime, so we should rename {CycleCollectedJSRuntime, XPCJSRuntime, WorkerJSRuntime} to finish this conversion.
Attachment #8790757 - Flags: review?(continuation)
Sorry this is a big patch, most of it is trivial renaming though.
Attachment #8790762 - Flags: review?(mrbkap)
Note that JS::RuntimeStats still has to be renamed as well.
Attachment #8790763 - Flags: review?(amarchesini)
Comment on attachment 8790763 [details] [diff] [review]
Part 3 - WorkerJSRuntime

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

::: dom/workers/RuntimeService.cpp
@@ +1042,5 @@
>    Wrap,
>    nullptr,
>  };
>  
> +class WorkerJSContext : public mozilla::CycleCollectedJSContext

class WorkerJSContext MOZ_STACK_CLASS final : ...

::: dom/workers/WorkerPrivate.cpp
@@ +1506,5 @@
>      return StringBeginsWith(s, NS_LITERAL_CSTRING("explicit/"));
>  }
>  #endif
>  
> +class WorkerJSContextStats : public JS::RuntimeStats

final
Attachment #8790763 - Flags: review?(amarchesini) → review+
Comment on attachment 8790757 [details] [diff] [review]
Part 1 - CycleCollectedJSRuntime

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

Very thorough.
Attachment #8790757 - Flags: review?(continuation) → review+
Comment on attachment 8790762 [details] [diff] [review]
Part 2 - XPCJSRuntime

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

::: js/xpconnect/src/XPCInlines.h
@@ +535,5 @@
>      return JS_HasPropertyById(cx, obj, id, &dummy);
>  }
>  
>  inline jsid
> +GetCXIdByIndex(JSContext* cx, unsigned index)

Nit: the capital X here seems odd. Maybe GetCxIdByIndex? GetJSIDByIndex? GetIdByIndex?
Attachment #8790762 - Flags: review?(mrbkap) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fff0c85df590
part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d1db582972c
part 2 - Rename XPCJSRuntime to XPCJSContext. r=mrbkap
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0675d0dcfb5
part 3 - Rename WorkerJSRuntime to WorkerJSContext. r=baku
(In reply to Andrea Marchesini [:baku] from comment #4)
> > +class WorkerJSContextStats : public JS::RuntimeStats
> 
> final

Done. I think this one can also be MOZ_STACK_CLASS, like the other one, so I added that as well.

(In reply to Blake Kaplan (:mrbkap) from comment #6)
> > +GetCXIdByIndex(JSContext* cx, unsigned index)
> 
> Nit: the capital X here seems odd. Maybe GetCxIdByIndex? GetJSIDByIndex?
> GetIdByIndex?

I renamed it to GetJSIDByIndex, thanks.
https://hg.mozilla.org/mozilla-central/rev/fff0c85df590
https://hg.mozilla.org/mozilla-central/rev/1d1db582972c
https://hg.mozilla.org/mozilla-central/rev/b0675d0dcfb5
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.