Bug 1053603 - Fix some more bad implicit constructors in the IPC code; r=bent
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 07 Aug 2014 21:18:59 -0400
changeset 222372 28f072d3ee85d8d2c085377764f8508888643320
parent 222371 e024c7a1fef9f74938098345e2173cc32dafad67
child 222373 5cdc7c7332a978ff289dcfe6b5c05798f12fe60d
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)
reviewersbent
bugs1053603
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 1053603 - Fix some more bad implicit constructors in the IPC code; r=bent
ipc/chromium/src/base/at_exit.h
ipc/chromium/src/chrome/common/child_process_host.h
ipc/chromium/src/chrome/common/child_process_info.h
ipc/glue/CrossProcessMutex.h
ipc/glue/FileDescriptorUtils.h
ipc/glue/SharedMemoryBasic_chromium.h
--- a/ipc/chromium/src/base/at_exit.h
+++ b/ipc/chromium/src/base/at_exit.h
@@ -27,17 +27,17 @@ namespace base {
 // callbacks and singleton destructors will be called.
 
 class AtExitManager {
  protected:
   // This constructor will allow this instance of AtExitManager to be created
   // even if one already exists.  This should only be used for testing!
   // AtExitManagers are kept on a global stack, and it will be removed during
   // destruction.  This allows you to shadow another AtExitManager.
-  AtExitManager(bool shadow);
+  explicit AtExitManager(bool shadow);
 
  public:
   typedef void (*AtExitCallbackType)(void*);
 
   AtExitManager();
 
   // The dtor calls all the registered callbacks. Do not try to register more
   // callbacks after this point.
--- a/ipc/chromium/src/chrome/common/child_process_host.h
+++ b/ipc/chromium/src/chrome/common/child_process_host.h
@@ -39,17 +39,17 @@ class ChildProcessHost :
   // The Iterator class allows iteration through either all child processes, or
   // ones of a specific type, depending on which constructor is used.  Note that
   // this should be done from the IO thread and that the iterator should not be
   // kept around as it may be invalidated on subsequent event processing in the
   // event loop.
   class Iterator {
    public:
     Iterator();
-    Iterator(ProcessType type);
+    explicit Iterator(ProcessType type);
     ChildProcessHost* operator->() { return *iterator_; }
     ChildProcessHost* operator*() { return *iterator_; }
     ChildProcessHost* operator++();
     bool Done();
 
    private:
     bool all_;
     ProcessType type_;
@@ -96,17 +96,17 @@ class ChildProcessHost :
   virtual void OnWaitableEventSignaled(base::WaitableEvent *event);
 
  private:
   // By using an internal class as the IPC::Channel::Listener, we can intercept
   // OnMessageReceived/OnChannelConnected and do our own processing before
   // calling the subclass' implementation.
   class ListenerHook : public IPC::Channel::Listener {
    public:
-    ListenerHook(ChildProcessHost* host);
+    explicit ListenerHook(ChildProcessHost* host);
     virtual void OnMessageReceived(const IPC::Message& msg);
     virtual void OnChannelConnected(int32_t peer_pid);
     virtual void OnChannelError();
     virtual void GetQueuedMessages(std::queue<IPC::Message>& queue);
    private:
     ChildProcessHost* host_;
   };
 
--- a/ipc/chromium/src/chrome/common/child_process_info.h
+++ b/ipc/chromium/src/chrome/common/child_process_info.h
@@ -86,17 +86,17 @@ class ChildProcessInfo {
   void set_type(ProcessType type) { type_ = type; }
   void set_name(const std::wstring& name) { name_ = name; }
   void set_handle(base::ProcessHandle handle) {
     process_.set_handle(handle);
     pid_ = -1;
   }
 
   // Derived objects need to use this constructor so we know what type we are.
-  ChildProcessInfo(ProcessType type);
+  explicit ChildProcessInfo(ProcessType type);
 
  private:
   ProcessType type_;
   std::wstring name_;
   mutable int pid_;  // Cache of the process id.
 
   // The handle to the process.
   mutable base::Process process_;
--- a/ipc/glue/CrossProcessMutex.h
+++ b/ipc/glue/CrossProcessMutex.h
@@ -44,23 +44,23 @@ typedef uintptr_t CrossProcessMutexHandl
 
 class NS_COM_GLUE CrossProcessMutex
 {
 public:
   /**
    * CrossProcessMutex
    * @param name A name which can reference this lock (currently unused)
    **/
-  CrossProcessMutex(const char* aName);
+  explicit CrossProcessMutex(const char* aName);
   /**
    * CrossProcessMutex
    * @param handle A handle of an existing cross process mutex that can be
    *               opened.
    */
-  CrossProcessMutex(CrossProcessMutexHandle aHandle);
+  explicit CrossProcessMutex(CrossProcessMutexHandle aHandle);
 
   /**
    * ~CrossProcessMutex
    **/
   ~CrossProcessMutex();
 
   /**
    * Lock
--- a/ipc/glue/FileDescriptorUtils.h
+++ b/ipc/glue/FileDescriptorUtils.h
@@ -19,17 +19,17 @@ namespace ipc {
 // avoid main thread I/O).
 class CloseFileRunnable MOZ_FINAL : public nsIRunnable
 {
   typedef mozilla::ipc::FileDescriptor FileDescriptor;
 
   FileDescriptor mFileDescriptor;
 
 public:
-  CloseFileRunnable(const FileDescriptor& aFileDescriptor)
+  explicit CloseFileRunnable(const FileDescriptor& aFileDescriptor)
 #ifdef DEBUG
   ;
 #else
   : mFileDescriptor(aFileDescriptor)
   { }
 #endif
 
   NS_DECL_THREADSAFE_ISUPPORTS
--- a/ipc/glue/SharedMemoryBasic_chromium.h
+++ b/ipc/glue/SharedMemoryBasic_chromium.h
@@ -25,17 +25,17 @@ class SharedMemoryBasic : public SharedM
 {
 public:
   typedef base::SharedMemoryHandle Handle;
 
   SharedMemoryBasic()
   {
   }
 
-  SharedMemoryBasic(const Handle& aHandle)
+  explicit SharedMemoryBasic(const Handle& aHandle)
     : mSharedMemory(aHandle, false)
   {
   }
 
   virtual bool Create(size_t aNbytes) MOZ_OVERRIDE
   {
     bool ok = mSharedMemory.Create("", false, false, aNbytes);
     if (ok) {