Skip to content

Commit

Permalink
Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asut…
Browse files Browse the repository at this point in the history
…h,necko-reviewers,kershaw

This interface should no longer be required due to the changes in part 1
limiting the complexity of IPCStream instances and limiting the number of file
descriptors which a single stream can attach to a message.

Removing this interface is necessary to serialize nsIInputStream instances over
arbitrary toplevel protocols and non-protocol IPC in the future.

Differential Revision: https://phabricator.services.mozilla.com/D141039
  • Loading branch information
mystor committed May 5, 2022
1 parent 3ef777a commit 0308ac1
Show file tree
Hide file tree
Showing 66 changed files with 20 additions and 612 deletions.
1 change: 0 additions & 1 deletion accessible/ipc/other/PDocAccessible.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PFileDescriptorSet;
include protocol PBrowser;
include protocol PDocAccessiblePlatformExt;

Expand Down
1 change: 0 additions & 1 deletion accessible/ipc/win/PDocAccessible.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PFileDescriptorSet;
include protocol PBrowser;

include DocAccessibleTypes;
Expand Down
1 change: 0 additions & 1 deletion dom/broadcastchannel/PBroadcastChannel.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBackground;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include DOMTypes;
Expand Down
2 changes: 0 additions & 2 deletions dom/cache/CacheOpParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
#include "mozilla/dom/cache/ManagerId.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/dom/cache/SavedTypes.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/ipc/IPCStreamUtils.h"

namespace mozilla::dom::cache {

using mozilla::ipc::FileDescriptorSetParent;
using mozilla::ipc::PBackgroundParent;

CacheOpParent::CacheOpParent(PBackgroundParent* aIpcManager, CacheId aCacheId,
Expand Down
5 changes: 0 additions & 5 deletions dom/cache/CacheStreamControlChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/CacheWorkerRef.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ipc/FileDescriptorSetChild.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "nsISupportsImpl.h"

namespace mozilla::dom::cache {

using mozilla::dom::OptionalFileDescriptorSet;
using mozilla::ipc::AutoIPCStream;
using mozilla::ipc::FileDescriptor;
using mozilla::ipc::FileDescriptorSetChild;
using mozilla::ipc::PFileDescriptorSetChild;

// declared in ActorUtils.h
already_AddRefed<PCacheStreamControlChild> AllocPCacheStreamControlChild() {
Expand Down
5 changes: 0 additions & 5 deletions dom/cache/CacheStreamControlParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/dom/cache/StreamList.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PFileDescriptorSetParent.h"
#include "nsISupportsImpl.h"
#include "nsTArray.h"

namespace mozilla::dom::cache {

using mozilla::dom::OptionalFileDescriptorSet;
using mozilla::ipc::AutoIPCStream;
using mozilla::ipc::FileDescriptor;
using mozilla::ipc::FileDescriptorSetParent;
using mozilla::ipc::PFileDescriptorSetParent;

// declared in ActorUtils.h
void DeallocPCacheStreamControlParent(PCacheStreamControlParent* aActor) {
Expand Down
1 change: 0 additions & 1 deletion dom/cache/PCache.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include protocol PBackground;
include protocol PCacheOp;
include protocol PCacheStreamControl;
include protocol PFileDescriptorSet;

include CacheTypes;

Expand Down
1 change: 0 additions & 1 deletion dom/cache/PCacheOp.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include protocol PCache;
include protocol PCacheStorage;
include protocol PCacheStreamControl;
include protocol PFileDescriptorSet;

include CacheTypes;

Expand Down
1 change: 0 additions & 1 deletion dom/cache/PCacheStorage.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include protocol PBackground;
include protocol PCache;
include protocol PCacheOp;
include protocol PCacheStreamControl;
include protocol PFileDescriptorSet;

include CacheTypes;

Expand Down
1 change: 0 additions & 1 deletion dom/cache/PCacheStreamControl.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBackground;
include protocol PFileDescriptorSet;
include IPCStream;

using struct nsID from "nsID.h";
Expand Down
2 changes: 0 additions & 2 deletions dom/cache/TypeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsCOMPtr.h"
Expand All @@ -38,7 +37,6 @@ using mozilla::ipc::AutoIPCStream;
using mozilla::ipc::BackgroundChild;
using mozilla::ipc::FileDescriptor;
using mozilla::ipc::PBackgroundChild;
using mozilla::ipc::PFileDescriptorSetChild;

namespace {

Expand Down
1 change: 0 additions & 1 deletion dom/clients/manager/PClientHandle.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

include protocol PClientManager;
include protocol PClientHandleOp;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;
include ClientIPCTypes;

Expand Down
1 change: 0 additions & 1 deletion dom/clients/manager/PClientManager.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include protocol PClientHandle;
include protocol PClientManagerOp;
include protocol PClientNavigateOp;
include protocol PClientSource;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;
include ClientIPCTypes;

Expand Down
1 change: 0 additions & 1 deletion dom/clients/manager/PClientSource.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

include protocol PClientManager;
include protocol PClientSourceOp;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;
include ClientIPCTypes;

Expand Down
22 changes: 0 additions & 22 deletions dom/file/ipc/BlobTypes.ipdlh

This file was deleted.

1 change: 0 additions & 1 deletion dom/file/ipc/PFileCreator.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBackground;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;

include IPCBlob;
Expand Down
1 change: 0 additions & 1 deletion dom/file/ipc/PRemoteLazyInputStream.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

include protocol PBackground;
include protocol PContent;
include protocol PFileDescriptorSet;
include protocol PSocketProcess;

include IPCStream;
Expand Down
1 change: 0 additions & 1 deletion dom/file/ipc/PTemporaryIPCBlob.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBackground;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;

include IPCBlob;
Expand Down
1 change: 0 additions & 1 deletion dom/file/ipc/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ UNIFIED_SOURCES += [
]

IPDL_SOURCES += [
"BlobTypes.ipdlh",
"IPCBlob.ipdlh",
"PFileCreator.ipdl",
"PRemoteLazyInputStream.ipdl",
Expand Down
1 change: 0 additions & 1 deletion dom/filehandle/PBackgroundFileHandle.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

include protocol PBackgroundFileRequest;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include IPCBlob;
Expand Down
1 change: 0 additions & 1 deletion dom/filesystem/PFileSystemRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

include protocol PBackground;
include protocol PFileDescriptorSet;
include protocol PRemoteLazyInputStream;

include IPCBlob;
Expand Down
1 change: 0 additions & 1 deletion dom/indexedDB/PBackgroundIDBCursor.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include protocol PBackgroundIDBTransaction;
include protocol PBackgroundIDBVersionChangeTransaction;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include PBackgroundIDBSharedTypes;
Expand Down
1 change: 0 additions & 1 deletion dom/indexedDB/PBackgroundIDBDatabase.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ include protocol PBackgroundIDBFactory;
include protocol PBackgroundIDBTransaction;
include protocol PBackgroundIDBVersionChangeTransaction;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include IPCBlob;
Expand Down
1 change: 0 additions & 1 deletion dom/indexedDB/PBackgroundIDBRequest.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include protocol PBackgroundIDBTransaction;
include protocol PBackgroundIDBVersionChangeTransaction;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include PBackgroundIDBSharedTypes;
Expand Down
1 change: 0 additions & 1 deletion dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

include protocol PBackgroundIDBDatabaseFile;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include DOMTypes;
Expand Down
1 change: 0 additions & 1 deletion dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ include protocol PBackgroundIDBDatabase;
include protocol PBackgroundIDBDatabaseFile;
include protocol PBackgroundIDBRequest;
include protocol PBackgroundMutableFile;
include protocol PFileDescriptorSet; // FIXME: bug 792908
include protocol PRemoteLazyInputStream; // FIXME: bug 792908

include PBackgroundIDBSharedTypes;
Expand Down
23 changes: 0 additions & 23 deletions dom/ipc/ContentChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
#include "mozilla/intl/LocaleService.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/FileDescriptorSetChild.h"
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/ipc/ProcessChild.h"
Expand Down Expand Up @@ -1879,28 +1878,6 @@ void ContentChild::GetAvailableDictionaries(
aDictionaries = mAvailableDictionaries.Clone();
}

PFileDescriptorSetChild* ContentChild::SendPFileDescriptorSetConstructor(
const FileDescriptor& aFD) {
MOZ_ASSERT(NS_IsMainThread());

if (IsShuttingDown()) {
return nullptr;
}

return PContentChild::SendPFileDescriptorSetConstructor(aFD);
}

PFileDescriptorSetChild* ContentChild::AllocPFileDescriptorSetChild(
const FileDescriptor& aFD) {
return new FileDescriptorSetChild(aFD);
}

bool ContentChild::DeallocPFileDescriptorSetChild(
PFileDescriptorSetChild* aActor) {
delete static_cast<FileDescriptorSetChild*>(aActor);
return true;
}

already_AddRefed<PRemoteLazyInputStreamChild>
ContentChild::AllocPRemoteLazyInputStreamChild(const nsID& aID,
const uint64_t& aSize) {
Expand Down
12 changes: 0 additions & 12 deletions dom/ipc/ContentChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ class RemoteSpellcheckEngineChild;
class ChildProfilerController;
class BenchmarkStorageChild;

namespace ipc {
class PFileDescriptorSetChild;
} // namespace ipc

namespace loader {
class PScriptCacheChild;
}
Expand Down Expand Up @@ -76,7 +72,6 @@ class ContentChild final : public PContentChild,
public ProcessActor {
using ClonedMessageData = mozilla::dom::ClonedMessageData;
using FileDescriptor = mozilla::ipc::FileDescriptor;
using PFileDescriptorSetChild = mozilla::ipc::PFileDescriptorSetChild;

friend class PContentChild;

Expand Down Expand Up @@ -466,10 +461,6 @@ class ContentChild final : public PContentChild,

bool IsForBrowser() const { return mIsForBrowser; }

PFileDescriptorSetChild* AllocPFileDescriptorSetChild(const FileDescriptor&);

bool DeallocPFileDescriptorSetChild(PFileDescriptorSetChild*);

MOZ_CAN_RUN_SCRIPT_BOUNDARY mozilla::ipc::IPCResult RecvConstructBrowser(
ManagedEndpoint<PBrowserChild>&& aBrowserEp,
ManagedEndpoint<PWindowGlobalChild>&& aWindowEp, const TabId& aTabId,
Expand Down Expand Up @@ -647,9 +638,6 @@ class ContentChild final : public PContentChild,
Endpoint<PSandboxTestingChild>&& aEndpoint);
#endif

PFileDescriptorSetChild* SendPFileDescriptorSetConstructor(
const FileDescriptor& aFD) override;

private:
static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure);
void StartForceKillTimer();
Expand Down
18 changes: 0 additions & 18 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
#include "mozilla/ipc/ByteBuf.h"
#include "mozilla/ipc/CrashReporterHost.h"
#include "mozilla/ipc/Endpoint.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/TestShellParent.h"
Expand Down Expand Up @@ -5012,17 +5011,6 @@ ContentParent::AllocPExtensionsParent() {
return MakeAndAddRef<extensions::ExtensionsParent>();
}

PFileDescriptorSetParent* ContentParent::AllocPFileDescriptorSetParent(
const FileDescriptor& aFD) {
return new FileDescriptorSetParent(aFD);
}

bool ContentParent::DeallocPFileDescriptorSetParent(
PFileDescriptorSetParent* aActor) {
delete static_cast<FileDescriptorSetParent*>(aActor);
return true;
}

void ContentParent::NotifyUpdatedDictionaries() {
RefPtr<mozSpellChecker> spellChecker(mozSpellChecker::Create());
MOZ_ASSERT(spellChecker, "No spell checker?");
Expand Down Expand Up @@ -7244,12 +7232,6 @@ mozilla::ipc::IPCResult ContentParent::RecvCommitBrowsingContextTransaction(
return aTransaction.CommitFromIPC(aContext, this);
}

PFileDescriptorSetParent* ContentParent::SendPFileDescriptorSetConstructor(
const FileDescriptor& aFD) {
MOZ_ASSERT(NS_IsMainThread());
return PContentParent::SendPFileDescriptorSetConstructor(aFD);
}

mozilla::ipc::IPCResult ContentParent::RecvBlobURLDataRequest(
const nsCString& aBlobURL, nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aLoadingPrincipal, const OriginAttributes& aOriginAttributes,
Expand Down
Loading

0 comments on commit 0308ac1

Please sign in to comment.