Backout bug 979445 due to clang build failures. CLOSED TREE
authorKyle Huey <khuey@kylehuey.com>
Thu, 06 Mar 2014 11:19:44 -0800
changeset 172364 5ac785fef8ac76df03a8b5304057deb9a9aef5f7
parent 172363 969220ac8459bb6820e88e75e37cf525e06f5708
child 172365 868e93e74341cc1f95792d7afd08565629ca3b6e
push id26358
push usercbook@mozilla.com
push dateFri, 07 Mar 2014 11:48:31 +0000
treeherderautoland@b9fc2eb18bd1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs979445
milestone30.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
Backout bug 979445 due to clang build failures. CLOSED TREE
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/OpenDatabaseHelper.cpp
storage/public/mozIStorageAsyncStatement.idl
storage/public/mozIStorageBaseStatement.idl
storage/public/mozIStorageBindingParams.idl
storage/public/mozIStorageStatement.idl
storage/src/StorageBaseStatementInternal.h
storage/src/Variant.h
storage/src/mozStorageBindingParams.cpp
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -16,17 +16,16 @@
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/FileHandleBinding.h"
 #include "mozilla/dom/StructuredCloneTags.h"
 #include "mozilla/dom/ipc/Blob.h"
 #include "mozilla/dom/quota/FileStreams.h"
 #include "mozilla/Endian.h"
 #include "mozilla/storage.h"
-#include "nsAutoRef.h"
 #include "nsContentUtils.h"
 #include "nsDOMClassInfo.h"
 #include "nsDOMFile.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "nsEventDispatcher.h"
 #include "nsJSUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
@@ -3090,39 +3089,28 @@ NoRequestObjectStoreHelper::OnSuccess()
 
 void
 NoRequestObjectStoreHelper::OnError()
 {
   NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
   mTransaction->Abort(GetResultCode());
 }
 
-namespace {
-
 // This is a duplicate of the js engine's byte munging in StructuredClone.cpp
 uint64_t
 ReinterpretDoubleAsUInt64(double d)
 {
   union {
     double d;
     uint64_t u;
   } pun;
   pun.d = d;
   return pun.u;
 }
 
-template <>
-class nsAutoRefTraits<char> : public nsPointerRefTraits<char>
-{
-public:
-  static void Release(char* ptr) { moz_free(ptr); }
-};
-
-} // anonymous namespace
-
 nsresult
 AddHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
 {
   NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
   NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!");
   NS_ASSERTION(aConnection, "Passed a null connection!");
 
   PROFILER_LABEL("IndexedDB", "AddHelper::DoDatabaseWork");
@@ -3189,40 +3177,38 @@ AddHelper::DoDatabaseWork(mozIStorageCon
                                 mCloneWriteInfo.mOffsetToKeyProp,
                                 ReinterpretDoubleAsUInt64(static_cast<double>(
                                                           autoIncrementNum)));
     }
   }
 
   mKey.BindToStatement(stmt, NS_LITERAL_CSTRING("key_value"));
 
-
   // Compress the bytes before adding into the database.
   const char* uncompressed =
     reinterpret_cast<const char*>(mCloneWriteInfo.mCloneBuffer.data());
   size_t uncompressedLength = mCloneWriteInfo.mCloneBuffer.nbytes();
 
+  static const fallible_t fallible = fallible_t();
   size_t compressedLength = snappy::MaxCompressedLength(uncompressedLength);
-  // moz_malloc is equivalent to NS_Alloc, which we use because mozStorage
-  // expects to be able to free the adopted pointer with NS_Free.
-  nsAutoRef<char> compressed((char*)moz_malloc(compressedLength));
+  // This will hold our compressed data until the end of the method. The
+  // BindBlobByName function will copy it.
+  nsAutoArrayPtr<char> compressed(new (fallible) char[compressedLength]);
   NS_ENSURE_TRUE(compressed, NS_ERROR_OUT_OF_MEMORY);
 
-  snappy::RawCompress(uncompressed, uncompressedLength, compressed,
+  snappy::RawCompress(uncompressed, uncompressedLength, compressed.get(),
                       &compressedLength);
 
-  uint8_t* dataBuffer = reinterpret_cast<uint8_t*>(compressed.get());
+  const uint8_t* dataBuffer =
+    reinterpret_cast<const uint8_t*>(compressed.get());
   size_t dataBufferLength = compressedLength;
 
-  // If this call succeeds, | compressed | is now owned by mozStorage, and we
-  // are no longer responsible for it.
-  rv = stmt->BindAdoptedBlobByName(NS_LITERAL_CSTRING("data"), dataBuffer,
-                                   dataBufferLength);
+  rv = stmt->BindBlobByName(NS_LITERAL_CSTRING("data"), dataBuffer,
+                            dataBufferLength);
   IDB_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
-  compressed.disown();
 
   // Handle blobs
   uint32_t length = mCloneWriteInfo.mFiles.Length();
   if (length) {
     nsRefPtr<FileManager> fileManager = mDatabase->Manager();
 
     nsCOMPtr<nsIFile> directory = fileManager->GetDirectory();
     IDB_ENSURE_TRUE(directory, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
--- a/dom/indexedDB/OpenDatabaseHelper.cpp
+++ b/dom/indexedDB/OpenDatabaseHelper.cpp
@@ -902,27 +902,31 @@ public:
       return NS_ERROR_UNEXPECTED;
     }
 
     const uint8_t* uncompressed;
     uint32_t uncompressedLength;
     rv = aArguments->GetSharedBlob(0, &uncompressedLength, &uncompressed);
     NS_ENSURE_SUCCESS(rv, rv);
 
+    static const fallible_t fallible = fallible_t();
     size_t compressedLength = snappy::MaxCompressedLength(uncompressedLength);
-    char* compressed = (char*)moz_malloc(compressedLength);
+    nsAutoArrayPtr<char> compressed(new (fallible) char[compressedLength]);
     NS_ENSURE_TRUE(compressed, NS_ERROR_OUT_OF_MEMORY);
 
     snappy::RawCompress(reinterpret_cast<const char*>(uncompressed),
-                        uncompressedLength, compressed, &compressedLength);
-
-    std::pair<uint8_t *, int> data((uint8_t*)compressed,
-                                   int(compressedLength));
-    // The variant takes ownership of | compressed |.
-    nsCOMPtr<nsIVariant> result = new mozilla::storage::AdoptedBlobVariant(data);
+                        uncompressedLength, compressed.get(),
+                        &compressedLength);
+
+    std::pair<const void *, int> data(static_cast<void*>(compressed.get()),
+                                      int(compressedLength));
+
+    // XXX This copies the buffer again... There doesn't appear to be any way to
+    //     preallocate space and write directly to a BlobVariant at the moment.
+    nsCOMPtr<nsIVariant> result = new mozilla::storage::BlobVariant(data);
 
     result.forget(aResult);
     return NS_OK;
   }
 };
 
 NS_IMPL_ISUPPORTS1(CompressDataBlobsFunction, mozIStorageFunction)
 
--- a/storage/public/mozIStorageAsyncStatement.idl
+++ b/storage/public/mozIStorageAsyncStatement.idl
@@ -11,17 +11,17 @@
  * only being usable for asynchronous execution.  (mozIStorageStatement can
  * be used for both synchronous and asynchronous purposes.)  This specialization
  * for asynchronous operation allows us to avoid needing to acquire
  * synchronization primitives also used by the asynchronous execution thread.
  * In contrast, mozIStorageStatement may need to acquire the primitives and
  * consequently can cause the main thread to lock for extended intervals while
  * the asynchronous thread performs some long-running operation.
  */
-[scriptable, uuid(52e49370-3b2e-4a27-a3fc-79e20ad4056b)]
+[scriptable, uuid(2400f64d-2cb3-49a9-b01e-f03cacb8aa6e)]
 interface mozIStorageAsyncStatement : mozIStorageBaseStatement {
   /*
    * 'params' provides a magic JS helper that lets you assign parameters by
    * name.  Unlike the helper on mozIStorageStatement, you cannot enumerate
    * in order to find out what parameters are legal.
    *
    * This does not work for BLOBs.  You must use an explicit binding API for
    * that.
--- a/storage/public/mozIStorageBaseStatement.idl
+++ b/storage/public/mozIStorageBaseStatement.idl
@@ -14,17 +14,17 @@ interface mozIStorageBindingParams;
 interface mozIStorageBindingParamsArray;
 
 /**
  * The base interface for both pure asynchronous storage statements 
  * (mozIStorageAsyncStatement) and 'classic' storage statements
  * (mozIStorageStatement) that can be used for both synchronous and asynchronous
  * purposes.
  */
-[scriptable, uuid(5d34f333-ed3f-4aa2-ba51-f2a8b0cfa33a)]
+[scriptable, uuid(da2ec336-fbbb-4ba1-9778-8c9825980d01)]
 interface mozIStorageBaseStatement : mozIStorageBindingParams {
   /**
    * Finalizes a statement so you can successfully close a database connection.
    * Once a statement has been finalized it can no longer be used for any
    * purpose.
    * 
    * Statements are implicitly finalized when their reference counts hits zero.
    * If you are a native (C++) caller this is accomplished by setting all of
@@ -62,20 +62,16 @@ interface mozIStorageBaseStatement : moz
                                        in long aValue);
   [deprecated] void bindInt64Parameter(in unsigned long aParamIndex,
                                        in long long aValue);
   [deprecated] void bindNullParameter(in unsigned long aParamIndex);
   [deprecated] void bindBlobParameter(
     in unsigned long aParamIndex,
     [array,const,size_is(aValueSize)] in octet aValue,
     in unsigned long aValueSize);
-  [deprecated] void bindAdoptedBlobParameter(
-    in unsigned long aParamIndex,
-    [array,size_is(aValueSize)] in octet aValue,
-    in unsigned long aValueSize);
   /**@}*/
 
   /**
    * Binds the array of parameters to the statement.  When executeAsync is
    * called, all the parameters in aParameters are bound and then executed.
    *
    * @param aParameters
    *        The array of parameters to bind to the statement upon execution.
--- a/storage/public/mozIStorageBindingParams.idl
+++ b/storage/public/mozIStorageBindingParams.idl
@@ -3,17 +3,17 @@
  * 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 "nsISupports.idl"
 
 interface nsIVariant;
 
-[scriptable, uuid(7d8763ad-79d9-4674-ada1-37fd702af68c)]
+[scriptable, uuid(a8d4827c-641c-45e3-a9ea-493570b4106b)]
 interface mozIStorageBindingParams : nsISupports {
   /**
    * Binds aValue to the parameter with the name aName.
    *
    * @param aName
    *        The name of the parameter to bind aValue to.
    * @param aValue
    *        The value to bind.
@@ -29,23 +29,16 @@ interface mozIStorageBindingParams : nsI
    [noscript] void bindInt32ByName(in AUTF8String aName,
                                    in long aValue);
    [noscript] void bindInt64ByName(in AUTF8String aName,
                                    in long long aValue);
    [noscript] void bindNullByName(in AUTF8String aName);
    void bindBlobByName(in AUTF8String aName,
                        [array, const, size_is(aValueSize)] in octet aValue,
                        in unsigned long aValueSize);
-   // The function adopts the storage for the provided blob.  After calling
-   // this function, mozStorage will ensure that NS_Free is called on the
-   // underlying pointer.
-   [noscript]
-   void bindAdoptedBlobByName(in AUTF8String aName,
-                              [array, size_is(aValueSize)] in octet aValue,
-                              in unsigned long aValueSize);
 
    /**
     * Binds aValue to the parameter with the index aIndex.
     *
     * @param aIndex
     *        The zero-based index of the parameter to bind aValue to.
     * @param aValue
     *        The value to bind.
@@ -61,16 +54,9 @@ interface mozIStorageBindingParams : nsI
    [noscript] void bindInt32ByIndex(in unsigned long aIndex,
                                     in long aValue);
    [noscript] void bindInt64ByIndex(in unsigned long aIndex,
                                     in long long aValue);
    [noscript] void bindNullByIndex(in unsigned long aIndex);
    void bindBlobByIndex(in unsigned long aIndex,
                         [array, const, size_is(aValueSize)] in octet aValue,
                         in unsigned long aValueSize);
-   // The function adopts the storage for the provided blob.  After calling
-   // this function, mozStorage will ensure that NS_Free is called on the
-   // underlying pointer.
-   [noscript]
-   void bindAdoptedBlobByIndex(in unsigned long aIndex,
-                               [array, size_is(aValueSize)] in octet aValue,
-                               in unsigned long aValueSize);
 };
--- a/storage/public/mozIStorageStatement.idl
+++ b/storage/public/mozIStorageStatement.idl
@@ -10,17 +10,17 @@
 %}
 
 [ptr] native octetPtr(uint8_t);
 
 /**
  * A SQL statement that can be used for both synchronous and asynchronous
  * purposes.
  */
-[scriptable, uuid(b3c4476e-c490-4e3b-9db1-e2d3a6f0287c)]
+[scriptable, uuid(57ec7be1-36cf-4510-b938-7d1c9ee8cec5)]
 interface mozIStorageStatement : mozIStorageBaseStatement {
   /**
    * Create a clone of this statement, by initializing a new statement
    * with the same connection and same SQL statement as this one.  It
    * does not preserve statement state; that is, if a statement is
    * being executed when it is cloned, the new statement will not be
    * executing.
    */
--- a/storage/src/StorageBaseStatementInternal.h
+++ b/storage/src/StorageBaseStatementInternal.h
@@ -314,25 +314,16 @@ NS_DEFINE_STATIC_IID_ACCESSOR(StorageBas
   BIND_GEN_IMPL(_class, _optionalGuard,                  \
                 Blob,                                    \
                 (const nsACString &aWhere,               \
                  const uint8_t *aValue,                  \
                  uint32_t aValueSize),                   \
                 (uint32_t aWhere,                        \
                  const uint8_t *aValue,                  \
                  uint32_t aValueSize),                   \
-                (aWhere, aValue, aValueSize))            \
-  BIND_GEN_IMPL(_class, _optionalGuard,                  \
-                AdoptedBlob,                             \
-                (const nsACString &aWhere,               \
-                 uint8_t *aValue,                        \
-                 uint32_t aValueSize),                   \
-                (uint32_t aWhere,                        \
-                 uint8_t *aValue,                        \
-                 uint32_t aValueSize),                   \
                 (aWhere, aValue, aValueSize))
 
   
 
 } // storage
 } // mozilla
 
 #endif // mozilla_storage_StorageBaseStatementInternal_h_
--- a/storage/src/Variant.h
+++ b/storage/src/Variant.h
@@ -49,59 +49,56 @@ protected:
  */
 
 template <typename DataType>
 struct variant_traits
 {
   static inline uint16_t type() { return nsIDataType::VTYPE_EMPTY; }
 };
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 struct variant_storage_traits
 {
   typedef DataType ConstructorType;
   typedef DataType StorageType;
   static inline void storage_conversion(const ConstructorType aData, StorageType* _storage)
   {
     *_storage = aData;
   }
-
-  static inline void destroy(const StorageType& _storage)
-  { }
 };
 
 #define NO_CONVERSION return NS_ERROR_CANNOT_CONVERT_DATA;
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 struct variant_integer_traits
 {
-  typedef typename variant_storage_traits<DataType, Adopting>::StorageType StorageType;
+  typedef typename variant_storage_traits<DataType>::StorageType StorageType;
   static inline nsresult asInt32(const StorageType &, int32_t *) { NO_CONVERSION }
   static inline nsresult asInt64(const StorageType &, int64_t *) { NO_CONVERSION }
 };
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 struct variant_float_traits
 {
-  typedef typename variant_storage_traits<DataType, Adopting>::StorageType StorageType;
+  typedef typename variant_storage_traits<DataType>::StorageType StorageType;
   static inline nsresult asDouble(const StorageType &, double *) { NO_CONVERSION }
 };
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 struct variant_text_traits
 {
-  typedef typename variant_storage_traits<DataType, Adopting>::StorageType StorageType;
+  typedef typename variant_storage_traits<DataType>::StorageType StorageType;
   static inline nsresult asUTF8String(const StorageType &, nsACString &) { NO_CONVERSION }
   static inline nsresult asString(const StorageType &, nsAString &) { NO_CONVERSION }
 };
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 struct variant_blob_traits
 {
-  typedef typename variant_storage_traits<DataType, Adopting>::StorageType StorageType;
+  typedef typename variant_storage_traits<DataType>::StorageType StorageType;
   static inline nsresult asArray(const StorageType &, uint16_t *, uint32_t *, void **)
   { NO_CONVERSION }
 };
 
 #undef NO_CONVERSION
 
 /**
  * INTEGER types
@@ -176,18 +173,16 @@ template < >
 struct variant_storage_traits<nsString>
 {
   typedef const nsAString & ConstructorType;
   typedef nsString StorageType;
   static inline void storage_conversion(ConstructorType aText, StorageType* _outData)
   {
     *_outData = aText;
   }
-  static inline void destroy(const StorageType& _outData)
-  { }
 };
 template < >
 struct variant_text_traits<nsString>
 {
   static inline nsresult asUTF8String(const nsString &aValue,
                                       nsACString &_result)
   {
     CopyUTF16toUTF8(aValue, _result);
@@ -210,18 +205,16 @@ template < >
 struct variant_storage_traits<nsCString>
 {
   typedef const nsACString & ConstructorType;
   typedef nsCString StorageType;
   static inline void storage_conversion(ConstructorType aText, StorageType* _outData)
   {
     *_outData = aText;
   }
-  static inline void destroy(const StorageType &aData)
-  { }
 };
 template < >
 struct variant_text_traits<nsCString>
 {
   static inline nsresult asUTF8String(const nsCString &aValue,
                                       nsACString &_result)
   {
     _result = aValue;
@@ -240,49 +233,30 @@ struct variant_text_traits<nsCString>
  */
 
 template < >
 struct variant_traits<uint8_t[]>
 {
   static inline uint16_t type() { return nsIDataType::VTYPE_ARRAY; }
 };
 template < >
-struct variant_storage_traits<uint8_t[], false>
+struct variant_storage_traits<uint8_t[]>
 {
   typedef std::pair<const void *, int> ConstructorType;
   typedef FallibleTArray<uint8_t> StorageType;
   static inline void storage_conversion(ConstructorType aBlob, StorageType* _outData)
   {
     _outData->Clear();
     _outData->SetCapacity(aBlob.second);
     (void)_outData->AppendElements(static_cast<const uint8_t *>(aBlob.first),
                                    aBlob.second);
   }
-  static inline void destroy(const StorageType& _outData)
-  { }
 };
 template < >
-struct variant_storage_traits<uint8_t[], true>
-{
-  typedef std::pair<uint8_t *, int> ConstructorType;
-  typedef std::pair<uint8_t *, int> StorageType;
-  static inline void storage_conversion(ConstructorType aBlob, StorageType* _outData)
-  {
-    *_outData = aBlob;
-  }
-  static inline void destroy(StorageType &aData)
-  {
-    if (aData.first) {
-      NS_Free(aData.first);
-      aData.first = nullptr;
-    }
-  }
-};
-template < >
-struct variant_blob_traits<uint8_t[], false>
+struct variant_blob_traits<uint8_t[]>
 {
   static inline nsresult asArray(FallibleTArray<uint8_t> &aData,
                                  uint16_t *_type,
                                  uint32_t *_size,
                                  void **_result)
   {
     // For empty blobs, we return nullptr.
     if (aData.Length() == 0) {
@@ -298,44 +272,16 @@ struct variant_blob_traits<uint8_t[], fa
 
     // Set type and size
     *_type = nsIDataType::VTYPE_UINT8;
     *_size = aData.Length();
     return NS_OK;
   }
 };
 
-template < >
-struct variant_blob_traits<uint8_t[], true>
-{
-  static inline nsresult asArray(std::pair<uint8_t *, int> &aData,
-                                 uint16_t *_type,
-                                 uint32_t *_size,
-                                 void **_result)
-  {
-    // For empty blobs, we return nullptr.
-    if (aData.second == 0) {
-      *_result = nullptr;
-      *_type = nsIDataType::VTYPE_UINT8;
-      *_size = 0;
-      return NS_OK;
-    }
-
-    // Otherwise, transfer the data out.
-    *_result = aData.first;
-    aData.first = nullptr;
-    MOZ_ASSERT(*_result); // We asked for it twice, better not use adopting!
-
-    // Set type and size
-    *_type = nsIDataType::VTYPE_UINT8;
-    *_size = aData.second;
-    return NS_OK;
-  }
-};
-
 /**
  * nullptr type
  */
 
 class NullVariant : public Variant_base
 {
 public:
   NS_IMETHOD GetDataType(uint16_t *_type)
@@ -360,80 +306,74 @@ public:
     _str.SetIsVoid(true);
     return NS_OK;
   }
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Template Implementation
 
-template <typename DataType, bool Adopting=false>
+template <typename DataType>
 class Variant : public Variant_base
 {
-  ~Variant()
+public:
+  Variant(const typename variant_storage_traits<DataType>::ConstructorType aData)
   {
-    variant_storage_traits<DataType, Adopting>::destroy(mData);
-  }
-
-public:
-  Variant(const typename variant_storage_traits<DataType, Adopting>::ConstructorType aData)
-  {
-    variant_storage_traits<DataType, Adopting>::storage_conversion(aData, &mData);
+    variant_storage_traits<DataType>::storage_conversion(aData, &mData);
   }
 
   NS_IMETHOD GetDataType(uint16_t *_type)
   {
     *_type = variant_traits<DataType>::type();
     return NS_OK;
   }
   NS_IMETHOD GetAsInt32(int32_t *_integer)
   {
-    return variant_integer_traits<DataType, Adopting>::asInt32(mData, _integer);
+    return variant_integer_traits<DataType>::asInt32(mData, _integer);
   }
 
   NS_IMETHOD GetAsInt64(int64_t *_integer)
   {
-    return variant_integer_traits<DataType, Adopting>::asInt64(mData, _integer);
+    return variant_integer_traits<DataType>::asInt64(mData, _integer);
   }
 
   NS_IMETHOD GetAsDouble(double *_double)
   {
-    return variant_float_traits<DataType, Adopting>::asDouble(mData, _double);
+    return variant_float_traits<DataType>::asDouble(mData, _double);
   }
 
   NS_IMETHOD GetAsAUTF8String(nsACString &_str)
   {
-    return variant_text_traits<DataType, Adopting>::asUTF8String(mData, _str);
+    return variant_text_traits<DataType>::asUTF8String(mData, _str);
   }
 
   NS_IMETHOD GetAsAString(nsAString &_str)
   {
-    return variant_text_traits<DataType, Adopting>::asString(mData, _str);
+    return variant_text_traits<DataType>::asString(mData, _str);
   }
 
   NS_IMETHOD GetAsArray(uint16_t *_type,
                         nsIID *,
                         uint32_t *_size,
                         void **_data)
   {
-    return variant_blob_traits<DataType, Adopting>::asArray(mData, _type, _size, _data);
+    return variant_blob_traits<DataType>::asArray(mData, _type, _size, _data);
   }
 
 private:
-  typename variant_storage_traits<DataType, Adopting>::StorageType mData;
+  typename variant_storage_traits<DataType>::StorageType mData;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Handy typedefs!  Use these for the right mapping.
 
 typedef Variant<int64_t> IntegerVariant;
 typedef Variant<double> FloatVariant;
 typedef Variant<nsString> TextVariant;
 typedef Variant<nsCString> UTF8TextVariant;
-typedef Variant<uint8_t[], false> BlobVariant;
-typedef Variant<uint8_t[], true> AdoptedBlobVariant;
+typedef Variant<uint8_t[]> BlobVariant;
 
 } // namespace storage
 } // namespace mozilla
 
 #include "Variant_inl.h"
 
 #endif // mozilla_storage_Variant_h__
--- a/storage/src/mozStorageBindingParams.cpp
+++ b/storage/src/mozStorageBindingParams.cpp
@@ -349,32 +349,16 @@ BindingParams::BindBlobByName(const nsAC
     int(aValueSize)
   );
   nsCOMPtr<nsIVariant> value(new BlobVariant(data));
   NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY);
 
   return BindByName(aName, value);
 }
 
-
-NS_IMETHODIMP
-BindingParams::BindAdoptedBlobByName(const nsACString &aName,
-                                     uint8_t *aValue,
-                                     uint32_t aValueSize)
-{
-  NS_ENSURE_ARG_MAX(aValueSize, INT_MAX);
-  std::pair<uint8_t *, int> data(
-    aValue,
-    int(aValueSize)
-  );
-  nsCOMPtr<nsIVariant> value(new AdoptedBlobVariant(data));
-
-  return BindByName(aName, value);
-}
-
 NS_IMETHODIMP
 BindingParams::BindByIndex(uint32_t aIndex,
                            nsIVariant *aValue)
 {
   NS_ENSURE_FALSE(mLocked, NS_ERROR_UNEXPECTED);
   ENSURE_INDEX_VALUE(aIndex, mParamCount);
 
   // Store the variant for later use.
@@ -467,25 +451,10 @@ BindingParams::BindBlobByIndex(uint32_t 
     int(aValueSize)
   );
   nsCOMPtr<nsIVariant> value(new BlobVariant(data));
   NS_ENSURE_TRUE(value, NS_ERROR_OUT_OF_MEMORY);
 
   return BindByIndex(aIndex, value);
 }
 
-NS_IMETHODIMP
-BindingParams::BindAdoptedBlobByIndex(uint32_t aIndex,
-                                      uint8_t *aValue,
-                                      uint32_t aValueSize)
-{
-  NS_ENSURE_ARG_MAX(aValueSize, INT_MAX);
-  std::pair<uint8_t *, int> data(
-    static_cast<uint8_t *>(aValue),
-    int(aValueSize)
-  );
-  nsCOMPtr<nsIVariant> value(new AdoptedBlobVariant(data));
-
-  return BindByIndex(aIndex, value);
-}
-
 } // namespace storage
 } // namespace mozilla