From 2b307c5ceae0e081aed98595280dda251d6ef245 Mon Sep 17 00:00:00 2001 From: Nika Layzell Date: Fri, 13 May 2022 14:16:09 +0000 Subject: [PATCH] Bug 1754004 - Part 2: Remove the PFileDescriptorSet interface, r=asuth,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 --- accessible/ipc/other/PDocAccessible.ipdl | 1 - accessible/ipc/win/PDocAccessible.ipdl | 1 - dom/broadcastchannel/PBroadcastChannel.ipdl | 1 - dom/cache/CacheOpParent.cpp | 2 - dom/cache/CacheStreamControlChild.cpp | 5 - dom/cache/CacheStreamControlParent.cpp | 5 - dom/cache/PCache.ipdl | 1 - dom/cache/PCacheOp.ipdl | 1 - dom/cache/PCacheStorage.ipdl | 1 - dom/cache/PCacheStreamControl.ipdl | 1 - dom/cache/TypeUtils.cpp | 2 - dom/clients/manager/PClientHandle.ipdl | 1 - dom/clients/manager/PClientManager.ipdl | 1 - dom/clients/manager/PClientSource.ipdl | 1 - dom/file/ipc/BlobTypes.ipdlh | 22 ---- dom/file/ipc/PFileCreator.ipdl | 1 - dom/file/ipc/PRemoteLazyInputStream.ipdl | 1 - dom/file/ipc/PTemporaryIPCBlob.ipdl | 1 - dom/file/ipc/moz.build | 1 - dom/filehandle/PBackgroundFileHandle.ipdl | 1 - dom/filesystem/PFileSystemRequest.ipdl | 1 - dom/indexedDB/PBackgroundIDBCursor.ipdl | 1 - dom/indexedDB/PBackgroundIDBDatabase.ipdl | 1 - dom/indexedDB/PBackgroundIDBRequest.ipdl | 1 - dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh | 1 - ...BackgroundIDBVersionChangeTransaction.ipdl | 1 - dom/ipc/ContentChild.cpp | 23 ---- dom/ipc/ContentChild.h | 12 -- dom/ipc/ContentParent.cpp | 18 --- dom/ipc/ContentParent.h | 10 -- dom/ipc/PBrowser.ipdl | 1 - dom/ipc/PContent.ipdl | 4 - dom/ipc/PFilePicker.ipdl | 1 - dom/messagechannel/PMessagePort.ipdl | 1 - dom/network/PUDPSocket.ipdl | 1 - .../PWebBrowserPersistDocument.ipdl | 1 - ipc/glue/BackgroundChildImpl.cpp | 19 --- ipc/glue/BackgroundChildImpl.h | 9 -- ipc/glue/BackgroundParentImpl.cpp | 25 ---- ipc/glue/BackgroundParentImpl.h | 10 -- ipc/glue/FileDescriptorSetChild.cpp | 31 ----- ipc/glue/FileDescriptorSetChild.h | 56 --------- ipc/glue/FileDescriptorSetParent.cpp | 33 ----- ipc/glue/FileDescriptorSetParent.h | 58 --------- ipc/glue/IPCStream.ipdlh | 2 - ipc/glue/IPCStreamUtils.cpp | 117 +----------------- ipc/glue/InputStreamParams.ipdlh | 2 +- ipc/glue/InputStreamUtils.h | 18 +-- ipc/glue/PBackground.ipdl | 4 - ipc/glue/PFileDescriptorSet.ipdl | 24 ---- ipc/glue/moz.build | 5 - netwerk/base/nsFileStreams.cpp | 25 ++-- netwerk/base/nsFileStreams.h | 3 +- netwerk/base/nsSyncStreamListener.cpp | 1 + netwerk/base/nsUDPSocket.cpp | 1 + netwerk/ipc/NeckoChannelParams.ipdlh | 1 - netwerk/ipc/PNecko.ipdl | 1 - netwerk/ipc/PSocketProcess.ipdl | 3 - netwerk/ipc/SocketProcessChild.cpp | 18 --- netwerk/ipc/SocketProcessChild.h | 6 - netwerk/ipc/SocketProcessParent.cpp | 19 --- netwerk/ipc/SocketProcessParent.h | 7 -- netwerk/protocol/http/HttpChannelChild.cpp | 1 - netwerk/protocol/http/HttpChannelParent.cpp | 1 - netwerk/protocol/http/PHttpTransaction.ipdl | 1 - netwerk/protocol/websocket/PWebSocket.ipdl | 2 - 66 files changed, 20 insertions(+), 612 deletions(-) delete mode 100644 dom/file/ipc/BlobTypes.ipdlh delete mode 100644 ipc/glue/FileDescriptorSetChild.cpp delete mode 100644 ipc/glue/FileDescriptorSetChild.h delete mode 100644 ipc/glue/FileDescriptorSetParent.cpp delete mode 100644 ipc/glue/FileDescriptorSetParent.h delete mode 100644 ipc/glue/PFileDescriptorSet.ipdl diff --git a/accessible/ipc/other/PDocAccessible.ipdl b/accessible/ipc/other/PDocAccessible.ipdl index 3c2fa114dd5d..e37b6228809c 100644 --- a/accessible/ipc/other/PDocAccessible.ipdl +++ b/accessible/ipc/other/PDocAccessible.ipdl @@ -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; diff --git a/accessible/ipc/win/PDocAccessible.ipdl b/accessible/ipc/win/PDocAccessible.ipdl index 8672c8a4d8d3..8d9a1fb30dc0 100644 --- a/accessible/ipc/win/PDocAccessible.ipdl +++ b/accessible/ipc/win/PDocAccessible.ipdl @@ -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; diff --git a/dom/broadcastchannel/PBroadcastChannel.ipdl b/dom/broadcastchannel/PBroadcastChannel.ipdl index 2e52442c463b..11c050b975a1 100644 --- a/dom/broadcastchannel/PBroadcastChannel.ipdl +++ b/dom/broadcastchannel/PBroadcastChannel.ipdl @@ -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; diff --git a/dom/cache/CacheOpParent.cpp b/dom/cache/CacheOpParent.cpp index f5163147223f..2621540d0afa 100644 --- a/dom/cache/CacheOpParent.cpp +++ b/dom/cache/CacheOpParent.cpp @@ -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, diff --git a/dom/cache/CacheStreamControlChild.cpp b/dom/cache/CacheStreamControlChild.cpp index 72d165e0ce7b..aa9e3abe1b45 100644 --- a/dom/cache/CacheStreamControlChild.cpp +++ b/dom/cache/CacheStreamControlChild.cpp @@ -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 AllocPCacheStreamControlChild() { diff --git a/dom/cache/CacheStreamControlParent.cpp b/dom/cache/CacheStreamControlParent.cpp index 66d95c290fcb..0ee31da4db6d 100644 --- a/dom/cache/CacheStreamControlParent.cpp +++ b/dom/cache/CacheStreamControlParent.cpp @@ -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) { diff --git a/dom/cache/PCache.ipdl b/dom/cache/PCache.ipdl index 9da5e1424dcb..3f000cbf603e 100644 --- a/dom/cache/PCache.ipdl +++ b/dom/cache/PCache.ipdl @@ -5,7 +5,6 @@ include protocol PBackground; include protocol PCacheOp; include protocol PCacheStreamControl; -include protocol PFileDescriptorSet; include CacheTypes; diff --git a/dom/cache/PCacheOp.ipdl b/dom/cache/PCacheOp.ipdl index d090e0ec735c..f5101d04d691 100644 --- a/dom/cache/PCacheOp.ipdl +++ b/dom/cache/PCacheOp.ipdl @@ -5,7 +5,6 @@ include protocol PCache; include protocol PCacheStorage; include protocol PCacheStreamControl; -include protocol PFileDescriptorSet; include CacheTypes; diff --git a/dom/cache/PCacheStorage.ipdl b/dom/cache/PCacheStorage.ipdl index d3d2ccbfbe1c..17b524024cc8 100644 --- a/dom/cache/PCacheStorage.ipdl +++ b/dom/cache/PCacheStorage.ipdl @@ -6,7 +6,6 @@ include protocol PBackground; include protocol PCache; include protocol PCacheOp; include protocol PCacheStreamControl; -include protocol PFileDescriptorSet; include CacheTypes; diff --git a/dom/cache/PCacheStreamControl.ipdl b/dom/cache/PCacheStreamControl.ipdl index 41afab10ad7b..2d8a1aca05ce 100644 --- a/dom/cache/PCacheStreamControl.ipdl +++ b/dom/cache/PCacheStreamControl.ipdl @@ -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"; diff --git a/dom/cache/TypeUtils.cpp b/dom/cache/TypeUtils.cpp index 641f20d48bfd..d9137556fbc1 100644 --- a/dom/cache/TypeUtils.cpp +++ b/dom/cache/TypeUtils.cpp @@ -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" @@ -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 { diff --git a/dom/clients/manager/PClientHandle.ipdl b/dom/clients/manager/PClientHandle.ipdl index 4de5c9e5d68a..8e510f5bfb31 100644 --- a/dom/clients/manager/PClientHandle.ipdl +++ b/dom/clients/manager/PClientHandle.ipdl @@ -4,7 +4,6 @@ include protocol PClientManager; include protocol PClientHandleOp; -include protocol PFileDescriptorSet; include protocol PRemoteLazyInputStream; include ClientIPCTypes; diff --git a/dom/clients/manager/PClientManager.ipdl b/dom/clients/manager/PClientManager.ipdl index c1ad2f93da00..5fada12d573f 100644 --- a/dom/clients/manager/PClientManager.ipdl +++ b/dom/clients/manager/PClientManager.ipdl @@ -7,7 +7,6 @@ include protocol PClientHandle; include protocol PClientManagerOp; include protocol PClientNavigateOp; include protocol PClientSource; -include protocol PFileDescriptorSet; include protocol PRemoteLazyInputStream; include ClientIPCTypes; diff --git a/dom/clients/manager/PClientSource.ipdl b/dom/clients/manager/PClientSource.ipdl index c854debca41a..8bcf6e810640 100644 --- a/dom/clients/manager/PClientSource.ipdl +++ b/dom/clients/manager/PClientSource.ipdl @@ -4,7 +4,6 @@ include protocol PClientManager; include protocol PClientSourceOp; -include protocol PFileDescriptorSet; include protocol PRemoteLazyInputStream; include ClientIPCTypes; diff --git a/dom/file/ipc/BlobTypes.ipdlh b/dom/file/ipc/BlobTypes.ipdlh deleted file mode 100644 index 97baaf7b15d7..000000000000 --- a/dom/file/ipc/BlobTypes.ipdlh +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 "mozilla/ipc/ProtocolMessageUtils.h"; - -using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; - -namespace mozilla { -namespace dom { - -union OptionalFileDescriptorSet -{ - PFileDescriptorSet; - FileDescriptor[]; - void_t; -}; - -} -} diff --git a/dom/file/ipc/PFileCreator.ipdl b/dom/file/ipc/PFileCreator.ipdl index bb5e3a09415a..6fe7b5066460 100644 --- a/dom/file/ipc/PFileCreator.ipdl +++ b/dom/file/ipc/PFileCreator.ipdl @@ -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; diff --git a/dom/file/ipc/PRemoteLazyInputStream.ipdl b/dom/file/ipc/PRemoteLazyInputStream.ipdl index 05387c2b7013..a31cf7aa1cb4 100644 --- a/dom/file/ipc/PRemoteLazyInputStream.ipdl +++ b/dom/file/ipc/PRemoteLazyInputStream.ipdl @@ -4,7 +4,6 @@ include protocol PBackground; include protocol PContent; -include protocol PFileDescriptorSet; include protocol PSocketProcess; include IPCStream; diff --git a/dom/file/ipc/PTemporaryIPCBlob.ipdl b/dom/file/ipc/PTemporaryIPCBlob.ipdl index 01759d95fcd9..fd7f59c7aac5 100644 --- a/dom/file/ipc/PTemporaryIPCBlob.ipdl +++ b/dom/file/ipc/PTemporaryIPCBlob.ipdl @@ -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; diff --git a/dom/file/ipc/moz.build b/dom/file/ipc/moz.build index 4581c71cfa47..98cca8d77632 100644 --- a/dom/file/ipc/moz.build +++ b/dom/file/ipc/moz.build @@ -45,7 +45,6 @@ UNIFIED_SOURCES += [ ] IPDL_SOURCES += [ - "BlobTypes.ipdlh", "IPCBlob.ipdlh", "PFileCreator.ipdl", "PRemoteLazyInputStream.ipdl", diff --git a/dom/filehandle/PBackgroundFileHandle.ipdl b/dom/filehandle/PBackgroundFileHandle.ipdl index 1be9335ba4b5..0027fcfefceb 100644 --- a/dom/filehandle/PBackgroundFileHandle.ipdl +++ b/dom/filehandle/PBackgroundFileHandle.ipdl @@ -4,7 +4,6 @@ include protocol PBackgroundFileRequest; include protocol PBackgroundMutableFile; -include protocol PFileDescriptorSet; // FIXME: bug 792908 include protocol PRemoteLazyInputStream; // FIXME: bug 792908 include IPCBlob; diff --git a/dom/filesystem/PFileSystemRequest.ipdl b/dom/filesystem/PFileSystemRequest.ipdl index 26d95d3c1f2a..e79569167ea3 100644 --- a/dom/filesystem/PFileSystemRequest.ipdl +++ b/dom/filesystem/PFileSystemRequest.ipdl @@ -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; diff --git a/dom/indexedDB/PBackgroundIDBCursor.ipdl b/dom/indexedDB/PBackgroundIDBCursor.ipdl index 45763247f59d..2520b91687d9 100644 --- a/dom/indexedDB/PBackgroundIDBCursor.ipdl +++ b/dom/indexedDB/PBackgroundIDBCursor.ipdl @@ -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; diff --git a/dom/indexedDB/PBackgroundIDBDatabase.ipdl b/dom/indexedDB/PBackgroundIDBDatabase.ipdl index 91d2f4eae445..30a6e6cf8e85 100644 --- a/dom/indexedDB/PBackgroundIDBDatabase.ipdl +++ b/dom/indexedDB/PBackgroundIDBDatabase.ipdl @@ -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; diff --git a/dom/indexedDB/PBackgroundIDBRequest.ipdl b/dom/indexedDB/PBackgroundIDBRequest.ipdl index df8fece347b8..4591f285975f 100644 --- a/dom/indexedDB/PBackgroundIDBRequest.ipdl +++ b/dom/indexedDB/PBackgroundIDBRequest.ipdl @@ -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; diff --git a/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh b/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh index 551ffdb01f78..cd127e2dee9a 100644 --- a/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh +++ b/dom/indexedDB/PBackgroundIDBSharedTypes.ipdlh @@ -4,7 +4,6 @@ include protocol PBackgroundIDBDatabaseFile; include protocol PBackgroundMutableFile; -include protocol PFileDescriptorSet; // FIXME: bug 792908 include protocol PRemoteLazyInputStream; // FIXME: bug 792908 include DOMTypes; diff --git a/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl b/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl index 54aba1f33e2a..b2334a33113f 100644 --- a/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl +++ b/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl @@ -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; diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 86c56862a97e..a63f849e9099 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -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" @@ -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(aActor); - return true; -} - already_AddRefed ContentChild::AllocPRemoteLazyInputStreamChild(const nsID& aID, const uint64_t& aSize) { diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index f7f405fd06de..2b0b4c4ec783 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -45,10 +45,6 @@ class RemoteSpellcheckEngineChild; class ChildProfilerController; class BenchmarkStorageChild; -namespace ipc { -class PFileDescriptorSetChild; -} // namespace ipc - namespace loader { class PScriptCacheChild; } @@ -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; @@ -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&& aBrowserEp, ManagedEndpoint&& aWindowEp, const TabId& aTabId, @@ -647,9 +638,6 @@ class ContentChild final : public PContentChild, Endpoint&& aEndpoint); #endif - PFileDescriptorSetChild* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; - private: static void ForceKillTimerCallback(nsITimer* aTimer, void* aClosure); void StartForceKillTimer(); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 3f84566670f6..ec6d76bdfd14 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -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" @@ -5012,17 +5011,6 @@ ContentParent::AllocPExtensionsParent() { return MakeAndAddRef(); } -PFileDescriptorSetParent* ContentParent::AllocPFileDescriptorSetParent( - const FileDescriptor& aFD) { - return new FileDescriptorSetParent(aFD); -} - -bool ContentParent::DeallocPFileDescriptorSetParent( - PFileDescriptorSetParent* aActor) { - delete static_cast(aActor); - return true; -} - void ContentParent::NotifyUpdatedDictionaries() { RefPtr spellChecker(mozSpellChecker::Create()); MOZ_ASSERT(spellChecker, "No spell checker?"); @@ -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, diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index e7e5c154a27f..d34347430608 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -74,7 +74,6 @@ using mozilla::loader::PScriptCacheParent; namespace ipc { class CrashReporterHost; -class PFileDescriptorSetParent; class TestShellParent; #ifdef FUZZING class ProtocolFuzzerHelper; @@ -123,7 +122,6 @@ class ContentParent final public mozilla::ipc::ParentToChildStreamActorManager, public ProcessActor { typedef mozilla::ipc::GeckoChildProcessHost GeckoChildProcessHost; - typedef mozilla::ipc::PFileDescriptorSetParent PFileDescriptorSetParent; typedef mozilla::ipc::TestShellParent TestShellParent; typedef mozilla::ipc::PrincipalInfo PrincipalInfo; typedef mozilla::dom::ClonedMessageData ClonedMessageData; @@ -675,9 +673,6 @@ class ContentParent final FORWARD_SHMEM_ALLOCATOR_TO(PContentParent) - PFileDescriptorSetParent* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; - mozilla::ipc::IPCResult RecvBlobURLDataRequest( const nsCString& aBlobURL, nsIPrincipal* pTriggeringPrincipal, nsIPrincipal* pLoadingPrincipal, @@ -1146,11 +1141,6 @@ class ContentParent final already_AddRefed AllocPExtensionsParent(); - PFileDescriptorSetParent* AllocPFileDescriptorSetParent( - const mozilla::ipc::FileDescriptor&); - - bool DeallocPFileDescriptorSetParent(PFileDescriptorSetParent*); - #ifdef MOZ_WEBRTC PWebrtcGlobalParent* AllocPWebrtcGlobalParent(); bool DeallocPWebrtcGlobalParent(PWebrtcGlobalParent* aActor); diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index c136978a6490..c662d2ade7af 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -12,7 +12,6 @@ include protocol PDocAccessible; #endif include protocol PFilePicker; include protocol PRemotePrintJob; -include protocol PFileDescriptorSet; include protocol PRemoteLazyInputStream; include protocol PPaymentRequest; include protocol PSessionStore; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index b4fe3204590e..52e2e01e4912 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -13,7 +13,6 @@ include protocol PDocumentChannel; include protocol PExtensions; include protocol PExternalHelperApp; include protocol PHandlerService; -include protocol PFileDescriptorSet; include protocol PHal; include protocol PHeapSnapshotTempFileHelper; include protocol PProcessHangMonitor; @@ -461,7 +460,6 @@ sync protocol PContent manages PCycleCollectWithLogs; manages PExtensions; manages PExternalHelperApp; - manages PFileDescriptorSet; manages PHal; manages PHandlerService; manages PHeapSnapshotTempFileHelper; @@ -539,8 +537,6 @@ child: bool isForBrowser, bool isTopLevel); both: - async PFileDescriptorSet(FileDescriptor fd); - // For parent->child, aBrowser must be non-null; aContext can // be null to indicate the browser's current root document, or non-null // to persist a subdocument. For child->parent, arguments are diff --git a/dom/ipc/PFilePicker.ipdl b/dom/ipc/PFilePicker.ipdl index 2e5c082de2d0..40dc563b63bd 100644 --- a/dom/ipc/PFilePicker.ipdl +++ b/dom/ipc/PFilePicker.ipdl @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PBrowser; -include protocol PFileDescriptorSet; include protocol PRemoteLazyInputStream; include IPCBlob; diff --git a/dom/messagechannel/PMessagePort.ipdl b/dom/messagechannel/PMessagePort.ipdl index 33d2a74bb8c9..47ac2aeb05cd 100644 --- a/dom/messagechannel/PMessagePort.ipdl +++ b/dom/messagechannel/PMessagePort.ipdl @@ -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; diff --git a/dom/network/PUDPSocket.ipdl b/dom/network/PUDPSocket.ipdl index 315e45321c13..cc5a1729f365 100644 --- a/dom/network/PUDPSocket.ipdl +++ b/dom/network/PUDPSocket.ipdl @@ -7,7 +7,6 @@ include protocol PNecko; include protocol PBackground; -include protocol PFileDescriptorSet; // FIXME: bug #792908 include IPCStream; diff --git a/dom/webbrowserpersist/PWebBrowserPersistDocument.ipdl b/dom/webbrowserpersist/PWebBrowserPersistDocument.ipdl index 7d0744f0f76d..ee2e50185fbe 100644 --- a/dom/webbrowserpersist/PWebBrowserPersistDocument.ipdl +++ b/dom/webbrowserpersist/PWebBrowserPersistDocument.ipdl @@ -6,7 +6,6 @@ include protocol PContent; include protocol PWebBrowserPersistResources; include protocol PWebBrowserPersistSerialize; -include protocol PFileDescriptorSet; include PBackgroundSharedTypes; include IPCStream; diff --git a/ipc/glue/BackgroundChildImpl.cpp b/ipc/glue/BackgroundChildImpl.cpp index f51bec432f22..3725b95dd526 100644 --- a/ipc/glue/BackgroundChildImpl.cpp +++ b/ipc/glue/BackgroundChildImpl.cpp @@ -8,7 +8,6 @@ #include "ActorsChild.h" // IndexedDB #include "BroadcastChannelChild.h" -#include "FileDescriptorSetChild.h" #ifdef MOZ_WEBRTC # include "CamerasChild.h" #endif @@ -392,19 +391,6 @@ BackgroundChildImpl::AllocPRemoteLazyInputStreamChild(const nsID& aID, return actor.forget(); } -PFileDescriptorSetChild* BackgroundChildImpl::AllocPFileDescriptorSetChild( - const FileDescriptor& aFileDescriptor) { - return new FileDescriptorSetChild(aFileDescriptor); -} - -bool BackgroundChildImpl::DeallocPFileDescriptorSetChild( - PFileDescriptorSetChild* aActor) { - MOZ_ASSERT(aActor); - - delete static_cast(aActor); - return true; -} - PUDPSocketChild* BackgroundChildImpl::AllocPUDPSocketChild( const Maybe& aPrincipalInfo, const nsCString& aFilter) { MOZ_CRASH("AllocPUDPSocket should not be called"); @@ -646,11 +632,6 @@ bool BackgroundChildImpl::DeallocPMediaTransportChild( return true; } -PFileDescriptorSetChild* BackgroundChildImpl::SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) { - return PBackgroundChild::SendPFileDescriptorSetConstructor(aFD); -} - } // namespace mozilla::ipc mozilla::ipc::IPCResult TestChild::Recv__delete__(const nsCString& aTestArg) { diff --git a/ipc/glue/BackgroundChildImpl.h b/ipc/glue/BackgroundChildImpl.h index b1a7a058d99d..25b277155058 100644 --- a/ipc/glue/BackgroundChildImpl.h +++ b/ipc/glue/BackgroundChildImpl.h @@ -41,9 +41,6 @@ class BackgroundChildImpl : public PBackgroundChild, // This functions is implemented in BackgroundImpl.cpp. static ThreadLocal* GetThreadLocalForCurrentThread(); - PFileDescriptorSetChild* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; - protected: BackgroundChildImpl(); virtual ~BackgroundChildImpl(); @@ -156,12 +153,6 @@ class BackgroundChildImpl : public PBackgroundChild, virtual bool DeallocPSharedWorkerChild( mozilla::dom::PSharedWorkerChild* aActor) override; - virtual PFileDescriptorSetChild* AllocPFileDescriptorSetChild( - const FileDescriptor& aFileDescriptor) override; - - virtual bool DeallocPFileDescriptorSetChild( - PFileDescriptorSetChild* aActor) override; - virtual PCamerasChild* AllocPCamerasChild() override; virtual bool DeallocPCamerasChild(PCamerasChild* aActor) override; diff --git a/ipc/glue/BackgroundParentImpl.cpp b/ipc/glue/BackgroundParentImpl.cpp index 7d9f7d15f915..8b40f170b1b0 100644 --- a/ipc/glue/BackgroundParentImpl.cpp +++ b/ipc/glue/BackgroundParentImpl.cpp @@ -7,7 +7,6 @@ #include "BackgroundParentImpl.h" #include "BroadcastChannelParent.h" -#include "FileDescriptorSetParent.h" #ifdef MOZ_WEBRTC # include "CamerasParent.h" #endif @@ -669,24 +668,6 @@ BackgroundParentImpl::AllocPRemoteLazyInputStreamParent(const nsID& aID, return actor.forget(); } -PFileDescriptorSetParent* BackgroundParentImpl::AllocPFileDescriptorSetParent( - const FileDescriptor& aFileDescriptor) { - AssertIsInMainOrSocketProcess(); - AssertIsOnBackgroundThread(); - - return new FileDescriptorSetParent(aFileDescriptor); -} - -bool BackgroundParentImpl::DeallocPFileDescriptorSetParent( - PFileDescriptorSetParent* aActor) { - AssertIsInMainOrSocketProcess(); - AssertIsOnBackgroundThread(); - MOZ_ASSERT(aActor); - - delete static_cast(aActor); - return true; -} - already_AddRefed BackgroundParentImpl::AllocPVsyncParent() { AssertIsInMainOrSocketProcess(); @@ -1472,12 +1453,6 @@ BackgroundParentImpl::AllocPLockManagerParent( aClientId); } -PFileDescriptorSetParent* -BackgroundParentImpl::SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) { - return PBackgroundParent::SendPFileDescriptorSetConstructor(aFD); -} - already_AddRefed BackgroundParentImpl::AllocPWebSocketConnectionParent( const uint32_t& aListenerId) { diff --git a/ipc/glue/BackgroundParentImpl.h b/ipc/glue/BackgroundParentImpl.h index b2754e72cd79..e2a0aaa60b36 100644 --- a/ipc/glue/BackgroundParentImpl.h +++ b/ipc/glue/BackgroundParentImpl.h @@ -17,10 +17,6 @@ namespace mozilla::ipc { // to be inherited in BackgroundImpl. class BackgroundParentImpl : public PBackgroundParent, public ParentToChildStreamActorManager { - public: - PFileDescriptorSetParent* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; - protected: BackgroundParentImpl(); virtual ~BackgroundParentImpl(); @@ -201,12 +197,6 @@ class BackgroundParentImpl : public PBackgroundParent, bool DeallocPSharedWorkerParent(PSharedWorkerParent* aActor) override; - PFileDescriptorSetParent* AllocPFileDescriptorSetParent( - const FileDescriptor& aFileDescriptor) override; - - bool DeallocPFileDescriptorSetParent( - PFileDescriptorSetParent* aActor) override; - already_AddRefed AllocPVsyncParent() override; already_AddRefed diff --git a/ipc/glue/FileDescriptorSetChild.cpp b/ipc/glue/FileDescriptorSetChild.cpp deleted file mode 100644 index bc19d0d75a40..000000000000 --- a/ipc/glue/FileDescriptorSetChild.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 "FileDescriptorSetChild.h" - -namespace mozilla::ipc { - -FileDescriptorSetChild::FileDescriptorSetChild( - const FileDescriptor& aFileDescriptor) { - mFileDescriptors.AppendElement(aFileDescriptor); -} - -FileDescriptorSetChild::~FileDescriptorSetChild() { - MOZ_ASSERT(mFileDescriptors.IsEmpty()); -} - -void FileDescriptorSetChild::ForgetFileDescriptors( - nsTArray& aFileDescriptors) { - aFileDescriptors = std::move(mFileDescriptors); -} - -mozilla::ipc::IPCResult FileDescriptorSetChild::RecvAddFileDescriptor( - const FileDescriptor& aFileDescriptor) { - mFileDescriptors.AppendElement(aFileDescriptor); - return IPC_OK(); -} - -} // namespace mozilla::ipc diff --git a/ipc/glue/FileDescriptorSetChild.h b/ipc/glue/FileDescriptorSetChild.h deleted file mode 100644 index d3c882775195..000000000000 --- a/ipc/glue/FileDescriptorSetChild.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -#ifndef mozilla_ipc_FileDescriptorSetChild_h__ -#define mozilla_ipc_FileDescriptorSetChild_h__ - -#include "mozilla/Assertions.h" -#include "mozilla/Attributes.h" -#include "mozilla/ipc/PFileDescriptorSetChild.h" -#include "nsTArray.h" - -namespace mozilla { - -namespace dom { - -class ContentChild; - -} // namespace dom - -namespace net { - -class SocketProcessChild; - -} // namespace net - -namespace ipc { - -class BackgroundChildImpl; -class FileDescriptor; - -class FileDescriptorSetChild final : public PFileDescriptorSetChild { - friend class BackgroundChildImpl; - friend class mozilla::dom::ContentChild; - friend class mozilla::net::SocketProcessChild; - friend class PFileDescriptorSetChild; - - nsTArray mFileDescriptors; - - public: - void ForgetFileDescriptors(nsTArray& aFileDescriptors); - - private: - explicit FileDescriptorSetChild(const FileDescriptor& aFileDescriptor); - ~FileDescriptorSetChild(); - - mozilla::ipc::IPCResult RecvAddFileDescriptor( - const FileDescriptor& aFileDescriptor); -}; - -} // namespace ipc -} // namespace mozilla - -#endif // mozilla_ipc_FileDescriptorSetChild_h__ diff --git a/ipc/glue/FileDescriptorSetParent.cpp b/ipc/glue/FileDescriptorSetParent.cpp deleted file mode 100644 index 0cd7ea3ea3b8..000000000000 --- a/ipc/glue/FileDescriptorSetParent.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 "FileDescriptorSetParent.h" - -namespace mozilla::ipc { - -FileDescriptorSetParent::FileDescriptorSetParent( - const FileDescriptor& aFileDescriptor) { - mFileDescriptors.AppendElement(aFileDescriptor); -} - -FileDescriptorSetParent::~FileDescriptorSetParent() = default; - -void FileDescriptorSetParent::ForgetFileDescriptors( - nsTArray& aFileDescriptors) { - aFileDescriptors = std::move(mFileDescriptors); -} - -void FileDescriptorSetParent::ActorDestroy(ActorDestroyReason aWhy) { - // Implement me! Bug 1005157 -} - -mozilla::ipc::IPCResult FileDescriptorSetParent::RecvAddFileDescriptor( - const FileDescriptor& aFileDescriptor) { - mFileDescriptors.AppendElement(aFileDescriptor); - return IPC_OK(); -} - -} // namespace mozilla::ipc diff --git a/ipc/glue/FileDescriptorSetParent.h b/ipc/glue/FileDescriptorSetParent.h deleted file mode 100644 index 0510f4982b9e..000000000000 --- a/ipc/glue/FileDescriptorSetParent.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -#ifndef mozilla_ipc_FileDescriptorSetParent_h__ -#define mozilla_ipc_FileDescriptorSetParent_h__ - -#include "mozilla/Assertions.h" -#include "mozilla/Attributes.h" -#include "mozilla/ipc/PFileDescriptorSetParent.h" -#include "nsTArray.h" - -namespace mozilla { - -namespace dom { - -class ContentParent; - -} // namespace dom - -namespace net { - -class SocketProcessParent; - -} // namespace net - -namespace ipc { - -class BackgroundParentImpl; -class FileDescriptor; - -class FileDescriptorSetParent final : public PFileDescriptorSetParent { - friend class BackgroundParentImpl; - friend class mozilla::dom::ContentParent; - friend class mozilla::net::SocketProcessParent; - friend class PFileDescriptorSetParent; - - nsTArray mFileDescriptors; - - public: - void ForgetFileDescriptors(nsTArray& aFileDescriptors); - - private: - explicit FileDescriptorSetParent(const FileDescriptor& aFileDescriptor); - ~FileDescriptorSetParent(); - - virtual void ActorDestroy(ActorDestroyReason aWhy) override; - - mozilla::ipc::IPCResult RecvAddFileDescriptor( - const FileDescriptor& aFileDescriptor); -}; - -} // namespace ipc -} // namespace mozilla - -#endif // mozilla_ipc_FileDescriptorSetParent_h__ diff --git a/ipc/glue/IPCStream.ipdlh b/ipc/glue/IPCStream.ipdlh index de3dc81bf337..dff84a10809d 100644 --- a/ipc/glue/IPCStream.ipdlh +++ b/ipc/glue/IPCStream.ipdlh @@ -2,7 +2,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 BlobTypes; include InputStreamParams; include ProtocolTypes; @@ -14,7 +13,6 @@ namespace ipc { struct IPCStream { InputStreamParams stream; - OptionalFileDescriptorSet optionalFds; }; } // namespace ipc diff --git a/ipc/glue/IPCStreamUtils.cpp b/ipc/glue/IPCStreamUtils.cpp index 31944479cbc6..76bfc1e83e53 100644 --- a/ipc/glue/IPCStreamUtils.cpp +++ b/ipc/glue/IPCStreamUtils.cpp @@ -13,8 +13,6 @@ #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/File.h" -#include "mozilla/ipc/FileDescriptorSetChild.h" -#include "mozilla/ipc/FileDescriptorSetParent.h" #include "mozilla/ipc/InputStreamUtils.h" #include "mozilla/net/SocketProcessChild.h" #include "mozilla/net/SocketProcessParent.h" @@ -58,17 +56,7 @@ bool SerializeInputStreamWithFdsChild(nsIIPCSerializableInputStream* aStream, MOZ_CRASH("Serialize failed!"); } - if (fds.IsEmpty()) { - aValue.optionalFds() = void_t(); - } else { - PFileDescriptorSetChild* fdSet = - aManager->SendPFileDescriptorSetConstructor(fds[0]); - for (uint32_t i = 1; i < fds.Length(); ++i) { - Unused << fdSet->SendAddFileDescriptor(fds[i]); - } - - aValue.optionalFds() = fdSet; - } + MOZ_ASSERT(fds.IsEmpty(), "argument is unused"); return true; } @@ -93,22 +81,7 @@ bool SerializeInputStreamWithFdsParent(nsIIPCSerializableInputStream* aStream, MOZ_CRASH("Serialize failed!"); } - aValue.optionalFds() = void_t(); - if (!fds.IsEmpty()) { - PFileDescriptorSetParent* fdSet = - aManager->SendPFileDescriptorSetConstructor(fds[0]); - for (uint32_t i = 1; i < fds.Length(); ++i) { - if (NS_WARN_IF(!fdSet->SendAddFileDescriptor(fds[i]))) { - Unused << PFileDescriptorSetParent::Send__delete__(fdSet); - fdSet = nullptr; - break; - } - } - - if (fdSet) { - aValue.optionalFds() = fdSet; - } - } + MOZ_ASSERT(fds.IsEmpty(), "argument is unused"); return true; } @@ -128,7 +101,6 @@ bool SerializeInputStream(nsIInputStream* aStream, IPCStream& aValue, } aValue.stream() = params; - aValue.optionalFds() = void_t(); return true; } @@ -177,7 +149,6 @@ bool SerializeLazyInputStream(nsIInputStream* aStream, IPCStream& aValue, } aValue.stream() = RemoteLazyInputStreamParams(actor); - aValue.optionalFds() = void_t(); return true; } @@ -252,54 +223,6 @@ bool SerializeInputStreamParent(nsIInputStream* aStream, M* aManager, aDelayedStart); } -void ActivateAndCleanupIPCStream(IPCStream& aValue, bool aConsumedByIPC, - bool aDelayedStart) { - // Cleanup file descriptors if necessary - if (aValue.optionalFds().type() == - OptionalFileDescriptorSet::TPFileDescriptorSetChild) { - AutoTArray fds; - - auto fdSetActor = static_cast( - aValue.optionalFds().get_PFileDescriptorSetChild()); - MOZ_ASSERT(fdSetActor); - - // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we - // unconditionally forget them here. The fds themselves are auto-closed - // in ~FileDescriptor since they originated in this process. - fdSetActor->ForgetFileDescriptors(fds); - - if (!aConsumedByIPC) { - Unused << FileDescriptorSetChild::Send__delete__(fdSetActor); - } - - } else if (aValue.optionalFds().type() == - OptionalFileDescriptorSet::TPFileDescriptorSetParent) { - AutoTArray fds; - - auto fdSetActor = static_cast( - aValue.optionalFds().get_PFileDescriptorSetParent()); - MOZ_ASSERT(fdSetActor); - - // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we - // unconditionally forget them here. The fds themselves are auto-closed - // in ~FileDescriptor since they originated in this process. - fdSetActor->ForgetFileDescriptors(fds); - - if (!aConsumedByIPC) { - Unused << FileDescriptorSetParent::Send__delete__(fdSetActor); - } - } -} - -void ActivateAndCleanupIPCStream(Maybe& aValue, bool aConsumedByIPC, - bool aDelayedStart) { - if (aValue.isNothing()) { - return; - } - - ActivateAndCleanupIPCStream(aValue.ref(), aConsumedByIPC, aDelayedStart); -} - // Returns false if the serialization should not proceed. This means that the // inputStream is null. bool NormalizeOptionalValue(nsIInputStream* aStream, IPCStream* aValue, @@ -321,32 +244,7 @@ bool NormalizeOptionalValue(nsIInputStream* aStream, IPCStream* aValue, } // anonymous namespace already_AddRefed DeserializeIPCStream(const IPCStream& aValue) { - AutoTArray fds; - if (aValue.optionalFds().type() == - OptionalFileDescriptorSet::TPFileDescriptorSetParent) { - auto fdSetActor = static_cast( - aValue.optionalFds().get_PFileDescriptorSetParent()); - MOZ_ASSERT(fdSetActor); - - fdSetActor->ForgetFileDescriptors(fds); - MOZ_ASSERT(!fds.IsEmpty()); - - if (!FileDescriptorSetParent::Send__delete__(fdSetActor)) { - // child process is gone, warn and allow actor to clean up normally - NS_WARNING("Failed to delete fd set actor."); - } - } else if (aValue.optionalFds().type() == - OptionalFileDescriptorSet::TPFileDescriptorSetChild) { - auto fdSetActor = static_cast( - aValue.optionalFds().get_PFileDescriptorSetChild()); - MOZ_ASSERT(fdSetActor); - - fdSetActor->ForgetFileDescriptors(fds); - MOZ_ASSERT(!fds.IsEmpty()); - - Unused << FileDescriptorSetChild::Send__delete__(fdSetActor); - } - + nsTArray fds; // NOTE: Unused, should be removed. return InputStreamHelper::DeserializeInputStream(aValue.stream(), fds); } @@ -370,14 +268,7 @@ AutoIPCStream::AutoIPCStream(Maybe& aTarget, bool aDelayedStart) mOptionalValue->reset(); } -AutoIPCStream::~AutoIPCStream() { - MOZ_ASSERT(mValue || mOptionalValue); - if (mValue && IsSet()) { - ActivateAndCleanupIPCStream(*mValue, mTaken, mDelayedStart); - } else { - ActivateAndCleanupIPCStream(*mOptionalValue, mTaken, mDelayedStart); - } -} +AutoIPCStream::~AutoIPCStream() { MOZ_ASSERT(mValue || mOptionalValue); } bool AutoIPCStream::Serialize(nsIInputStream* aStream, dom::ContentChild* aManager) { diff --git a/ipc/glue/InputStreamParams.ipdlh b/ipc/glue/InputStreamParams.ipdlh index 3bf41fa292cf..7b4d18b12e83 100644 --- a/ipc/glue/InputStreamParams.ipdlh +++ b/ipc/glue/InputStreamParams.ipdlh @@ -25,7 +25,7 @@ struct StringInputStreamParams struct FileInputStreamParams { - uint32_t fileDescriptorIndex; + FileDescriptor fileDescriptor; int32_t behaviorFlags; int32_t ioFlags; }; diff --git a/ipc/glue/InputStreamUtils.h b/ipc/glue/InputStreamUtils.h index f00bb1870f07..71952e69c0e6 100644 --- a/ipc/glue/InputStreamUtils.h +++ b/ipc/glue/InputStreamUtils.h @@ -16,21 +16,11 @@ namespace mozilla { namespace ipc { class FileDescriptor; -class PFileDescriptorSetChild; -class PFileDescriptorSetParent; -// Provide two interfaces for sending PFileDescriptorSet constructor messages. -class ParentToChildStreamActorManager { - public: - virtual PFileDescriptorSetParent* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) = 0; -}; +// TODO: These interfaces are no longer necessary and should be removed. +class ParentToChildStreamActorManager {}; -class ChildToParentStreamActorManager { - public: - virtual PFileDescriptorSetChild* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) = 0; -}; +class ChildToParentStreamActorManager {}; // If you want to serialize an inputStream, please use AutoIPCStream. class InputStreamHelper { @@ -48,6 +38,8 @@ class InputStreamHelper { // pipe in chunks. This sending can start immediatelly or at the first read // based on the value of |aDelayedStart|. The IPC message size is returned // into |aSizeUsed|. + // XXX: The aManager and aFileDescriptors arguments are no longer necessary + // and should be removed. static void SerializeInputStream(nsIInputStream* aInputStream, InputStreamParams& aParams, nsTArray& aFileDescriptors, diff --git a/ipc/glue/PBackground.ipdl b/ipc/glue/PBackground.ipdl index 60b0de59b7ca..3ee728f20d69 100644 --- a/ipc/glue/PBackground.ipdl +++ b/ipc/glue/PBackground.ipdl @@ -21,7 +21,6 @@ include protocol PCacheStorage; include protocol PCacheStreamControl; include protocol PClientManager; include protocol PEndpointForReport; -include protocol PFileDescriptorSet; include protocol PFileSystemRequest; include protocol PGamepadEventChannel; include protocol PGamepadTestChannel; @@ -101,7 +100,6 @@ sync protocol PBackground manages PCacheStreamControl; manages PClientManager; manages PEndpointForReport; - manages PFileDescriptorSet; manages PFileSystemRequest; manages PGamepadEventChannel; manages PGamepadTestChannel; @@ -301,8 +299,6 @@ both: // PRemoteLazyInputStream is created on the parent side only if the child // starts a migration. async PRemoteLazyInputStream(nsID aID, uint64_t aSize); - - async PFileDescriptorSet(FileDescriptor fd); }; } // namespace ipc diff --git a/ipc/glue/PFileDescriptorSet.ipdl b/ipc/glue/PFileDescriptorSet.ipdl deleted file mode 100644 index eb88bf18b818..000000000000 --- a/ipc/glue/PFileDescriptorSet.ipdl +++ /dev/null @@ -1,24 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 PBackground; -include protocol PContent; -include protocol PSocketProcess; - -namespace mozilla { -namespace ipc { - -[ManualDealloc] -protocol PFileDescriptorSet -{ - manager PBackground or PContent or PSocketProcess; - -both: - async AddFileDescriptor(FileDescriptor fd); - - async __delete__(); -}; - -} // namespace ipc -} // namespace mozilla diff --git a/ipc/glue/moz.build b/ipc/glue/moz.build index 760eb5348e51..c4b7c1d69e86 100644 --- a/ipc/glue/moz.build +++ b/ipc/glue/moz.build @@ -28,8 +28,6 @@ EXPORTS.mozilla.ipc += [ "Endpoint.h", "EnvironmentMap.h", "FileDescriptor.h", - "FileDescriptorSetChild.h", - "FileDescriptorSetParent.h", "FileDescriptorUtils.h", "GeckoChildProcessHost.h", "IdleSchedulerChild.h", @@ -197,8 +195,6 @@ UNIFIED_SOURCES += [ SOURCES += [ "BackgroundChildImpl.cpp", "BackgroundParentImpl.cpp", - "FileDescriptorSetChild.cpp", - "FileDescriptorSetParent.cpp", ] if CONFIG["OS_ARCH"] == "Darwin": @@ -235,7 +231,6 @@ IPDL_SOURCES = [ "PBackgroundSharedTypes.ipdlh", "PBackgroundStarter.ipdl", "PBackgroundTest.ipdl", - "PFileDescriptorSet.ipdl", "PIdleScheduler.ipdl", "ProtocolTypes.ipdlh", "PUtilityAudioDecoder.ipdl", diff --git a/netwerk/base/nsFileStreams.cpp b/netwerk/base/nsFileStreams.cpp index 4a87e7968d9c..df732821e52e 100644 --- a/netwerk/base/nsFileStreams.cpp +++ b/netwerk/base/nsFileStreams.cpp @@ -555,7 +555,7 @@ void nsFileInputStream::Serialize(InputStreamParams& aParams, MOZ_ASSERT(aSizeUsed); *aSizeUsed = 0; - SerializeInternal(aParams, aFileDescriptors); + SerializeInternal(aParams); } void nsFileInputStream::Serialize(InputStreamParams& aParams, @@ -566,11 +566,10 @@ void nsFileInputStream::Serialize(InputStreamParams& aParams, MOZ_ASSERT(aSizeUsed); *aSizeUsed = 0; - SerializeInternal(aParams, aFileDescriptors); + SerializeInternal(aParams); } -void nsFileInputStream::SerializeInternal( - InputStreamParams& aParams, FileDescriptorArray& aFileDescriptors) { +void nsFileInputStream::SerializeInternal(InputStreamParams& aParams) { FileInputStreamParams params; if (NS_SUCCEEDED(DoPendingOpen())) { @@ -578,10 +577,7 @@ void nsFileInputStream::SerializeInternal( FileHandleType fd = FileHandleType(PR_FileDesc2NativeHandle(mFD)); NS_ASSERTION(fd, "This should never be null!"); - DebugOnly dbgFD = aFileDescriptors.AppendElement(fd); - NS_ASSERTION(dbgFD->IsValid(), "Sending an invalid file descriptor!"); - - params.fileDescriptorIndex() = aFileDescriptors.Length() - 1; + params.fileDescriptor() = FileDescriptor(fd); Close(); } else { @@ -589,7 +585,7 @@ void nsFileInputStream::SerializeInternal( "This file has not been opened (or could not be opened). " "Sending an invalid file descriptor to the other process!"); - params.fileDescriptorIndex() = UINT32_MAX; + params.fileDescriptor() = FileDescriptor(); } int32_t behaviorFlags = mBehaviorFlags; @@ -619,15 +615,7 @@ bool nsFileInputStream::Deserialize( const FileInputStreamParams& params = aParams.get_FileInputStreamParams(); - uint32_t fileDescriptorIndex = params.fileDescriptorIndex(); - - FileDescriptor fd; - if (fileDescriptorIndex < aFileDescriptors.Length()) { - fd = aFileDescriptors[fileDescriptorIndex]; - NS_WARNING_ASSERTION(fd.IsValid(), "Received an invalid file descriptor!"); - } else { - NS_WARNING("Received a bad file descriptor index!"); - } + const FileDescriptor& fd = params.fileDescriptor(); if (fd.IsValid()) { auto rawFD = fd.ClonePlatformHandle(); @@ -639,6 +627,7 @@ bool nsFileInputStream::Deserialize( mFD = fileDesc; mState = eOpened; } else { + NS_WARNING("Received an invalid file descriptor!"); mState = eError; mErrorValue = NS_ERROR_FILE_NOT_FOUND; } diff --git a/netwerk/base/nsFileStreams.h b/netwerk/base/nsFileStreams.h index 4f732a47e7ef..a9b8a0ed13bc 100644 --- a/netwerk/base/nsFileStreams.h +++ b/netwerk/base/nsFileStreams.h @@ -155,8 +155,7 @@ class nsFileInputStream : public nsFileStreamBase, protected: virtual ~nsFileInputStream() = default; - void SerializeInternal(mozilla::ipc::InputStreamParams& aParams, - FileDescriptorArray& aFileDescriptors); + void SerializeInternal(mozilla::ipc::InputStreamParams& aParams); nsresult SeekInternal(int32_t aWhence, int64_t aOffset, bool aClearBuf = true); diff --git a/netwerk/base/nsSyncStreamListener.cpp b/netwerk/base/nsSyncStreamListener.cpp index f2b3fd49fd8d..58790f6c9e3d 100644 --- a/netwerk/base/nsSyncStreamListener.cpp +++ b/netwerk/base/nsSyncStreamListener.cpp @@ -4,6 +4,7 @@ #include "mozilla/SpinEventLoopUntil.h" #include "nsIOService.h" +#include "nsIPipe.h" #include "nsSyncStreamListener.h" #include "nsThreadUtils.h" #include diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp index 491c8942532a..1128678cf53d 100644 --- a/netwerk/base/nsUDPSocket.cpp +++ b/netwerk/base/nsUDPSocket.cpp @@ -29,6 +29,7 @@ #include "nsIDNSRecord.h" #include "nsIDNSService.h" #include "nsICancelable.h" +#include "nsIPipe.h" #include "nsWrapperCacheInlines.h" #include "HttpConnectionUDP.h" #include "mozilla/StaticPrefs_network.h" diff --git a/netwerk/ipc/NeckoChannelParams.ipdlh b/netwerk/ipc/NeckoChannelParams.ipdlh index 0b6df96d6122..d9b4d66e6669 100644 --- a/netwerk/ipc/NeckoChannelParams.ipdlh +++ b/netwerk/ipc/NeckoChannelParams.ipdlh @@ -6,7 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PHttpChannel; -include BlobTypes; include ClientIPCTypes; include URIParams; include IPCServiceWorkerDescriptor; diff --git a/netwerk/ipc/PNecko.ipdl b/netwerk/ipc/PNecko.ipdl index 2d602ae594ba..31fed5e71b97 100644 --- a/netwerk/ipc/PNecko.ipdl +++ b/netwerk/ipc/PNecko.ipdl @@ -18,7 +18,6 @@ include protocol PTCPSocket; include protocol PTCPServerSocket; include protocol PUDPSocket; include protocol PDNSRequest; -include protocol PFileDescriptorSet; include protocol PDataChannel; include protocol PSimpleChannel; include protocol PTransportProvider; diff --git a/netwerk/ipc/PSocketProcess.ipdl b/netwerk/ipc/PSocketProcess.ipdl index 8787024e4b60..96336d3f8e3c 100644 --- a/netwerk/ipc/PSocketProcess.ipdl +++ b/netwerk/ipc/PSocketProcess.ipdl @@ -9,7 +9,6 @@ include protocol PProfiler; include protocol PWebrtcTCPSocket; include protocol PHttpTransaction; include protocol PHttpConnectionMgr; -include protocol PFileDescriptorSet; include protocol PInputChannelThrottleQueue; include protocol PBackgroundStarter; include protocol PAltService; @@ -94,7 +93,6 @@ sync protocol PSocketProcess { manages PDNSRequest; manages PWebrtcTCPSocket; - manages PFileDescriptorSet; manages PHttpTransaction; manages PHttpConnectionMgr; manages PInputChannelThrottleQueue; @@ -229,7 +227,6 @@ child: #endif // defined(XP_WIN) both: - async PFileDescriptorSet(FileDescriptor fd); async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port, uint16_t type, OriginAttributes originAttributes, uint32_t flags); diff --git a/netwerk/ipc/SocketProcessChild.cpp b/netwerk/ipc/SocketProcessChild.cpp index bc5ef1955b6e..8348d70b7007 100644 --- a/netwerk/ipc/SocketProcessChild.cpp +++ b/netwerk/ipc/SocketProcessChild.cpp @@ -20,7 +20,6 @@ #include "mozilla/ipc/CrashReporterClient.h" #include "mozilla/ipc/BackgroundChild.h" #include "mozilla/ipc/BackgroundParent.h" -#include "mozilla/ipc/FileDescriptorSetChild.h" #include "mozilla/ipc/ProcessChild.h" #include "mozilla/net/AltSvcTransactionChild.h" #include "mozilla/net/BackgroundDataBridgeParent.h" @@ -353,23 +352,6 @@ SocketProcessChild::AllocPHttpTransactionChild() { return actor.forget(); } -PFileDescriptorSetChild* SocketProcessChild::AllocPFileDescriptorSetChild( - const FileDescriptor& aFD) { - return new FileDescriptorSetChild(aFD); -} - -bool SocketProcessChild::DeallocPFileDescriptorSetChild( - PFileDescriptorSetChild* aActor) { - delete aActor; - return true; -} - -PFileDescriptorSetChild* SocketProcessChild::SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) { - MOZ_ASSERT(NS_IsMainThread()); - return PSocketProcessChild::SendPFileDescriptorSetConstructor(aFD); -} - already_AddRefed SocketProcessChild::AllocPHttpConnectionMgrChild( const HttpHandlerInitArgs& aArgs) { diff --git a/netwerk/ipc/SocketProcessChild.h b/netwerk/ipc/SocketProcessChild.h index 44fec92ce748..7f114fc1fd8a 100644 --- a/netwerk/ipc/SocketProcessChild.h +++ b/netwerk/ipc/SocketProcessChild.h @@ -68,15 +68,9 @@ class SocketProcessChild final already_AddRefed AllocPHttpTransactionChild(); - PFileDescriptorSetChild* AllocPFileDescriptorSetChild( - const FileDescriptor& fd); - bool DeallocPFileDescriptorSetChild(PFileDescriptorSetChild* aActor); - void CleanUp(); void DestroySocketProcessBridgeParent(ProcessId aId); - PFileDescriptorSetChild* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; already_AddRefed AllocPHttpConnectionMgrChild( const HttpHandlerInitArgs& aArgs); mozilla::ipc::IPCResult RecvUpdateDeviceModelId(const nsCString& aModelId); diff --git a/netwerk/ipc/SocketProcessParent.cpp b/netwerk/ipc/SocketProcessParent.cpp index c1ce3061fc3a..d7b2822ecb23 100644 --- a/netwerk/ipc/SocketProcessParent.cpp +++ b/netwerk/ipc/SocketProcessParent.cpp @@ -13,7 +13,6 @@ #include "mozilla/Components.h" #include "mozilla/dom/MemoryReportRequest.h" #include "mozilla/FOGIPC.h" -#include "mozilla/ipc/FileDescriptorSetParent.h" #include "mozilla/net/DNSRequestParent.h" #include "mozilla/net/ProxyConfigLookupParent.h" #include "mozilla/RemoteLazyInputStreamParent.h" @@ -232,24 +231,6 @@ mozilla::ipc::IPCResult SocketProcessParent::RecvPDNSRequestConstructor( return IPC_OK(); } -mozilla::ipc::PFileDescriptorSetParent* -SocketProcessParent::AllocPFileDescriptorSetParent(const FileDescriptor& aFD) { - return new mozilla::ipc::FileDescriptorSetParent(aFD); -} - -bool SocketProcessParent::DeallocPFileDescriptorSetParent( - PFileDescriptorSetParent* aActor) { - delete static_cast(aActor); - return true; -} - -mozilla::ipc::PFileDescriptorSetParent* -SocketProcessParent::SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) { - MOZ_ASSERT(NS_IsMainThread()); - return PSocketProcessParent::SendPFileDescriptorSetConstructor(aFD); -} - mozilla::ipc::IPCResult SocketProcessParent::RecvObserveHttpActivity( const HttpActivityArgs& aArgs, const uint32_t& aActivityType, const uint32_t& aActivitySubtype, const PRTime& aTimestamp, diff --git a/netwerk/ipc/SocketProcessParent.h b/netwerk/ipc/SocketProcessParent.h index e5c2907d21fe..b3bd163639e3 100644 --- a/netwerk/ipc/SocketProcessParent.h +++ b/netwerk/ipc/SocketProcessParent.h @@ -70,13 +70,6 @@ class SocketProcessParent final const bool& aMinimizeMemoryUsage, const Maybe& aDMDFile); - PFileDescriptorSetParent* AllocPFileDescriptorSetParent( - const FileDescriptor& fd); - bool DeallocPFileDescriptorSetParent(PFileDescriptorSetParent* aActor); - - PFileDescriptorSetParent* SendPFileDescriptorSetConstructor( - const FileDescriptor& aFD) override; - mozilla::ipc::IPCResult RecvObserveHttpActivity( const HttpActivityArgs& aArgs, const uint32_t& aActivityType, const uint32_t& aActivitySubtype, const PRTime& aTimestamp, diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 14893eb56030..7020f1cf6e00 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -18,7 +18,6 @@ #include "mozilla/dom/ServiceWorkerUtils.h" #include "mozilla/dom/BrowserChild.h" #include "mozilla/extensions/StreamFilterParent.h" -#include "mozilla/ipc/FileDescriptorSetChild.h" #include "mozilla/ipc/IPCStreamUtils.h" #include "mozilla/net/NeckoChild.h" #include "mozilla/net/HttpChannelChild.h" diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 13fdc2ad6a43..5d7c25abb066 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -8,7 +8,6 @@ #include "HttpLog.h" #include "mozilla/ConsoleReportCollector.h" -#include "mozilla/ipc/FileDescriptorSetParent.h" #include "mozilla/ipc/IPCStreamUtils.h" #include "mozilla/net/HttpChannelParent.h" #include "mozilla/dom/ContentParent.h" diff --git a/netwerk/protocol/http/PHttpTransaction.ipdl b/netwerk/protocol/http/PHttpTransaction.ipdl index eb9a3690ca0a..b869bdd20daa 100644 --- a/netwerk/protocol/http/PHttpTransaction.ipdl +++ b/netwerk/protocol/http/PHttpTransaction.ipdl @@ -6,7 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ include protocol PSocketProcess; -include protocol PFileDescriptorSet; // FIXME: bug #792908 include protocol PInputChannelThrottleQueue; include IPCStream; diff --git a/netwerk/protocol/websocket/PWebSocket.ipdl b/netwerk/protocol/websocket/PWebSocket.ipdl index eb67e029474f..bb15a7bb66c4 100644 --- a/netwerk/protocol/websocket/PWebSocket.ipdl +++ b/netwerk/protocol/websocket/PWebSocket.ipdl @@ -11,8 +11,6 @@ include protocol PTransportProvider; include IPCStream; include NeckoChannelParams; -include protocol PFileDescriptorSet; //FIXME: bug #792908 - include "mozilla/net/WebSocketChannelParent.h"; include "mozilla/net/WebSocketChannelChild.h";