Backed out changeset 03bdec48d0ac (bug 450881) for Windows build bustage
authorWes Kocher <wkocher@mozilla.com>
Tue, 21 Jan 2014 18:13:21 -0800
changeset 164573 e057ecce0007030871d3c2ec6ec7d746fbbbb7f5
parent 164572 73b036d727534be3466bb8892c5a65c0b25c3ca0
child 164574 f97076de7eb0125c42cfbd2974b55ffd9c5d8b42
push id38746
push userkwierso@gmail.com
push dateWed, 22 Jan 2014 02:13:34 +0000
treeherdermozilla-inbound@e057ecce0007 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs450881
milestone29.0a1
backs out03bdec48d0ac18016bf0e59b0357d8d45c0db903
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
Backed out changeset 03bdec48d0ac (bug 450881) for Windows build bustage
xpcom/glue/nsCOMArray.cpp
xpcom/glue/nsCOMArray.h
--- a/xpcom/glue/nsCOMArray.cpp
+++ b/xpcom/glue/nsCOMArray.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMArray.h"
 
 #include "mozilla/MemoryReporting.h"
-#include "mozilla/mozalloc.h"
 
 #include "nsCOMPtr.h"
 
 // This specialization is private to nsCOMArray.
 // It exists solely to automatically zero-out newly created array elements.
 template<>
 class nsTArrayElementTraits<nsISupports*>
 {
@@ -274,34 +273,8 @@ nsCOMArray_base::SizeOfExcludingThis(
     size_t n = mArray.SizeOfExcludingThis(aMallocSizeOf);
 
     if (aSizeOfElementIncludingThis)
         for (uint32_t index = 0; index < mArray.Length(); index++)
             n += aSizeOfElementIncludingThis(mArray[index], aMallocSizeOf, aData);
 
     return n;
 }
-
-
-void
-nsCOMArray_base::Adopt(nsISupports** aElements, uint32_t aSize)
-{
-    Clear();
-    mArray.AppendElements(aElements, aSize);
-
-    // Free the allocated array as well.
-    moz_free(aElements);
-}
-
-uint32_t
-nsCOMArray_base::Forget(nsISupports*** elements)
-{
-    uint32_t length = Length();
-    size_t array_size = sizeof(nsISupports*) * length;
-    nsISupports** array = static_cast<nsISupports**>(moz_xmalloc(array_size));
-    memmove(array, Elements(), array_size);
-    *elements = array;
-    // Don't Release the contained pointers; the caller of the method will
-    // do this eventually.
-    mArray.Clear();
-
-    return length;
-}
--- a/xpcom/glue/nsCOMArray.h
+++ b/xpcom/glue/nsCOMArray.h
@@ -84,18 +84,16 @@ protected:
     bool RemoveObject(nsISupports *aObject);
     nsISupports** Elements() {
         return mArray.Elements();
     }
     void SwapElements(nsCOMArray_base& aOther) {
         mArray.SwapElements(aOther.mArray);
     }
 
-    void Adopt(nsISupports** aElements, uint32_t aCount);
-    uint32_t Forget(nsISupports*** aElements);
 public:
     // elements in the array (including null elements!)
     int32_t Count() const {
         return mArray.Length();
     }
     // nsTArray-compatible version
     uint32_t Length() const {
         return mArray.Length();
@@ -227,26 +225,18 @@ class nsCOMArray : public nsCOMArray_bas
     nsCOMArray() {}
 
     explicit
     nsCOMArray(int32_t aCount) : nsCOMArray_base(aCount) {}
 
     explicit
     nsCOMArray(const nsCOMArray<T>& aOther) : nsCOMArray_base(aOther) { }
 
-    nsCOMArray(nsCOMArray<T>&& aOther) { SwapElements(aOther); }
-
     ~nsCOMArray() {}
 
-    // We have a move assignment operator, but no copy assignment operator.
-    nsCOMArray<T>& operator=(nsCOMArray<T>&& aOther) {
-        SwapElements(aOther);
-        return *this;
-    }
-
     // these do NOT refcount on the way out, for speed
     T* ObjectAt(int32_t aIndex) const {
         return static_cast<T*>(nsCOMArray_base::ObjectAt(aIndex));
     }
     // nsTArray-compatible version
     T* ElementAt(uint32_t aIndex) const {
         return static_cast<T*>(nsCOMArray_base::ElementAt(aIndex));
     }
@@ -392,45 +382,16 @@ class nsCOMArray : public nsCOMArray_bas
     size_t SizeOfExcludingThis(
              nsCOMArraySizeOfElementIncludingThisFunc aSizeOfElementIncludingThis, 
              mozilla::MallocSizeOf aMallocSizeOf, void *aData = nullptr) const {
         return nsCOMArray_base::SizeOfExcludingThis(
                  nsBaseArraySizeOfElementIncludingThisFunc(aSizeOfElementIncludingThis),
                  aMallocSizeOf, aData);
     }
 
-    /**
-     * Adopt parameters that resulted from an XPIDL outparam. The aElements
-     * parameter will be freed as a result of the call.
-     *
-     * Example usage:
-     * nsCOMArray<nsISomeInterface> array;
-     * nsISomeInterface** elements;
-     * uint32_t length;
-     * ptr->GetSomeArray(&elements, &length);
-     * array.Adopt(elements, length);
-     */
-    void Adopt(T** aElements, uint32_t aSize) {
-        nsCOMArray_base::Adopt(reinterpret_cast<nsISupports**>(aElements),
-            aSize);
-    }
-
-    /**
-     * Export the contents of this array to an XPIDL outparam. The array will be
-     * Clear()'d after this operation.
-     *
-     * Example usage:
-     * nsCOMArray<nsISomeInterface> array;
-     * *length = array.Forget(retval);
-     */
-    uint32_t Forget(T*** elements) {
-        return nsCOMArray_base::Forget(
-            reinterpret_cast<nsISupports***>(elements));
-    }
-
 private:
 
     // don't implement these!
     nsCOMArray<T>& operator=(const nsCOMArray<T>& other) MOZ_DELETE;
 };
 
 template <typename T>
 inline void