Bug 1060988 - Fix more bad implicit constructors in JS IPC code; r=billm
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 31 Aug 2014 21:10:16 -0400
changeset 224467 e611dca6eb5c90edec64dbac5b6a981bc08f952e
parent 224466 c56a4903179ee09ddc5e64664685e1af45f92cb1
child 224468 9a8b1cb7177edd13d006a2f4ee0ce8f643f0e5b4
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1060988
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1060988 - Fix more bad implicit constructors in JS IPC code; r=billm
js/ipc/JavaScriptBase.h
js/ipc/JavaScriptChild.h
js/ipc/JavaScriptLogging.h
js/ipc/JavaScriptParent.h
js/ipc/JavaScriptShared.h
js/ipc/WrapperAnswer.h
js/ipc/WrapperOwner.h
--- a/js/ipc/JavaScriptBase.h
+++ b/js/ipc/JavaScriptBase.h
@@ -17,17 +17,17 @@ namespace mozilla {
 namespace jsipc {
 
 template<class Base>
 class JavaScriptBase : public WrapperOwner, public WrapperAnswer, public Base
 {
     typedef WrapperAnswer Answer;
 
   public:
-    JavaScriptBase(JSRuntime *rt)
+    explicit JavaScriptBase(JSRuntime *rt)
       : JavaScriptShared(rt),
         WrapperOwner(rt),
         WrapperAnswer(rt)
     {}
     virtual ~JavaScriptBase() {}
 
     virtual void ActorDestroy(WrapperOwner::ActorDestroyReason why) {
         WrapperOwner::ActorDestroy(why);
--- a/js/ipc/JavaScriptChild.h
+++ b/js/ipc/JavaScriptChild.h
@@ -12,17 +12,17 @@
 #include "mozilla/jsipc/PJavaScriptChild.h"
 
 namespace mozilla {
 namespace jsipc {
 
 class JavaScriptChild : public JavaScriptBase<PJavaScriptChild>
 {
   public:
-    JavaScriptChild(JSRuntime *rt);
+    explicit JavaScriptChild(JSRuntime *rt);
     virtual ~JavaScriptChild();
 
     bool init();
     void finalize(JSFreeOp *fop);
 
     void drop(JSObject *obj);
 
   protected:
--- a/js/ipc/JavaScriptLogging.h
+++ b/js/ipc/JavaScriptLogging.h
@@ -29,29 +29,29 @@ namespace jsipc {
     if (StackLoggingEnabled()) {                                               \
         js_DumpBacktrace(cx);	                                               \
     }                                                                          \
     PR_END_MACRO
 
 struct ReceiverObj
 {
     ObjectId id;
-    ReceiverObj(ObjectId id) : id(id) {}
+    explicit ReceiverObj(ObjectId id) : id(id) {}
 };
 
 struct InVariant
 {
     JSVariant variant;
-    InVariant(const JSVariant &variant) : variant(variant) {}
+    explicit InVariant(const JSVariant &variant) : variant(variant) {}
 };
 
 struct OutVariant
 {
     JSVariant variant;
-    OutVariant(const JSVariant &variant) : variant(variant) {}
+    explicit OutVariant(const JSVariant &variant) : variant(variant) {}
 };
 
 class Logging
 {
   public:
     Logging(JavaScriptShared *shared, JSContext *cx) : shared(shared), cx(cx) {}
 
     void print(const nsCString &str) {
--- a/js/ipc/JavaScriptParent.h
+++ b/js/ipc/JavaScriptParent.h
@@ -12,17 +12,17 @@
 #include "mozilla/jsipc/PJavaScriptParent.h"
 
 namespace mozilla {
 namespace jsipc {
 
 class JavaScriptParent : public JavaScriptBase<PJavaScriptParent>
 {
   public:
-    JavaScriptParent(JSRuntime *rt);
+    explicit JavaScriptParent(JSRuntime *rt);
     virtual ~JavaScriptParent();
 
     bool init();
     void trace(JSTracer *trc);
 
     void drop(JSObject *obj);
 
     mozilla::ipc::IProtocol*
--- a/js/ipc/JavaScriptShared.h
+++ b/js/ipc/JavaScriptShared.h
@@ -81,17 +81,17 @@ class ObjectToIdMap
     Table *table_;
 };
 
 class Logging;
 
 class JavaScriptShared
 {
   public:
-    JavaScriptShared(JSRuntime *rt);
+    explicit JavaScriptShared(JSRuntime *rt);
     virtual ~JavaScriptShared() {}
 
     bool init();
 
     void decref();
     void incref();
 
     static const uint32_t OBJECT_EXTRA_BITS  = 1;
--- a/js/ipc/WrapperAnswer.h
+++ b/js/ipc/WrapperAnswer.h
@@ -11,17 +11,17 @@
 #include "JavaScriptShared.h"
 
 namespace mozilla {
 namespace jsipc {
 
 class WrapperAnswer : public virtual JavaScriptShared
 {
   public:
-    WrapperAnswer(JSRuntime *rt) : JavaScriptShared(rt) {}
+    explicit WrapperAnswer(JSRuntime *rt) : JavaScriptShared(rt) {}
 
     bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs);
     bool AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id,
                                      ReturnStatus *rs,
                                      PPropertyDescriptor *out);
     bool AnswerGetOwnPropertyDescriptor(const ObjectId &objId,
                                         const nsString &id,
                                         ReturnStatus *rs,
--- a/js/ipc/WrapperOwner.h
+++ b/js/ipc/WrapperOwner.h
@@ -22,17 +22,17 @@ namespace jsipc {
 
 class WrapperOwner : public virtual JavaScriptShared
 {
   public:
     typedef mozilla::ipc::IProtocolManager<
                        mozilla::ipc::IProtocol>::ActorDestroyReason
            ActorDestroyReason;
 
-    WrapperOwner(JSRuntime *rt);
+    explicit WrapperOwner(JSRuntime *rt);
     bool init();
 
     // Fundamental proxy traps. These are required.
     // (The traps should be in the same order like js/src/jsproxy.h)
     bool preventExtensions(JSContext *cx, JS::HandleObject proxy);
     bool getPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
                                JS::MutableHandle<JSPropertyDescriptor> desc);
     bool getOwnPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,