Bug 1060997 - Fix more bad implicit constructors in IPC; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 31 Aug 2014 21:12:55 -0400
changeset 224468 9a8b1cb7177edd13d006a2f4ee0ce8f643f0e5b4
parent 224467 e611dca6eb5c90edec64dbac5b6a981bc08f952e
child 224469 da622497067d12187ac1fdec4c132faf5092bfee
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)
reviewerssmaug
bugs1060997
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 1060997 - Fix more bad implicit constructors in IPC; r=smaug
ipc/chromium/src/base/debug_util.h
ipc/chromium/src/base/stl_util-inl.h
ipc/chromium/src/base/thread_local_storage.h
ipc/chromium/src/chrome/common/child_process.h
ipc/chromium/src/chrome/common/child_process_host.cc
ipc/chromium/src/chrome/common/child_thread.h
ipc/chromium/src/chrome/common/mach_ipc_mac.h
ipc/chromium/src/chrome/common/notification_details.h
ipc/chromium/src/chrome/common/notification_source.h
ipc/chromium/src/chrome/common/notification_type.h
ipc/glue/BackgroundChildImpl.cpp
ipc/glue/BackgroundImpl.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/MessageChannel.cpp
ipc/glue/MessagePump.cpp
ipc/glue/ProcessChild.h
toolkit/xre/nsEmbedFunctions.cpp
--- a/ipc/chromium/src/base/debug_util.h
+++ b/ipc/chromium/src/base/debug_util.h
@@ -67,17 +67,17 @@ class DebugUtil {
 #endif  // defined(OS_MACOSX)
 };
 
 namespace mozilla {
 
 class EnvironmentLog
 {
 public:
-  EnvironmentLog(const char* varname);
+  explicit EnvironmentLog(const char* varname);
   ~EnvironmentLog();
 
   void print(const char* format, ...);
 
 private:
   std::string fname_;
 
   DISALLOW_EVIL_CONSTRUCTORS(EnvironmentLog);
--- a/ipc/chromium/src/base/stl_util-inl.h
+++ b/ipc/chromium/src/base/stl_util-inl.h
@@ -262,28 +262,28 @@ void STLDeleteValues(T *v) {
 // ...
 // return success;
 
 // Given a pointer to an STL container this class will delete all the element
 // pointers when it goes out of scope.
 
 template<class STLContainer> class STLElementDeleter {
  public:
-  STLElementDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
+  explicit STLElementDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
   ~STLElementDeleter() { STLDeleteElements(container_ptr_); }
  private:
   STLContainer *container_ptr_;
 };
 
 // Given a pointer to an STL container this class will delete all the value
 // pointers when it goes out of scope.
 
 template<class STLContainer> class STLValueDeleter {
  public:
-  STLValueDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
+  explicit STLValueDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
   ~STLValueDeleter() { STLDeleteValues(container_ptr_); }
  private:
   STLContainer *container_ptr_;
 };
 
 
 // Forward declare some callback classes in callback.h for STLBinaryFunction
 template <class R, class T1, class T2>
@@ -296,17 +296,17 @@ class ResultCallback2;
 // The client should create callback with NewPermanentCallback, and should
 // delete callback after it is done using the STLBinaryFunction.
 
 template <class Result, class Arg1, class Arg2>
 class STLBinaryFunction : public std::binary_function<Arg1, Arg2, Result> {
  public:
   typedef ResultCallback2<Result, Arg1, Arg2> Callback;
 
-  STLBinaryFunction(Callback* callback)
+  explicit STLBinaryFunction(Callback* callback)
     : callback_(callback) {
     assert(callback_);
   }
 
   Result operator() (Arg1 arg1, Arg2 arg2) {
     return callback_->Run(arg1, arg2);
   }
 
@@ -320,17 +320,17 @@ class STLBinaryFunction : public std::bi
 // lower_bound().
 //
 // templated typedefs are not supported, so instead we use inheritance.
 
 template <class Arg>
 class STLBinaryPredicate : public STLBinaryFunction<bool, Arg, Arg> {
  public:
   typedef typename STLBinaryPredicate<Arg>::Callback Callback;
-  STLBinaryPredicate(Callback* callback)
+  explicit STLBinaryPredicate(Callback* callback)
     : STLBinaryFunction<bool, Arg, Arg>(callback) {
   }
 };
 
 // Functors that compose arbitrary unary and binary functions with a
 // function that "projects" one of the members of a pair.
 // Specifically, if p1 and p2, respectively, are the functions that
 // map a pair to its first and second, respectively, members, the
@@ -346,17 +346,17 @@ class STLBinaryPredicate : public STLBin
 
 template<typename Pair, typename UnaryOp>
 class UnaryOperateOnFirst
     : public std::unary_function<Pair, typename UnaryOp::result_type> {
  public:
   UnaryOperateOnFirst() {
   }
 
-  UnaryOperateOnFirst(const UnaryOp& f) : f_(f) {
+  explicit UnaryOperateOnFirst(const UnaryOp& f) : f_(f) {
   }
 
   typename UnaryOp::result_type operator()(const Pair& p) const {
     return f_(p.first);
   }
 
  private:
   UnaryOp f_;
@@ -369,17 +369,17 @@ UnaryOperateOnFirst<Pair, UnaryOp> Unary
 
 template<typename Pair, typename UnaryOp>
 class UnaryOperateOnSecond
     : public std::unary_function<Pair, typename UnaryOp::result_type> {
  public:
   UnaryOperateOnSecond() {
   }
 
-  UnaryOperateOnSecond(const UnaryOp& f) : f_(f) {
+  explicit UnaryOperateOnSecond(const UnaryOp& f) : f_(f) {
   }
 
   typename UnaryOp::result_type operator()(const Pair& p) const {
     return f_(p.second);
   }
 
  private:
   UnaryOp f_;
@@ -392,17 +392,17 @@ UnaryOperateOnSecond<Pair, UnaryOp> Unar
 
 template<typename Pair, typename BinaryOp>
 class BinaryOperateOnFirst
     : public std::binary_function<Pair, Pair, typename BinaryOp::result_type> {
  public:
   BinaryOperateOnFirst() {
   }
 
-  BinaryOperateOnFirst(const BinaryOp& f) : f_(f) {
+  explicit BinaryOperateOnFirst(const BinaryOp& f) : f_(f) {
   }
 
   typename BinaryOp::result_type operator()(const Pair& p1,
                                             const Pair& p2) const {
     return f_(p1.first, p2.first);
   }
 
  private:
@@ -416,17 +416,17 @@ BinaryOperateOnFirst<Pair, BinaryOp> Bin
 
 template<typename Pair, typename BinaryOp>
 class BinaryOperateOnSecond
     : public std::binary_function<Pair, Pair, typename BinaryOp::result_type> {
  public:
   BinaryOperateOnSecond() {
   }
 
-  BinaryOperateOnSecond(const BinaryOp& f) : f_(f) {
+  explicit BinaryOperateOnSecond(const BinaryOp& f) : f_(f) {
   }
 
   typename BinaryOp::result_type operator()(const Pair& p1,
                                             const Pair& p2) const {
     return f_(p1.second, p2.second);
   }
 
  private:
--- a/ipc/chromium/src/base/thread_local_storage.h
+++ b/ipc/chromium/src/base/thread_local_storage.h
@@ -19,17 +19,17 @@ class ThreadLocalStorage {
   // Prototype for the TLS destructor function, which can be optionally used to
   // cleanup thread local storage on thread exit.  'value' is the data that is
   // stored in thread local storage.
   typedef void (*TLSDestructorFunc)(void* value);
 
   // A key representing one value stored in TLS.
   class Slot {
    public:
-    Slot(TLSDestructorFunc destructor = NULL);
+    explicit Slot(TLSDestructorFunc destructor = NULL);
 
     // This constructor should be used for statics.
     // It returns an uninitialized Slot.
     explicit Slot(base::LinkerInitialized x) {}
 
     // Set up the TLS slot.  Called by the constructor.
     // 'destructor' is a pointer to a function to perform per-thread cleanup of
     // this object.  If set to NULL, no cleanup is done for this TLS slot.
--- a/ipc/chromium/src/chrome/common/child_process.h
+++ b/ipc/chromium/src/chrome/common/child_process.h
@@ -16,17 +16,17 @@ class ChildThread;
 
 
 // Base class for child processes of the browser process (i.e. renderer and
 // plugin host). This is a singleton object for each child process.
 class ChildProcess {
  public:
   // Child processes should have an object that derives from this class.  The
   // constructor will return once ChildThread has started.
-  ChildProcess(ChildThread* child_thread);
+  explicit ChildProcess(ChildThread* child_thread);
   virtual ~ChildProcess();
 
   // Getter for this process' main thread.
   ChildThread* child_thread() { return child_thread_.get(); }
 
   // A global event object that is signalled when the main thread's message
   // loop exits.  This gives background threads a way to observe the main
   // thread shutting down.  This can be useful when a background thread is
--- a/ipc/chromium/src/chrome/common/child_process_host.cc
+++ b/ipc/chromium/src/chrome/common/child_process_host.cc
@@ -108,17 +108,17 @@ void ChildProcessHost::SetHandle(base::P
 
   DCHECK(!handle());
   set_handle(process);
   watcher_.StartWatching(process_event_.get(), this);
 #endif
 }
 
 void ChildProcessHost::InstanceCreated() {
-  Notify(NotificationType::CHILD_INSTANCE_CREATED);
+  Notify(NotificationType(NotificationType::CHILD_INSTANCE_CREATED));
 }
 
 bool ChildProcessHost::Send(IPC::Message* msg) {
   if (!channel_.get()) {
     delete msg;
     return false;
   }
   return channel_->Send(msg);
@@ -183,17 +183,17 @@ void ChildProcessHost::ListenerHook::OnM
 #endif
 }
 
 void ChildProcessHost::ListenerHook::OnChannelConnected(int32_t peer_pid) {
   host_->opening_channel_ = false;
   host_->OnChannelConnected(peer_pid);
 
   // Notify in the main loop of the connection.
-  host_->Notify(NotificationType::CHILD_PROCESS_HOST_CONNECTED);
+  host_->Notify(NotificationType(NotificationType::CHILD_PROCESS_HOST_CONNECTED));
 }
 
 void ChildProcessHost::ListenerHook::OnChannelError() {
   host_->opening_channel_ = false;
   host_->OnChannelError();
 }
 
 void ChildProcessHost::ListenerHook::GetQueuedMessages(std::queue<IPC::Message>& queue) {
--- a/ipc/chromium/src/chrome/common/child_thread.h
+++ b/ipc/chromium/src/chrome/common/child_thread.h
@@ -12,17 +12,17 @@
 class ResourceDispatcher;
 
 // Child processes's background thread should derive from this class.
 class ChildThread : public IPC::Channel::Listener,
                     public IPC::Message::Sender,
                     public base::Thread {
  public:
   // Creates the thread.
-  ChildThread(Thread::Options options);
+  explicit ChildThread(Thread::Options options);
   virtual ~ChildThread();
 
   // IPC::Message::Sender implementation:
   virtual bool Send(IPC::Message* msg);
 
   // See documentation on MessageRouter for AddRoute and RemoveRoute
   void AddRoute(int32_t routing_id, IPC::Channel::Listener* listener);
   void RemoveRoute(int32_t routing_id);
--- a/ipc/chromium/src/chrome/common/mach_ipc_mac.h
+++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.h
@@ -81,17 +81,17 @@ class MachMsgPortDescriptor : public mac
     name = in_name;
     pad1 = 0;
     pad2 = 0;
     disposition = in_disposition;
     type = MACH_MSG_PORT_DESCRIPTOR;
   }
 
   // For passing send rights to a port
-  MachMsgPortDescriptor(mach_port_t in_name) {
+  explicit MachMsgPortDescriptor(mach_port_t in_name) {
     name = in_name;
     pad1 = 0;
     pad2 = 0;
     disposition = MACH_MSG_TYPE_PORT_SEND;
     type = MACH_MSG_PORT_DESCRIPTOR;
   }
 
   // Copy constructor
@@ -246,35 +246,35 @@ class MachReceiveMessage : public MachMe
 
  private:
     DISALLOW_COPY_AND_ASSIGN(MachReceiveMessage);
 };
 
 //==============================================================================
 class MachSendMessage : public MachMessage {
  public:
-  MachSendMessage(int32_t message_id);
+  explicit MachSendMessage(int32_t message_id);
   MachSendMessage(void *storage, size_t storage_length, int32_t message_id);
 
  private:
   void Initialize(int32_t message_id);
 
   DISALLOW_COPY_AND_ASSIGN(MachSendMessage);
 };
 
 //==============================================================================
 // Represents a mach port for which we have receive rights
 class ReceivePort {
  public:
   // Creates a new mach port for receiving messages and registers a name for it
-  ReceivePort(const char *receive_port_name);
+  explicit ReceivePort(const char *receive_port_name);
 
   // Given an already existing mach port, use it.  We take ownership of the
   // port and deallocate it in our destructor.
-  ReceivePort(mach_port_t receive_port);
+  explicit ReceivePort(mach_port_t receive_port);
 
   // Create a new mach port for receiving messages
   ReceivePort();
 
   ~ReceivePort();
 
   // Waits on the mach port until message received or timeout
   kern_return_t WaitForMessage(MachReceiveMessage *out_message,
@@ -290,21 +290,21 @@ class ReceivePort {
   DISALLOW_COPY_AND_ASSIGN(ReceivePort);
 };
 
 //==============================================================================
 // Represents a mach port for which we have send rights
 class MachPortSender {
  public:
   // get a port with send rights corresponding to a named registered service
-  MachPortSender(const char *receive_port_name);
+  explicit MachPortSender(const char *receive_port_name);
 
 
   // Given an already existing mach port, use it.
-  MachPortSender(mach_port_t send_port);
+  explicit MachPortSender(mach_port_t send_port);
 
   kern_return_t SendMessage(MachSendMessage &message,
                             mach_msg_timeout_t timeout);
 
  private:
   mach_port_t   send_port_;
   kern_return_t init_result_;
 
--- a/ipc/chromium/src/chrome/common/notification_details.h
+++ b/ipc/chromium/src/chrome/common/notification_details.h
@@ -28,25 +28,25 @@ class NotificationDetails {
     return ptr_ != other.ptr_;
   }
 
   bool operator==(const NotificationDetails& other) const {
     return ptr_ == other.ptr_;
   }
 
  protected:
-  NotificationDetails(void* ptr) : ptr_(ptr) {}
+  explicit NotificationDetails(void* ptr) : ptr_(ptr) {}
 
   void* ptr_;
 };
 
 template <class T>
 class Details : public NotificationDetails {
  public:
-  Details(T* ptr) : NotificationDetails(ptr) {}
-  Details(const NotificationDetails& other)
+  explicit Details(T* ptr) : NotificationDetails(ptr) {}
+  explicit Details(const NotificationDetails& other)
     : NotificationDetails(other) {}
 
   T* operator->() const { return ptr(); }
   T* ptr() const { return static_cast<T*>(ptr_); }
 };
 
 #endif  // CHROME_COMMON_NOTIFICATION_DETAILS_H__
--- a/ipc/chromium/src/chrome/common/notification_source.h
+++ b/ipc/chromium/src/chrome/common/notification_source.h
@@ -26,26 +26,26 @@ class NotificationSource {
   bool operator!=(const NotificationSource& other) const {
     return ptr_ != other.ptr_;
   }
   bool operator==(const NotificationSource& other) const {
     return ptr_ == other.ptr_;
   }
 
  protected:
-  NotificationSource(void* ptr) : ptr_(ptr) {}
+  explicit NotificationSource(void* ptr) : ptr_(ptr) {}
 
   void* ptr_;
 };
 
 template <class T>
 class Source : public NotificationSource {
  public:
-  Source(T* ptr) : NotificationSource(ptr) {}
+  explicit Source(T* ptr) : NotificationSource(ptr) {}
 
-  Source(const NotificationSource& other)
+  explicit Source(const NotificationSource& other)
     : NotificationSource(other) {}
 
   T* operator->() const { return ptr(); }
   T* ptr() const { return static_cast<T*>(ptr_); }
 };
 
 #endif  // CHROME_COMMON_NOTIFICATION_SOURCE_H__
--- a/ipc/chromium/src/chrome/common/notification_type.h
+++ b/ipc/chromium/src/chrome/common/notification_type.h
@@ -547,17 +547,17 @@ class NotificationType {
     RENDER_VIEW_HOST_DELETED,
 
     // Count (must be last) ----------------------------------------------------
     // Used to determine the number of notification types.  Not valid as
     // a type parameter when registering for or posting notifications.
     NOTIFICATION_TYPE_COUNT
   };
 
-  NotificationType(Type v) : value(v) {}
+  explicit NotificationType(Type v) : value(v) {}
 
   bool operator==(NotificationType t) const { return value == t.value; }
   bool operator!=(NotificationType t) const { return value != t.value; }
 
   // Comparison to explicit enum values.
   bool operator==(Type v) const { return value == v; }
   bool operator!=(Type v) const { return value != v; }
 
--- a/ipc/glue/BackgroundChildImpl.cpp
+++ b/ipc/glue/BackgroundChildImpl.cpp
@@ -10,17 +10,17 @@
 namespace {
 
 class TestChild MOZ_FINAL : public mozilla::ipc::PBackgroundTestChild
 {
   friend class mozilla::ipc::BackgroundChildImpl;
 
   nsCString mTestArg;
 
-  TestChild(const nsCString& aTestArg)
+  explicit TestChild(const nsCString& aTestArg)
   : mTestArg(aTestArg)
   {
     MOZ_COUNT_CTOR(TestChild);
   }
 
 protected:
   ~TestChild()
   {
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -322,17 +322,17 @@ class ChildImpl MOZ_FINAL : public Backg
     static_cast<unsigned int>(-1);
 
   // This is only modified on the main thread. It is the thread-local index that
   // we use to store the BackgroundChild for each thread.
   static unsigned int sThreadLocalIndex;
 
   struct ThreadLocalInfo
   {
-    ThreadLocalInfo(nsIIPCBackgroundChildCreateCallback* aCallback)
+    explicit ThreadLocalInfo(nsIIPCBackgroundChildCreateCallback* aCallback)
     {
       mCallbacks.AppendElement(aCallback);
     }
 
     nsRefPtr<ChildImpl> mActor;
     nsTArray<nsCOMPtr<nsIIPCBackgroundChildCreateCallback>> mCallbacks;
     nsAutoPtr<BackgroundChildImpl::ThreadLocal> mConsumerThreadLocal;
   };
@@ -493,17 +493,17 @@ private:
 
 class ParentImpl::RequestMessageLoopRunnable MOZ_FINAL :
   public nsRunnable
 {
   nsCOMPtr<nsIThread> mTargetThread;
   MessageLoop* mMessageLoop;
 
 public:
-  RequestMessageLoopRunnable(nsIThread* aTargetThread)
+  explicit RequestMessageLoopRunnable(nsIThread* aTargetThread)
   : mTargetThread(aTargetThread), mMessageLoop(nullptr)
   {
     AssertIsInMainProcess();
     AssertIsOnMainThread();
     MOZ_ASSERT(aTargetThread);
   }
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -533,17 +533,17 @@ private:
   NS_DECL_NSIRUNNABLE
 };
 
 class ParentImpl::ForceCloseBackgroundActorsRunnable MOZ_FINAL : public nsRunnable
 {
   nsTArray<ParentImpl*>* mActorArray;
 
 public:
-  ForceCloseBackgroundActorsRunnable(nsTArray<ParentImpl*>* aActorArray)
+  explicit ForceCloseBackgroundActorsRunnable(nsTArray<ParentImpl*>* aActorArray)
   : mActorArray(aActorArray)
   {
     AssertIsInMainProcess();
     AssertIsOnMainThread();
     MOZ_ASSERT(aActorArray);
   }
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -555,17 +555,17 @@ private:
   NS_DECL_NSIRUNNABLE
 };
 
 class ParentImpl::CreateCallbackRunnable MOZ_FINAL : public nsRunnable
 {
   nsRefPtr<CreateCallback> mCallback;
 
 public:
-  CreateCallbackRunnable(CreateCallback* aCallback)
+  explicit CreateCallbackRunnable(CreateCallback* aCallback)
   : mCallback(aCallback)
   {
     AssertIsInMainProcess();
     AssertIsOnMainThread();
     MOZ_ASSERT(aCallback);
   }
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -669,17 +669,17 @@ private:
 };
 
 class ChildImpl::ParentCreateCallback MOZ_FINAL :
   public ParentImpl::CreateCallback
 {
   nsCOMPtr<nsIEventTarget> mEventTarget;
 
 public:
-  ParentCreateCallback(nsIEventTarget* aEventTarget)
+  explicit ParentCreateCallback(nsIEventTarget* aEventTarget)
   : mEventTarget(aEventTarget)
   {
     AssertIsInMainProcess();
     AssertIsOnMainThread();
     MOZ_ASSERT(aEventTarget);
   }
 
 private:
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -149,17 +149,17 @@ GeckoChildProcessHost::GetPathToBinary(F
   }
 
   exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_NAME);
 }
 
 #ifdef MOZ_WIDGET_COCOA
 class AutoCFTypeObject {
 public:
-  AutoCFTypeObject(CFTypeRef object)
+  explicit AutoCFTypeObject(CFTypeRef object)
   {
     mObject = object;
   }
   ~AutoCFTypeObject()
   {
     ::CFRelease(mObject);
   }
 private:
@@ -707,17 +707,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
 
   if (child_message.GetTranslatedPort(1) == MACH_PORT_NULL) {
     CHROMIUM_LOG(ERROR) << "parent GetTranslatedPort(1) failed.";
     return false;
   }
   MachPortSender parent_sender(child_message.GetTranslatedPort(1));
 
   MachSendMessage parent_message(/* id= */0);
-  if (!parent_message.AddDescriptor(bootstrap_port)) {
+  if (!parent_message.AddDescriptor(MachMsgPortDescriptor(bootstrap_port))) {
     CHROMIUM_LOG(ERROR) << "parent AddDescriptor(" << bootstrap_port << ") failed.";
     return false;
   }
 
   err = parent_sender.SendMessage(parent_message, kTimeoutMs);
   if (err != KERN_SUCCESS) {
     std::string errString = StringPrintf("0x%x %s", err, mach_error_string(err));
     CHROMIUM_LOG(ERROR) << "parent SendMessage() failed: " << errString;
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -190,18 +190,18 @@ private:
     CxxStackFrame(const CxxStackFrame&) MOZ_DELETE;
     CxxStackFrame& operator=(const CxxStackFrame&) MOZ_DELETE;
 };
 
 namespace {
 
 class MOZ_STACK_CLASS MaybeScriptBlocker {
 public:
-    MaybeScriptBlocker(MessageChannel *aChannel
-                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    explicit MaybeScriptBlocker(MessageChannel *aChannel
+                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
         : mBlocked(aChannel->ShouldBlockScripts())
     {
         MOZ_GUARD_OBJECT_NOTIFIER_INIT;
         if (mBlocked) {
             nsContentUtils::AddScriptBlocker();
         }
     }
     ~MaybeScriptBlocker() {
--- a/ipc/glue/MessagePump.cpp
+++ b/ipc/glue/MessagePump.cpp
@@ -40,17 +40,17 @@ static mozilla::DebugOnly<MessagePump::D
 
 namespace mozilla {
 namespace ipc {
 
 class DoWorkRunnable MOZ_FINAL : public nsICancelableRunnable,
                                  public nsITimerCallback
 {
 public:
-  DoWorkRunnable(MessagePump* aPump)
+  explicit DoWorkRunnable(MessagePump* aPump)
   : mPump(aPump)
   {
     MOZ_ASSERT(aPump);
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
   NS_DECL_NSITIMERCALLBACK
--- a/ipc/glue/ProcessChild.h
+++ b/ipc/glue/ProcessChild.h
@@ -20,17 +20,17 @@
 namespace mozilla {
 namespace ipc {
 
 class ProcessChild : public ChildProcess {
 protected:
   typedef base::ProcessHandle ProcessHandle;
 
 public:
-  ProcessChild(ProcessHandle parentHandle);
+  explicit ProcessChild(ProcessHandle parentHandle);
   virtual ~ProcessChild();
 
   virtual bool Init() = 0;
   virtual void CleanUp()
   { }
 
   static MessageLoop* message_loop() {
     return gProcessChild->mUILoop;
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -324,24 +324,24 @@ XRE_InitChildProcess(int aArgc,
 #ifdef XP_MACOSX
   if (aArgc < 1)
     return NS_ERROR_FAILURE;
   const char* const mach_port_name = aArgv[--aArgc];
 
   const int kTimeoutMs = 1000;
 
   MachSendMessage child_message(0);
-  if (!child_message.AddDescriptor(mach_task_self())) {
+  if (!child_message.AddDescriptor(MachMsgPortDescriptor(mach_task_self()))) {
     NS_WARNING("child AddDescriptor(mach_task_self()) failed.");
     return NS_ERROR_FAILURE;
   }
 
   ReceivePort child_recv_port;
   mach_port_t raw_child_recv_port = child_recv_port.GetPort();
-  if (!child_message.AddDescriptor(raw_child_recv_port)) {
+  if (!child_message.AddDescriptor(MachMsgPortDescriptor(raw_child_recv_port))) {
     NS_WARNING("Adding descriptor to message failed");
     return NS_ERROR_FAILURE;
   }
 
   MachPortSender child_sender(mach_port_name);
   kern_return_t err = child_sender.SendMessage(child_message, kTimeoutMs);
   if (err != KERN_SUCCESS) {
     NS_WARNING("child SendMessage() failed");