Commit 32c9aeaa authored by Simon Giesecke's avatar Simon Giesecke
Browse files

Bug 1617542 - Remove nsRefPtrHashtable::Put overload accepting...

Bug 1617542 - Remove nsRefPtrHashtable::Put overload accepting already_AddRefed and adapt all uses. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D63865

--HG--
extra : moz-landing-system : lando
parent 166369d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -963,7 +963,7 @@ void CustomElementRegistry::Define(
      disableInternals, disableShadow);

  CustomElementDefinition* def = definition.get();
  mCustomDefinitions.Put(nameAtom, definition.forget());
  mCustomDefinitions.Put(nameAtom, std::move(definition));

  MOZ_ASSERT(mCustomDefinitions.Count() == mConstructors.count(),
             "Number of entries should be the same");
@@ -1022,7 +1022,7 @@ void CustomElementRegistry::SetElementCreationCallback(
  }

  RefPtr<CustomElementCreationCallback> callback = &aCallback;
  mElementCreationCallbacks.Put(nameAtom, callback.forget());
  mElementCreationCallbacks.Put(nameAtom, std::move(callback));
}

void CustomElementRegistry::Upgrade(nsINode& aRoot) {
+1 −1
Original line number Diff line number Diff line
@@ -11410,7 +11410,7 @@ void Document::MaybePreLoadImage(nsIURI* uri, const nsAString& aCrossOriginAttr,
  // the "real" load occurs. Unpinned in DispatchContentLoadedEvents and
  // unlink
  if (NS_SUCCEEDED(rv)) {
    mPreloadingImages.Put(uri, request.forget());
    mPreloadingImages.Put(uri, std::move(request));
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -12870,7 +12870,7 @@ RefPtr<FullDatabaseMetadata> FullDatabaseMetadata::Duplicate() const {
      newIndexMetadata->mCommonMetadata = value->mCommonMetadata;
      if (NS_WARN_IF(!newOSMetadata->mIndexes.Put(
              indexEntry.GetKey(), newIndexMetadata.forget(), fallible))) {
              indexEntry.GetKey(), std::move(newIndexMetadata), fallible))) {
        return nullptr;
      }
    }
@@ -12879,7 +12879,7 @@ RefPtr<FullDatabaseMetadata> FullDatabaseMetadata::Duplicate() const {
               newOSMetadata->mIndexes.Count());
    if (NS_WARN_IF(!newMetadata->mObjectStores.Put(
            objectStoreEntry.GetKey(), newOSMetadata.forget(), fallible))) {
            objectStoreEntry.GetKey(), std::move(newOSMetadata), fallible))) {
      return nullptr;
    }
  }
+2 −2
Original line number Diff line number Diff line
@@ -2772,7 +2772,7 @@ RefPtr<MediaManager::StreamPromise> MediaManager::GetUserMedia(
                focusSource);

            // Store the task w/callbacks.
            self->mActiveCallbacks.Put(callID, task.forget());
            self->mActiveCallbacks.Put(callID, std::move(task));

            // Add a WindowID cross-reference so OnNavigation can tear
            // things down
@@ -3396,7 +3396,7 @@ void MediaManager::AddWindowID(uint64_t aWindowId,
    return;
  }

  GetActiveWindows()->Put(aWindowId, aListener.forget());
  GetActiveWindows()->Put(aWindowId, std::move(aListener));
}

void MediaManager::RemoveWindowID(uint64_t aWindowId) {
+1 −3
Original line number Diff line number Diff line
@@ -3319,9 +3319,7 @@ void nsPermissionManager::WhenPermissionsAvailable(nsIPrincipal* aPrincipal,
      // promise, and send the request to the parent (if we have not already
      // done so).
      promise = new GenericNonExclusivePromise::Private(__func__);
      mPermissionKeyPromiseMap.Put(
          pair.first(),
          RefPtr<GenericNonExclusivePromise::Private>(promise).forget());
      mPermissionKeyPromiseMap.Put(pair.first(), promise);
    }

    if (promise) {
Loading