Bug 1648141 - IPCBlobInputStream to RemoteLazyInputStream - part 8 - mozilla namespace, r=smaug,necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D80931
This commit is contained in:
Andrea Marchesini 2020-06-29 13:40:27 +00:00
Родитель 34cbc7e2ed
Коммит 4c6f89824d
29 изменённых файлов: 103 добавлений и 132 удалений

Просмотреть файл

@ -9,12 +9,12 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/FetchTypes.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/WorkerCommon.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "nsIContentPolicy.h"
#include "nsStreamUtils.h"

Просмотреть файл

@ -11,10 +11,10 @@
#include "mozilla/dom/FetchTypes.h"
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/RemoteLazyInputStreamStorage.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/RandomNum.h"
#include "mozilla/RemoteLazyInputStreamStorage.h"
#include "nsIRandomGenerator.h"
#include "nsStreamUtils.h"

Просмотреть файл

@ -13,6 +13,17 @@ using struct mozilla::void_t
from "ipc/IPCMessageUtils.h";
namespace mozilla {
union RemoteLazyStream
{
// Parent to Child: The child will receive a RemoteLazyInputStream. Nothing
// can be done with it except retrieving the size.
PRemoteLazyInputStream;
// Child to Parent: Normal serialization.
IPCStream;
};
namespace dom {
// This contains any extra bit for making a File out of a Blob.
@ -30,16 +41,6 @@ struct IPCFile
bool isDirectory;
};
union RemoteLazyStream
{
// Parent to Child: The child will receive a RemoteLazyInputStream. Nothing
// can be done with it except retrieving the size.
PRemoteLazyInputStream;
// Child to Parent: Normal serialization.
IPCStream;
};
struct IPCBlob
{
nsString type;

Просмотреть файл

@ -12,7 +12,6 @@ include protocol PSocketProcess;
include IPCStream;
namespace mozilla {
namespace dom {
refcounted protocol PRemoteLazyInputStream
{
@ -44,6 +43,4 @@ both:
async __delete__();
};
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -22,10 +22,9 @@
namespace mozilla {
using namespace dom;
using net::SocketProcessParent;
namespace dom {
class RemoteLazyInputStream;
namespace {
@ -955,5 +954,4 @@ void RemoteLazyInputStream::LengthReady(int64_t aLength) {
}
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,8 +4,8 @@
* 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_dom_RemoteLazyInputStream_h
#define mozilla_dom_RemoteLazyInputStream_h
#ifndef mozilla_RemoteLazyInputStream_h
#define mozilla_RemoteLazyInputStream_h
#include "mozilla/Mutex.h"
#include "mozIRemoteLazyInputStream.h"
@ -17,17 +17,9 @@
#include "nsCOMPtr.h"
namespace mozilla {
namespace dom {
class RemoteLazyInputStreamChild;
#define IPCBLOBINPUTSTREAM_IID \
{ \
0xbcfa38fc, 0x8b7f, 0x4d79, { \
0xbe, 0x3a, 0x1e, 0x7b, 0xbe, 0x52, 0x38, 0xcd \
} \
}
class RemoteLazyInputStream final : public nsIAsyncInputStream,
public nsIInputStreamCallback,
public nsICloneableInputStreamWithRange,
@ -126,7 +118,6 @@ class RemoteLazyInputStream final : public nsIAsyncInputStream,
Mutex mMutex;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStream_h
#endif // mozilla_RemoteLazyInputStream_h

Просмотреть файл

@ -12,7 +12,8 @@
#include "mozilla/dom/WorkerRef.h"
namespace mozilla {
namespace dom {
using namespace dom;
namespace {
@ -436,5 +437,4 @@ void RemoteLazyInputStreamChild::Migrated() {
}
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,20 +4,22 @@
* 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_dom_RemoteLazyInputStreamChild_h
#define mozilla_dom_RemoteLazyInputStreamChild_h
#ifndef mozilla_RemoteLazyInputStreamChild_h
#define mozilla_RemoteLazyInputStreamChild_h
#include "mozilla/dom/PRemoteLazyInputStreamChild.h"
#include "mozilla/dom/RemoteLazyInputStream.h"
#include "mozilla/PRemoteLazyInputStreamChild.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/Mutex.h"
#include "mozilla/UniquePtr.h"
#include "nsTArray.h"
namespace mozilla {
namespace dom {
class RemoteLazyInputStream;
namespace dom {
class ThreadSafeWorkerRef;
}
class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild {
public:
@ -96,10 +98,9 @@ class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild {
nsCOMPtr<nsISerialEventTarget> mOwningEventTarget;
RefPtr<ThreadSafeWorkerRef> mWorkerRef;
RefPtr<dom::ThreadSafeWorkerRef> mWorkerRef;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStreamChild_h
#endif // mozilla_RemoteLazyInputStreamChild_h

Просмотреть файл

@ -11,7 +11,6 @@
#include "RemoteLazyInputStreamStorage.h"
namespace mozilla {
namespace dom {
template <typename M>
/* static */
@ -227,5 +226,4 @@ bool RemoteLazyInputStreamParent::HasValidStream() const {
return RemoteLazyInputStreamStorage::Get()->HasStream(mID);
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,21 +4,23 @@
* 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_dom_RemoteLazyInputStreamParent_h
#define mozilla_dom_RemoteLazyInputStreamParent_h
#ifndef mozilla_RemoteLazyInputStreamParent_h
#define mozilla_RemoteLazyInputStreamParent_h
#include "mozilla/dom/PRemoteLazyInputStreamParent.h"
#include "mozilla/PRemoteLazyInputStreamParent.h"
class nsIInputStream;
namespace mozilla {
namespace dom {
class ContentParent;
}
namespace net {
class SocketProcessParent;
}
namespace dom {
class NS_NO_VTABLE RemoteLazyInputStreamParentCallback {
public:
virtual void ActorDestroyed(const nsID& aID) = 0;
@ -69,7 +71,7 @@ class RemoteLazyInputStreamParent final : public PRemoteLazyInputStreamParent {
private:
RemoteLazyInputStreamParent(const nsID& aID, uint64_t aSize,
ContentParent* aManager);
mozilla::dom::ContentParent* aManager);
RemoteLazyInputStreamParent(const nsID& aID, uint64_t aSize,
mozilla::ipc::PBackgroundParent* aManager);
@ -84,7 +86,7 @@ class RemoteLazyInputStreamParent final : public PRemoteLazyInputStreamParent {
// Only 1 of these is set. Raw pointer because these managers are keeping
// the parent actor alive. The pointers will be nullified in ActorDestroyed.
ContentParent* mContentManager;
mozilla::dom::ContentParent* mContentManager;
mozilla::ipc::PBackgroundParent* mPBackgroundManager;
mozilla::net::SocketProcessParent* mSocketProcessManager;
@ -93,7 +95,6 @@ class RemoteLazyInputStreamParent final : public PRemoteLazyInputStreamParent {
bool mMigrating;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStreamParent_h
#endif // mozilla_RemoteLazyInputStreamParent_h

Просмотреть файл

@ -16,8 +16,6 @@ namespace mozilla {
using namespace hal;
namespace dom {
namespace {
StaticMutex gMutex;
StaticRefPtr<RemoteLazyInputStreamStorage> gStorage;
@ -202,5 +200,4 @@ RemoteLazyInputStreamStorage::TakeCallback(const nsID& aID) {
return callback.forget();
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,8 +4,8 @@
* 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_dom_RemoteLazyInputStreamStorage_h
#define mozilla_dom_RemoteLazyInputStreamStorage_h
#ifndef mozilla_RemoteLazyInputStreamStorage_h
#define mozilla_RemoteLazyInputStreamStorage_h
#include "mozilla/RefPtr.h"
#include "nsClassHashtable.h"
@ -15,7 +15,6 @@ class nsIInputStream;
struct nsID;
namespace mozilla {
namespace dom {
class RemoteLazyInputStreamParentCallback;
@ -65,7 +64,6 @@ class RemoteLazyInputStreamStorage final : public nsIObserver {
nsClassHashtable<nsIDHashKey, StreamData> mStorage;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStreamStorage_h
#endif // mozilla_RemoteLazyInputStreamStorage_h

Просмотреть файл

@ -15,10 +15,6 @@
namespace mozilla {
using namespace ipc;
namespace dom {
namespace {
StaticMutex gRemoteLazyThreadMutex;
@ -31,7 +27,7 @@ class ThreadInitializeRunnable final : public Runnable {
NS_IMETHOD
Run() override {
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
MOZ_ASSERT(gRemoteLazyThread);
gRemoteLazyThread->InitializeOnMainThread();
return NS_OK;
@ -86,13 +82,13 @@ bool RemoteLazyInputStreamThread::IsOnFileEventTarget(
return true;
}
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
return gRemoteLazyThread && aEventTarget == gRemoteLazyThread->mThread;
}
/* static */
RemoteLazyInputStreamThread* RemoteLazyInputStreamThread::Get() {
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
if (gShutdownHasStarted) {
return nullptr;
@ -103,7 +99,7 @@ RemoteLazyInputStreamThread* RemoteLazyInputStreamThread::Get() {
/* static */
RemoteLazyInputStreamThread* RemoteLazyInputStreamThread::GetOrCreate() {
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
if (gShutdownHasStarted) {
return nullptr;
@ -166,7 +162,7 @@ RemoteLazyInputStreamThread::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
MOZ_ASSERT(!strcmp(aTopic, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID));
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
if (mThread) {
mThread->Shutdown();
@ -183,7 +179,7 @@ void RemoteLazyInputStreamThread::MigrateActor(
RemoteLazyInputStreamChild* aActor) {
MOZ_ASSERT(aActor->State() == RemoteLazyInputStreamChild::eInactiveMigrating);
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
if (gShutdownHasStarted) {
return;
@ -221,7 +217,7 @@ RemoteLazyInputStreamThread::Dispatch(already_AddRefed<nsIRunnable> aRunnable,
uint32_t aFlags) {
nsCOMPtr<nsIRunnable> runnable(aRunnable);
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
if (gShutdownHasStarted) {
return NS_ERROR_NOT_INITIALIZED;
@ -244,7 +240,7 @@ RemoteLazyInputStreamThread::DelayedDispatch(already_AddRefed<nsIRunnable>,
}
bool IsOnDOMFileThread() {
mozilla::StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
StaticMutexAutoLock lock(gRemoteLazyThreadMutex);
MOZ_ASSERT(!gShutdownHasStarted);
MOZ_ASSERT(gRemoteLazyThread);
@ -254,5 +250,4 @@ bool IsOnDOMFileThread() {
void AssertIsOnDOMFileThread() { MOZ_ASSERT(IsOnDOMFileThread()); }
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,10 +4,10 @@
* 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_dom_RemoteLazyInputStreamThread_h
#define mozilla_dom_RemoteLazyInputStreamThread_h
#ifndef mozilla_RemoteLazyInputStreamThread_h
#define mozilla_RemoteLazyInputStreamThread_h
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "nsIEventTarget.h"
#include "nsIObserver.h"
#include "nsTArray.h"
@ -15,7 +15,6 @@
class nsIThread;
namespace mozilla {
namespace dom {
class RemoteLazyInputStreamChild;
@ -54,7 +53,6 @@ bool IsOnDOMFileThread();
void AssertIsOnDOMFileThread();
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStreamThread_h
#endif // mozilla_RemoteLazyInputStreamThread_h

Просмотреть файл

@ -17,10 +17,6 @@
namespace mozilla {
using namespace ipc;
namespace dom {
namespace {
template <typename M>
@ -120,5 +116,4 @@ nsresult RemoteLazyInputStreamUtils::SerializeInputStream(
return NS_OK;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -4,8 +4,8 @@
* 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_dom_RemoteLazyInputStreamUtils_h
#define mozilla_dom_RemoteLazyInputStreamUtils_h
#ifndef mozilla_RemoteLazyInputStreamUtils_h
#define mozilla_RemoteLazyInputStreamUtils_h
/*
* RemoteLazyInputStream was previously part of the IPCBlob world.
@ -15,6 +15,8 @@
namespace mozilla {
class RemoteLazyStream;
namespace ipc {
class IPCStream;
class PBackgroundChild;
@ -22,16 +24,16 @@ class PBackgroundParent;
} // namespace ipc
namespace dom {
class ContentChild;
class ContentParent;
} // namespace dom
class RemoteLazyInputStreamUtils final {
public:
static nsresult SerializeInputStream(nsIInputStream* aInputStream,
uint64_t aSize,
RemoteLazyStream& aOutStream,
ContentParent* aManager);
dom::ContentParent* aManager);
static nsresult SerializeInputStream(
nsIInputStream* aInputStream, uint64_t aSize,
@ -40,14 +42,13 @@ class RemoteLazyInputStreamUtils final {
static nsresult SerializeInputStream(nsIInputStream* aInputStream,
uint64_t aSize,
RemoteLazyStream& aOutStream,
ContentChild* aManager);
dom::ContentChild* aManager);
static nsresult SerializeInputStream(
nsIInputStream* aInputStream, uint64_t aSize,
RemoteLazyStream& aOutStream, mozilla::ipc::PBackgroundChild* aManager);
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_RemoteLazyInputStreamUtils_h
#endif // mozilla_RemoteLazyInputStreamUtils_h

Просмотреть файл

@ -17,13 +17,16 @@ EXPORTS.mozilla.dom += [
'FileCreatorChild.h',
'FileCreatorParent.h',
'IPCBlobUtils.h',
'TemporaryIPCBlobChild.h',
'TemporaryIPCBlobParent.h',
]
EXPORTS.mozilla += [
'RemoteLazyInputStream.h',
'RemoteLazyInputStreamChild.h',
'RemoteLazyInputStreamParent.h',
'RemoteLazyInputStreamStorage.h',
'RemoteLazyInputStreamUtils.h',
'TemporaryIPCBlobChild.h',
'TemporaryIPCBlobParent.h',
]
UNIFIED_SOURCES += [

Просмотреть файл

@ -70,13 +70,13 @@
#include "mozilla/dom/quota/QuotaCommon.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "mozilla/dom/quota/UsageInfo.h"
#include "mozilla/dom/RemoteLazyInputStreamParent.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/InputStreamParams.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/ipc/PBackground.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/RemoteLazyInputStreamParent.h"
#include "mozilla/Scoped.h"
#include "mozilla/storage/Variant.h"
#include "mozIStorageFunction.h"

Просмотреть файл

@ -62,7 +62,6 @@
#include "mozilla/dom/ContentPlaybackController.h"
#include "mozilla/dom/PostMessageEvent.h"
#include "mozilla/dom/PushNotifier.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/dom/RemoteWorkerService.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/dom/ServiceWorkerManager.h"
@ -98,6 +97,7 @@
#include "mozilla/PerformanceUtils.h"
#include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/plugins/PluginModuleParent.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "mozilla/widget/ScreenManager.h"
#include "mozilla/widget/WidgetMessageUtils.h"
#include "nsBaseDragService.h"

Просмотреть файл

@ -112,7 +112,6 @@
#include "mozilla/dom/PresentationParent.h"
#include "mozilla/dom/ProcessMessageManager.h"
#include "mozilla/dom/PushNotifier.h"
#include "mozilla/dom/RemoteLazyInputStreamParent.h"
#include "mozilla/dom/ServiceWorkerManager.h"
#include "mozilla/dom/ServiceWorkerRegistrar.h"
#include "mozilla/dom/ServiceWorkerUtils.h"
@ -154,6 +153,7 @@
#include "mozilla/net/NeckoParent.h"
#include "mozilla/net/PCookieServiceParent.h"
#include "mozilla/plugins/PluginBridge.h"
#include "mozilla/RemoteLazyInputStreamParent.h"
#include "mozilla/widget/ScreenManager.h"
#include "nsAnonymousTemporaryFile.h"
#include "nsAppRunner.h"

Просмотреть файл

@ -19,10 +19,10 @@
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/FetchEventOpParent.h"
#include "mozilla/dom/RemoteLazyInputStreamUtils.h"
#include "mozilla/dom/RemoteLazyInputStreamStorage.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/RemoteLazyInputStreamUtils.h"
#include "mozilla/RemoteLazyInputStreamStorage.h"
namespace mozilla {

Просмотреть файл

@ -41,12 +41,12 @@
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/dom/InternalRequest.h"
#include "mozilla/dom/ReferrerInfo.h"
#include "mozilla/dom/RemoteLazyInputStreamStorage.h"
#include "mozilla/dom/RemoteWorkerControllerChild.h"
#include "mozilla/dom/ServiceWorkerBinding.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/net/CookieJarSettings.h"
#include "mozilla/RemoteLazyInputStreamStorage.h"
namespace mozilla {

Просмотреть файл

@ -31,7 +31,6 @@
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
#include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
#include "mozilla/dom/quota/PQuotaChild.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/dom/RemoteWorkerChild.h"
#include "mozilla/dom/RemoteWorkerControllerChild.h"
#include "mozilla/dom/RemoteWorkerServiceChild.h"
@ -55,6 +54,7 @@
#include "mozilla/dom/WebAuthnTransactionChild.h"
#include "mozilla/dom/MIDIPortChild.h"
#include "mozilla/dom/MIDIManagerChild.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "nsID.h"
#include "nsTraceRefcnt.h"
@ -382,11 +382,11 @@ bool BackgroundChildImpl::DeallocPFileCreatorChild(PFileCreatorChild* aActor) {
return true;
}
already_AddRefed<dom::PRemoteLazyInputStreamChild>
already_AddRefed<PRemoteLazyInputStreamChild>
BackgroundChildImpl::AllocPRemoteLazyInputStreamChild(const nsID& aID,
const uint64_t& aSize) {
RefPtr<dom::RemoteLazyInputStreamChild> actor =
new dom::RemoteLazyInputStreamChild(aID, aSize);
RefPtr<RemoteLazyInputStreamChild> actor =
new RemoteLazyInputStreamChild(aID, aSize);
return actor.forget();
}

Просмотреть файл

@ -36,7 +36,6 @@
#include "mozilla/dom/localstorage/ActorsParent.h"
#include "mozilla/dom/quota/ActorsParent.h"
#include "mozilla/dom/simpledb/ActorsParent.h"
#include "mozilla/dom/RemoteLazyInputStreamParent.h"
#include "mozilla/dom/RemoteWorkerParent.h"
#include "mozilla/dom/RemoteWorkerControllerParent.h"
#include "mozilla/dom/RemoteWorkerServiceParent.h"
@ -61,6 +60,7 @@
#include "mozilla/dom/WebAuthnTransactionParent.h"
#include "mozilla/Preferences.h"
#include "mozilla/psm/VerifySSLServerCertParent.h"
#include "mozilla/RemoteLazyInputStreamParent.h"
#include "mozilla/StaticPrefs_dom.h"
#include "nsNetUtil.h"
#include "nsProxyRelease.h"
@ -622,23 +622,22 @@ bool BackgroundParentImpl::DeallocPTemporaryIPCBlobParent(
return true;
}
already_AddRefed<dom::PRemoteLazyInputStreamParent>
already_AddRefed<PRemoteLazyInputStreamParent>
BackgroundParentImpl::AllocPRemoteLazyInputStreamParent(const nsID& aID,
const uint64_t& aSize) {
AssertIsInMainOrSocketProcess();
AssertIsOnBackgroundThread();
RefPtr<dom::RemoteLazyInputStreamParent> actor =
dom::RemoteLazyInputStreamParent::Create(aID, aSize, this);
RefPtr<RemoteLazyInputStreamParent> actor =
RemoteLazyInputStreamParent::Create(aID, aSize, this);
return actor.forget();
}
mozilla::ipc::IPCResult
BackgroundParentImpl::RecvPRemoteLazyInputStreamConstructor(
dom::PRemoteLazyInputStreamParent* aActor, const nsID& aID,
PRemoteLazyInputStreamParent* aActor, const nsID& aID,
const uint64_t& aSize) {
if (!static_cast<dom::RemoteLazyInputStreamParent*>(aActor)
->HasValidStream()) {
if (!static_cast<RemoteLazyInputStreamParent*>(aActor)->HasValidStream()) {
return IPC_FAIL_NO_REASON(this);
}

Просмотреть файл

@ -10,14 +10,14 @@
#include "mozilla/Assertions.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/RemoteLazyInputStream.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/dom/RemoteLazyInputStreamStorage.h"
#include "mozilla/dom/quota/DecryptingInputStream_impl.h"
#include "mozilla/dom/quota/IPCStreamCipherStrategy.h"
#include "mozilla/ipc/IPCStreamDestination.h"
#include "mozilla/ipc/IPCStreamSource.h"
#include "mozilla/InputStreamLengthHelper.h"
#include "mozilla/RemoteLazyInputStream.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "mozilla/RemoteLazyInputStreamStorage.h"
#include "mozilla/SlicedInputStream.h"
#include "mozilla/InputStreamLengthWrapper.h"
#include "nsBufferedStreams.h"

Просмотреть файл

@ -109,7 +109,6 @@
#include "mozilla/StaticPresData.h"
#include "mozilla/dom/AbstractRange.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/RemoteLazyInputStreamStorage.h"
#include "mozilla/dom/WebIDLGlobalNameHash.h"
#include "mozilla/dom/U2FTokenManager.h"
#ifdef OS_WIN
@ -123,6 +122,7 @@
#include "mozilla/dom/quota/ActorsParent.h"
#include "mozilla/dom/localstorage/ActorsParent.h"
#include "mozilla/net/UrlClassifierFeatureFactory.h"
#include "mozilla/RemoteLazyInputStreamStorage.h"
#include "nsThreadManager.h"
#include "mozilla/css/ImageLoader.h"
#include "gfxUserFontSet.h"
@ -262,7 +262,7 @@ nsresult nsLayoutStatics::Initialize() {
}
// This must be initialized on the main-thread.
mozilla::dom::RemoteLazyInputStreamStorage::Initialize();
mozilla::RemoteLazyInputStreamStorage::Initialize();
mozilla::dom::U2FTokenManager::Initialize();

Просмотреть файл

@ -12,7 +12,6 @@
#include "HttpConnectionMgrChild.h"
#include "mozilla/Assertions.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/BackgroundParent.h"
@ -28,6 +27,7 @@
#include "mozilla/ipc/PChildToParentStreamChild.h"
#include "mozilla/ipc/PParentToChildStreamChild.h"
#include "mozilla/Preferences.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "mozilla/Telemetry.h"
#include "nsDebugImpl.h"
#include "nsHttpConnectionInfo.h"
@ -464,11 +464,11 @@ mozilla::ipc::IPCResult SocketProcessChild::RecvNotifyObserver(
return IPC_OK();
}
already_AddRefed<dom::PRemoteLazyInputStreamChild>
already_AddRefed<PRemoteLazyInputStreamChild>
SocketProcessChild::AllocPRemoteLazyInputStreamChild(const nsID& aID,
const uint64_t& aSize) {
RefPtr<dom::RemoteLazyInputStreamChild> actor =
new dom::RemoteLazyInputStreamChild(aID, aSize);
RefPtr<RemoteLazyInputStreamChild> actor =
new RemoteLazyInputStreamChild(aID, aSize);
return actor.forget();
}

Просмотреть файл

@ -11,13 +11,13 @@
#include "HttpTransactionParent.h"
#include "SocketProcessHost.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/dom/RemoteLazyInputStreamParent.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/IPCStreamAlloc.h"
#include "mozilla/ipc/PChildToParentStreamParent.h"
#include "mozilla/ipc/PParentToChildStreamParent.h"
#include "mozilla/net/DNSRequestParent.h"
#include "mozilla/net/ProxyConfigLookupParent.h"
#include "mozilla/RemoteLazyInputStreamParent.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TelemetryIPC.h"
#include "nsIAppStartup.h"
@ -388,20 +388,19 @@ void SocketProcessParent::Destroy(UniquePtr<SocketProcessParent>&& aParent) {
new DeferredDeleteSocketProcessParent(std::move(aParent)));
}
already_AddRefed<dom::PRemoteLazyInputStreamParent>
already_AddRefed<PRemoteLazyInputStreamParent>
SocketProcessParent::AllocPRemoteLazyInputStreamParent(const nsID& aID,
const uint64_t& aSize) {
RefPtr<dom::RemoteLazyInputStreamParent> actor =
dom::RemoteLazyInputStreamParent::Create(aID, aSize, this);
RefPtr<RemoteLazyInputStreamParent> actor =
RemoteLazyInputStreamParent::Create(aID, aSize, this);
return actor.forget();
}
mozilla::ipc::IPCResult
SocketProcessParent::RecvPRemoteLazyInputStreamConstructor(
dom::PRemoteLazyInputStreamParent* aActor, const nsID& aID,
PRemoteLazyInputStreamParent* aActor, const nsID& aID,
const uint64_t& aSize) {
if (!static_cast<dom::RemoteLazyInputStreamParent*>(aActor)
->HasValidStream()) {
if (!static_cast<RemoteLazyInputStreamParent*>(aActor)->HasValidStream()) {
return IPC_FAIL_NO_REASON(this);
}

Просмотреть файл

@ -81,8 +81,8 @@
#include "nsStreamUtils.h"
#include "nsThreadUtils.h"
#include "nsURLHelper.h"
#include "mozilla/dom/RemoteLazyInputStreamChild.h"
#include "mozilla/dom/RemoteLazyInputStreamUtils.h"
#include "mozilla/RemoteLazyInputStreamChild.h"
#include "mozilla/RemoteLazyInputStreamUtils.h"
namespace mozilla {
namespace net {
@ -3680,9 +3680,8 @@ HttpBaseChannel::ReplacementChannelConfig::ReplacementChannelConfig(
method = aInit.method();
referrerInfo = aInit.referrerInfo();
timedChannel = aInit.timedChannel();
if (dom::RemoteLazyInputStreamChild* actor =
static_cast<dom::RemoteLazyInputStreamChild*>(
aInit.uploadStreamChild())) {
if (RemoteLazyInputStreamChild* actor =
static_cast<RemoteLazyInputStreamChild*>(aInit.uploadStreamChild())) {
uploadStreamLength = actor->Size();
uploadStream = actor->CreateStream();
// actor can be deleted by CreateStream, so don't touch it
@ -3706,8 +3705,8 @@ HttpBaseChannel::ReplacementChannelConfig::Serialize(
config.referrerInfo() = referrerInfo;
config.timedChannel() = timedChannel;
if (uploadStream) {
dom::RemoteLazyStream ipdlStream;
dom::RemoteLazyInputStreamUtils::SerializeInputStream(
RemoteLazyStream ipdlStream;
RemoteLazyInputStreamUtils::SerializeInputStream(
uploadStream, uploadStreamLength, ipdlStream, aParent);
config.uploadStreamParent() = ipdlStream;
}