Bug 1620198 - Part 3: Change type of FunctionInfo::function to nsCOMPtr<mozIStorageFunction>. r=asuth

Differential Revision: https://phabricator.services.mozilla.com/D65507
This commit is contained in:
Simon Giesecke 2020-06-08 10:00:24 +00:00
Родитель 4fa00c14c3
Коммит 3628030e06
2 изменённых файлов: 4 добавлений и 6 удалений

Просмотреть файл

@ -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<mozIStorageFunction*>(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");
}

Просмотреть файл

@ -55,7 +55,7 @@ class Connection final : public mozIStorageConnection,
* Structure used to describe user functions on the database connection.
*/
struct FunctionInfo {
nsCOMPtr<nsISupports> function;
nsCOMPtr<mozIStorageFunction> 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