Commit 1e93329f authored by Nika Layzell's avatar Nika Layzell
Browse files

Bug 1522579 - Part 2: Remove consumers of nsIContentParent, r=mccr8

This patch tries to move them to `ContentParent` instead.

`ProcessPriorityManagerImpl::ObserveContentParentCreated` could not be moved
due to using `do_QueryInterface` to cast from a `nsISupports` down to the
`ContentParent` object. This could be fixed to remove the interfaces entirely,
but I left that for a follow-up.

Depends on D20549

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

--HG--
extra : moz-landing-system : lando
parent f3274c2f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -7252,7 +7252,7 @@ nsresult nsContentUtils::IPCTransferableToTransferable(
    nsIPrincipal* aRequestingPrincipal,
    const nsContentPolicyType& aContentPolicyType,
    nsITransferable* aTransferable,
    mozilla::dom::nsIContentParent* aContentParent,
    mozilla::dom::ContentParent* aContentParent,
    mozilla::dom::TabChild* aTabChild) {
  nsresult rv;

@@ -7314,7 +7314,7 @@ nsresult nsContentUtils::IPCTransferableToTransferable(
void nsContentUtils::TransferablesToIPCTransferables(
    nsIArray* aTransferables, nsTArray<IPCDataTransfer>& aIPC,
    bool aInSyncMessage, mozilla::dom::nsIContentChild* aChild,
    mozilla::dom::nsIContentParent* aParent) {
    mozilla::dom::ContentParent* aParent) {
  aIPC.Clear();
  if (aTransferables) {
    uint32_t transferableCount = 0;
@@ -7447,7 +7447,7 @@ bool nsContentUtils::IsFlavorImage(const nsACString& aFlavor) {
}

static Shmem ConvertToShmem(mozilla::dom::nsIContentChild* aChild,
                            mozilla::dom::nsIContentParent* aParent,
                            mozilla::dom::ContentParent* aParent,
                            const nsACString& aInput) {
  MOZ_ASSERT((aChild && !aParent) || (!aChild && aParent));

@@ -7468,7 +7468,7 @@ static Shmem ConvertToShmem(mozilla::dom::nsIContentChild* aChild,
void nsContentUtils::TransferableToIPCTransferable(
    nsITransferable* aTransferable, IPCDataTransfer* aIPCDataTransfer,
    bool aInSyncMessage, mozilla::dom::nsIContentChild* aChild,
    mozilla::dom::nsIContentParent* aParent) {
    mozilla::dom::ContentParent* aParent) {
  MOZ_ASSERT((aChild && !aParent) || (!aChild && aParent));

  if (aTransferable) {
+4 −4
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ struct LifecycleAdoptedCallbackArgs;
class MessageBroadcaster;
class NodeInfo;
class nsIContentChild;
class nsIContentParent;
class ContentParent;
class TabChild;
class Selection;
class TabParent;
@@ -2833,19 +2833,19 @@ class nsContentUtils {
      const bool& aIsPrivateData, nsIPrincipal* aRequestingPrincipal,
      const nsContentPolicyType& aContentPolicyType,
      nsITransferable* aTransferable,
      mozilla::dom::nsIContentParent* aContentParent,
      mozilla::dom::ContentParent* aContentParent,
      mozilla::dom::TabChild* aTabChild);

  static void TransferablesToIPCTransferables(
      nsIArray* aTransferables, nsTArray<mozilla::dom::IPCDataTransfer>& aIPC,
      bool aInSyncMessage, mozilla::dom::nsIContentChild* aChild,
      mozilla::dom::nsIContentParent* aParent);
      mozilla::dom::ContentParent* aParent);

  static void TransferableToIPCTransferable(
      nsITransferable* aTransferable,
      mozilla::dom::IPCDataTransfer* aIPCDataTransfer, bool aInSyncMessage,
      mozilla::dom::nsIContentChild* aChild,
      mozilla::dom::nsIContentParent* aParent);
      mozilla::dom::ContentParent* aParent);

  /*
   * Get the pixel data from the given source surface and return it as a buffer.
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#include "nsGkAtoms.h"
#include "nsGlobalWindow.h"
#include "nsContentUtils.h"
#include "nsIContentParent.h"
#include "ContentParent.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMChromeWindow.h"
#include "nsIHTMLDocument.h"
+1 −1
Original line number Diff line number Diff line
@@ -2730,7 +2730,7 @@ nsresult nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
  TabParent* tabParent = mRemoteBrowser;
  if (tabParent) {
    ClonedMessageData data;
    nsIContentParent* cp = tabParent->Manager();
    ContentParent* cp = tabParent->Manager();
    if (!BuildClonedMessageDataForParent(cp, aData, data)) {
      MOZ_CRASH();
      return NS_ERROR_DOM_DATA_CLONE_ERR;
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ void MessageManagerCallback::DoGetRemoteType(nsAString& aRemoteType,
}

bool MessageManagerCallback::BuildClonedMessageDataForParent(
    nsIContentParent* aParent, StructuredCloneData& aData,
    ContentParent* aParent, StructuredCloneData& aData,
    ClonedMessageData& aClonedData) {
  return aData.BuildClonedMessageDataForParent(aParent, aClonedData);
}
Loading