Closed Bug 1250486 Opened 8 years ago Closed 8 years ago

get rid of some static ctors for xpconnect things

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: tbsaunde, Assigned: tbsaunde)

Details

(Whiteboard: btpp-active)

Attachments

(3 files)

      No description provided.
Attachment #8722481 - Flags: review?(bzbarsky)
The dtor for PersistentRooted<> removes it from a linked list, which means we
need a static ctor to register that dtor with the atexit machinary.  So the
easiest thing to do is make sScriptedInterruptCallback a pointer that points to
a PersistentRootedValue we allocate on the heap.
Attachment #8722482 - Flags: review?(bzbarsky)
Comment on attachment 8722480 [details] [diff] [review]
make some xpconnect wrapper ctors constexpr to get rid of static constructors

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

::: js/xpconnect/wrappers/XrayWrapper.h
@@ +159,5 @@
>  
>  class DOMXrayTraits : public XrayTraits
>  {
>  public:
> +  MOZ_CONSTEXPR DOMXrayTraits() = default;

Indentation is off
Comment on attachment 8722480 [details] [diff] [review]
make some xpconnect wrapper ctors constexpr to get rid of static constructors

>+    explicit MOZ_CONSTEXPR CrossOriginXrayWrapper(unsigned flags) :

The other use in this file has "MOZ_CONSTEXPR explicit".  Please match it, or if it's wrong fix it.

>+  MOZ_CONSTEXPR DOMXrayTraits() = default;

Indent by two more spaces.

r=me
Attachment #8722480 - Flags: review?(bzbarsky) → review+
Comment on attachment 8722481 [details] [diff] [review]
make the ComponentsSH ctor constexpr

Ick.  Lying refcounting is ick.  r=me, but ick.  ;)
Attachment #8722481 - Flags: review?(bzbarsky) → review+
Comment on attachment 8722482 [details] [diff] [review]
get rid of the static ctor for XPCShellImpl.cpp

r=me.  Having this sort of thing as a static seems moderately insane, but ok for this case...
Attachment #8722482 - Flags: review?(bzbarsky) → review+
Assignee: nobody → tbsaunde+mozbugs
Whiteboard: btpp-active
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: