Commit 2d8c4390 authored by Simon Giesecke's avatar Simon Giesecke
Browse files

Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning...

Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika

Differential Revision: https://phabricator.services.mozilla.com/D71300
parent 9a017967
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -673,7 +673,7 @@ bool BrowsingContext::HasOpener() const {
}

void BrowsingContext::GetChildren(Children& aChildren) {
  MOZ_ALWAYS_TRUE(aChildren.AppendElements(mChildren));
  aChildren.AppendElements(mChildren);
}

void BrowsingContext::GetWindowContexts(
+1 −3
Original line number Diff line number Diff line
@@ -12062,9 +12062,7 @@ nsresult Document::ScheduleFrameRequestCallback(FrameRequestCallback& aCallback,
  }
  int32_t newHandle = ++mFrameRequestCallbackCounter;
  DebugOnly<FrameRequest*> request =
  mFrameRequestCallbacks.AppendElement(FrameRequest(aCallback, newHandle));
  NS_ASSERTION(request, "This is supposed to be infallible!");
  UpdateFrameRequestCallbackSchedulingState();
  *aHandle = newHandle;
+17 −18
Original line number Diff line number Diff line
@@ -10025,14 +10025,14 @@ struct CommonPopulateResponseHelper {
  }
  template <typename Response>
  void FillKeys(Response* const aResponse) {
  void FillKeys(Response& aResponse) {
    MOZ_ASSERT(!mPosition.IsUnset());
    aResponse->key() = std::move(mPosition);
    aResponse.key() = std::move(mPosition);
  }
  template <typename Response>
  static size_t GetKeySize(const Response* const aResponse) {
    return aResponse->key().GetBuffer().Length();
  static size_t GetKeySize(const Response& aResponse) {
    return aResponse.key().GetBuffer().Length();
  }
 protected:
@@ -10075,20 +10075,20 @@ struct IndexPopulateResponseHelper : CommonPopulateResponseHelper {
  }
  template <typename Response>
  void FillKeys(Response* const aResponse) {
  void FillKeys(Response& aResponse) {
    MOZ_ASSERT(!mLocaleAwarePosition.IsUnset());
    MOZ_ASSERT(!mObjectStorePosition.IsUnset());
    CommonPopulateResponseHelper::FillKeys(aResponse);
    aResponse->sortKey() = std::move(mLocaleAwarePosition);
    aResponse->objectKey() = std::move(mObjectStorePosition);
    aResponse.sortKey() = std::move(mLocaleAwarePosition);
    aResponse.objectKey() = std::move(mObjectStorePosition);
  }
  template <typename Response>
  static size_t GetKeySize(const Response* const aResponse) {
  static size_t GetKeySize(Response& aResponse) {
    return CommonPopulateResponseHelper::GetKeySize(aResponse) +
           aResponse->sortKey().GetBuffer().Length() +
           aResponse->objectKey().GetBuffer().Length();
           aResponse.sortKey().GetBuffer().Length() +
           aResponse.objectKey().GetBuffer().Length();
  }
 private:
@@ -10102,12 +10102,11 @@ struct KeyPopulateResponseHelper {
  }
  template <typename Response>
  static constexpr void MaybeFillCloneInfo(Response* const /*aResponse*/,
  static constexpr void MaybeFillCloneInfo(Response& /*aResponse*/,
                                           FilesArray* const /*aFiles*/) {}
  template <typename Response>
  static constexpr size_t MaybeGetCloneInfoSize(
      const Response* const /*aResponse*/) {
  static constexpr size_t MaybeGetCloneInfoSize(const Response& /*aResponse*/) {
    return 0;
  }
};
@@ -10138,15 +10137,15 @@ struct ValuePopulateResponseHelper {
  }
  template <typename Response>
  void MaybeFillCloneInfo(Response* const aResponse, FilesArray* const aFiles) {
  void MaybeFillCloneInfo(Response& aResponse, FilesArray* const aFiles) {
    auto cloneInfo = mCloneInfo.release();
    aResponse->cloneInfo().data().data = cloneInfo.ReleaseData();
    aResponse.cloneInfo().data().data = cloneInfo.ReleaseData();
    aFiles->AppendElement(cloneInfo.ReleaseFiles());
  }
  template <typename Response>
  static size_t MaybeGetCloneInfoSize(const Response* const aResponse) {
    return aResponse->cloneInfo().data().data.Size();
  static size_t MaybeGetCloneInfoSize(const Response& aResponse) {
    return aResponse.cloneInfo().data().data.Size();
  }
 private:
@@ -26744,7 +26743,7 @@ CursorOpBaseHelperBase<CursorType>::PopulateResponseFromStatement(
  }
  auto& responses = populateResponseHelper.GetTypedResponse(&mOp.mResponse);
  auto* response = responses.AppendElement();
  auto& response = *responses.AppendElement();
  populateResponseHelper.FillKeys(response);
  if constexpr (!CursorTypeTraits<CursorType>::IsKeyOnlyCursor) {
+3 −3
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ JSWindowActorProtocol::FromIPC(const JSWindowActorInfo& aInfo) {

  proto->mChild.mEvents.SetCapacity(aInfo.events().Length());
  for (auto& ipc : aInfo.events()) {
    auto* event = proto->mChild.mEvents.AppendElement();
    auto event = proto->mChild.mEvents.AppendElement();
    event->mName.Assign(ipc.name());
    event->mFlags.mCapture = ipc.capture();
    event->mFlags.mInSystemGroup = ipc.systemGroup();
@@ -79,7 +79,7 @@ JSWindowActorInfo JSWindowActorProtocol::ToIPC() {

  info.events().SetCapacity(mChild.mEvents.Length());
  for (auto& event : mChild.mEvents) {
    auto* ipc = info.events().AppendElement();
    auto ipc = info.events().AppendElement();
    ipc->name().Assign(event.mName);
    ipc->capture() = event.mFlags.mCapture;
    ipc->systemGroup() = event.mFlags.mInSystemGroup;
@@ -312,7 +312,7 @@ extensions::MatchPatternSet* JSWindowActorProtocol::GetURIMatcher() {
  nsTArray<OwningStringOrMatchPattern> patterns;
  patterns.SetCapacity(mMatches.Length());
  for (nsString& s : mMatches) {
    auto* entry = patterns.AppendElement();
    auto entry = patterns.AppendElement();
    entry->SetAsString() = s;
  }

+1 −3
Original line number Diff line number Diff line
@@ -381,9 +381,7 @@ int32_t XRSession::RequestAnimationFrame(XRFrameRequestCallback& aCallback,

  int32_t handle = ++mFrameRequestCallbackCounter;

  DebugOnly<XRFrameRequest*> request =
  mFrameRequestCallbacks.AppendElement(XRFrameRequest(aCallback, handle));
  NS_ASSERTION(request, "This is supposed to be infallible!");

  return handle;
}
Loading