diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index 7d6895736f26..c4c3be68e7dd 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -847,7 +847,7 @@ nsresult Connection::databaseElementExists( return convertResultCode(srv); } -bool Connection::findFunctionByInstance(nsISupports* aInstance) { +bool Connection::findFunctionByInstance(mozIStorageFunction* aInstance) { sharedDBMutex.assertCurrentThreadOwns(); for (auto iter = mFunctions.Iter(); !iter.Done(); iter.Next()) { @@ -1545,9 +1545,7 @@ nsresult Connection::initializeClone(Connection* aClone, bool aReadOnly) { const nsACString& key = iter.Key(); Connection::FunctionInfo data = iter.UserData(); - mozIStorageFunction* function = - static_cast(data.function.get()); - rv = aClone->CreateFunction(key, data.numArgs, function); + rv = aClone->CreateFunction(key, data.numArgs, data.function); if (NS_FAILED(rv)) { NS_WARNING("Failed to copy function to cloned connection"); } diff --git a/storage/mozStorageConnection.h b/storage/mozStorageConnection.h index 9f4db99a89c4..837a9c9bde9c 100644 --- a/storage/mozStorageConnection.h +++ b/storage/mozStorageConnection.h @@ -55,7 +55,7 @@ class Connection final : public mozIStorageConnection, * Structure used to describe user functions on the database connection. */ struct FunctionInfo { - nsCOMPtr function; + nsCOMPtr function; int32_t numArgs; }; @@ -350,7 +350,7 @@ class Connection final : public mozIStorageConnection, nsresult databaseElementExists(enum DatabaseElementType aElementType, const nsACString& aElementName, bool* _exists); - bool findFunctionByInstance(nsISupports* aInstance); + bool findFunctionByInstance(mozIStorageFunction* aInstance); static int sProgressHelper(void* aArg); // Generic progress handler