зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1607634 - Part 4b: Changes for not-nullable actor types being wrapped in NotNull, r=ipc-reviewers,necko-reviewers,mccr8
These are the code changes required by the IPDL changes in part 4a. Differential Revision: https://phabricator.services.mozilla.com/D168887
This commit is contained in:
Родитель
75bbcd0353
Коммит
f47e7d485e
|
@ -148,7 +148,7 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
|
|||
accessible->Description(description);
|
||||
|
||||
cacheData.AppendElement(BatchData(
|
||||
OriginDocument(accessible->Document()->IPCDoc()),
|
||||
OriginDocument(WrapNotNull(accessible->Document()->IPCDoc())),
|
||||
UNIQUE_ID(accessible), accessible->State(), accessible->Bounds(),
|
||||
accessible->ActionCount(), name, textValue, nodeID, description,
|
||||
UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
|
||||
|
@ -186,7 +186,8 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
|
|||
// In that case, just throw away this update. We will get a new one soon
|
||||
// enough.
|
||||
ipcDoc->GetPlatformExtension()->SendSetPivotBoundaries(
|
||||
firstDoc, UNIQUE_ID(first), lastDoc, UNIQUE_ID(last));
|
||||
WrapNotNull(firstDoc), UNIQUE_ID(first), WrapNotNull(lastDoc),
|
||||
UNIQUE_ID(last));
|
||||
}
|
||||
} else if (RefPtr<SessionAccessibility> sessionAcc =
|
||||
SessionAccessibility::GetInstanceFor(docAcc)) {
|
||||
|
@ -256,11 +257,11 @@ void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) {
|
|||
nsAutoString description;
|
||||
acc->Description(description);
|
||||
RefPtr<AccAttributes> attributes = acc->Attributes();
|
||||
cacheData.AppendElement(
|
||||
BatchData(OriginDocument(acc->Document()->IPCDoc()), UNIQUE_ID(acc),
|
||||
acc->State(), acc->Bounds(), acc->ActionCount(), name,
|
||||
textValue, nodeID, description, acc->CurValue(),
|
||||
acc->MinValue(), acc->MaxValue(), acc->Step(), attributes));
|
||||
cacheData.AppendElement(BatchData(
|
||||
OriginDocument(WrapNotNull(acc->Document()->IPCDoc())),
|
||||
UNIQUE_ID(acc), acc->State(), acc->Bounds(), acc->ActionCount(), name,
|
||||
textValue, nodeID, description, acc->CurValue(), acc->MinValue(),
|
||||
acc->MaxValue(), acc->Step(), attributes));
|
||||
mFocusPath.InsertOrUpdate(acc->UniqueID(), RefPtr{acc});
|
||||
}
|
||||
|
||||
|
@ -298,7 +299,7 @@ void DocAccessibleWrap::UpdateFocusPathBounds() {
|
|||
}
|
||||
|
||||
boundsData.AppendElement(BatchData(
|
||||
OriginDocument(accessible->Document()->IPCDoc()),
|
||||
OriginDocument(WrapNotNull(accessible->Document()->IPCDoc())),
|
||||
UNIQUE_ID(accessible), 0, accessible->Bounds(), 0, nsString(),
|
||||
nsString(), nsString(), nsString(), UnspecifiedNaN<double>(),
|
||||
UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
|
||||
|
|
|
@ -958,7 +958,7 @@ void NotificationController::WillRefresh(mozilla::TimeStamp aTime) {
|
|||
MOZ_DIAGNOSTIC_ASSERT(id);
|
||||
DocAccessibleChild* ipcDoc = childDoc->IPCDoc();
|
||||
if (ipcDoc) {
|
||||
parentIPCDoc->SendBindChildDoc(ipcDoc, id);
|
||||
parentIPCDoc->SendBindChildDoc(WrapNotNull(ipcDoc), id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -802,7 +802,7 @@ mozilla::ipc::IPCResult DocAccessibleParent::RecvRoleChangedEvent(
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult DocAccessibleParent::RecvBindChildDoc(
|
||||
PDocAccessibleParent* aChildDoc, const uint64_t& aID) {
|
||||
NotNull<PDocAccessibleParent*> aChildDoc, const uint64_t& aID) {
|
||||
ACQUIRE_ANDROID_LOCK
|
||||
// One document should never directly be the child of another.
|
||||
// We should always have at least an outer doc accessible in between.
|
||||
|
@ -815,7 +815,7 @@ mozilla::ipc::IPCResult DocAccessibleParent::RecvBindChildDoc(
|
|||
|
||||
MOZ_ASSERT(CheckDocTree());
|
||||
|
||||
auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
|
||||
auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc.get());
|
||||
childDoc->Unbind();
|
||||
ipc::IPCResult result = AddChildDoc(childDoc, aID, false);
|
||||
MOZ_ASSERT(result);
|
||||
|
@ -1261,7 +1261,7 @@ mozilla::ipc::IPCResult DocAccessibleParent::RecvBatch(
|
|||
nsTArray<RemoteAccessible*> proxies(aData.Length());
|
||||
for (size_t i = 0; i < aData.Length(); i++) {
|
||||
DocAccessibleParent* doc = static_cast<DocAccessibleParent*>(
|
||||
aData.ElementAt(i).Document().get_PDocAccessible().AsParent());
|
||||
aData.ElementAt(i).Document().get_PDocAccessible().AsParent().get());
|
||||
MOZ_ASSERT(doc);
|
||||
|
||||
if (doc->IsShutdown()) {
|
||||
|
|
|
@ -177,7 +177,7 @@ class DocAccessibleParent : public RemoteAccessible,
|
|||
const a11y::role& aRole, const uint8_t& aRoleMapEntryIndex) final;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvBindChildDoc(
|
||||
PDocAccessibleParent* aChildDoc, const uint64_t& aID) override;
|
||||
NotNull<PDocAccessibleParent*> aChildDoc, const uint64_t& aID) override;
|
||||
|
||||
void Unbind() {
|
||||
if (DocAccessibleParent* parent = ParentDoc()) {
|
||||
|
|
|
@ -305,8 +305,8 @@ bool DocAccessibleChild::ConstructChildDocInParentProcess(
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DocAccessibleChild::SendBindChildDoc(DocAccessibleChild* aChildDoc,
|
||||
const uint64_t& aNewParentID) {
|
||||
bool DocAccessibleChild::SendBindChildDoc(
|
||||
NotNull<DocAccessibleChild*> aChildDoc, const uint64_t& aNewParentID) {
|
||||
if (IsConstructedInParentProcess()) {
|
||||
return DocAccessibleChildBase::SendBindChildDoc(aChildDoc, aNewParentID);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class DocAccessibleChild : public DocAccessibleChildBase {
|
|||
bool ConstructChildDocInParentProcess(DocAccessibleChild* aNewChildDoc,
|
||||
uint64_t aUniqueID, uint32_t aMsaaID);
|
||||
|
||||
bool SendBindChildDoc(DocAccessibleChild* aChildDoc,
|
||||
bool SendBindChildDoc(NotNull<DocAccessibleChild*> aChildDoc,
|
||||
const uint64_t& aNewParentID);
|
||||
|
||||
/**
|
||||
|
@ -346,7 +346,8 @@ class DocAccessibleChild : public DocAccessibleChildBase {
|
|||
|
||||
struct SerializedBindChildDoc final : public DeferredEvent {
|
||||
SerializedBindChildDoc(DocAccessibleChild* aParentDoc,
|
||||
DocAccessibleChild* aChildDoc, uint64_t aNewParentID)
|
||||
NotNull<DocAccessibleChild*> aChildDoc,
|
||||
uint64_t aNewParentID)
|
||||
: DeferredEvent(aParentDoc),
|
||||
mChildDoc(aChildDoc),
|
||||
mNewParentID(aNewParentID) {}
|
||||
|
@ -355,7 +356,7 @@ class DocAccessibleChild : public DocAccessibleChildBase {
|
|||
Unused << aParentIPCDoc->SendBindChildDoc(mChildDoc, mNewParentID);
|
||||
}
|
||||
|
||||
DocAccessibleChild* mChildDoc;
|
||||
NotNull<DocAccessibleChild*> mChildDoc;
|
||||
uint64_t mNewParentID;
|
||||
};
|
||||
|
||||
|
|
|
@ -432,15 +432,12 @@ RefPtr<ClientOpPromise> ClientManagerService::Navigate(
|
|||
PClientManagerParent* manager = source->Manager();
|
||||
MOZ_DIAGNOSTIC_ASSERT(manager);
|
||||
|
||||
ClientNavigateOpConstructorArgs args;
|
||||
args.url() = aArgs.url();
|
||||
args.baseURL() = aArgs.baseURL();
|
||||
|
||||
// This is safe to do because the ClientSourceChild cannot directly delete
|
||||
// itself. Instead it sends a Teardown message to the parent which then
|
||||
// calls delete. That means we can be sure that we are not racing with
|
||||
// source destruction here.
|
||||
args.target() = source;
|
||||
ClientNavigateOpConstructorArgs args(WrapNotNull(source), aArgs.url(),
|
||||
aArgs.baseURL());
|
||||
|
||||
RefPtr<ClientOpPromise::Private> promise =
|
||||
new ClientOpPromise::Private(__func__);
|
||||
|
|
|
@ -162,7 +162,7 @@ RefPtr<ClientOpPromise> ClientNavigateOpChild::DoNavigate(
|
|||
// access the ClientSource again.
|
||||
{
|
||||
ClientSourceChild* targetActor =
|
||||
static_cast<ClientSourceChild*>(aArgs.target().AsChild());
|
||||
static_cast<ClientSourceChild*>(aArgs.target().AsChild().get());
|
||||
MOZ_DIAGNOSTIC_ASSERT(targetActor);
|
||||
|
||||
ClientSource* target = targetActor->GetSource();
|
||||
|
|
|
@ -251,7 +251,7 @@ void ResolveCallback(FileSystemGetWritableFileStreamResponse&& aResponse,
|
|||
auto& properties = aResponse.get_FileSystemWritableFileStreamProperties();
|
||||
|
||||
auto* const actor = static_cast<FileSystemWritableFileStreamChild*>(
|
||||
properties.writableFileStream().AsChild());
|
||||
properties.writableFileStream().AsChild().get());
|
||||
|
||||
mozilla::ipc::RandomAccessStreamParams params =
|
||||
std::move(properties.streamParams());
|
||||
|
|
|
@ -216,7 +216,8 @@ mozilla::ipc::IPCResult FileSystemManagerParent::RecvGetWritable(
|
|||
}
|
||||
|
||||
auto writableFileStreamParent =
|
||||
MakeRefPtr<FileSystemWritableFileStreamParent>(this, aRequest.entryId());
|
||||
MakeNotNull<RefPtr<FileSystemWritableFileStreamParent>>(
|
||||
this, aRequest.entryId());
|
||||
|
||||
QM_TRY_UNWRAP(
|
||||
nsCOMPtr<nsIRandomAccessStream> stream,
|
||||
|
|
|
@ -832,7 +832,7 @@ bool BackgroundFactoryChild::DeallocPBackgroundIDBDatabaseChild(
|
|||
mozilla::ipc::IPCResult
|
||||
BackgroundFactoryChild::RecvPBackgroundIDBDatabaseConstructor(
|
||||
PBackgroundIDBDatabaseChild* aActor, const DatabaseSpec& aSpec,
|
||||
PBackgroundIDBFactoryRequestChild* aRequest) {
|
||||
NotNull<PBackgroundIDBFactoryRequestChild*> aRequest) {
|
||||
AssertIsOnOwningThread();
|
||||
MOZ_ASSERT(aActor);
|
||||
|
||||
|
@ -901,8 +901,8 @@ void BackgroundFactoryRequestChild::HandleResponse(
|
|||
|
||||
mRequest->Reset();
|
||||
|
||||
auto* databaseActor =
|
||||
static_cast<BackgroundDatabaseChild*>(aResponse.database().AsChild());
|
||||
auto* databaseActor = static_cast<BackgroundDatabaseChild*>(
|
||||
aResponse.database().AsChild().get());
|
||||
MOZ_ASSERT(databaseActor);
|
||||
|
||||
IDBDatabase* const database = [this, databaseActor]() -> IDBDatabase* {
|
||||
|
@ -1326,7 +1326,6 @@ BackgroundDatabaseChild::RecvCloseAfterInvalidationComplete() {
|
|||
}
|
||||
|
||||
/*******************************************************************************
|
||||
structs/unions, r=#ipc-reviewers!)
|
||||
* BackgroundTransactionBase
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ class BackgroundFactoryChild final : public PBackgroundIDBFactoryChild {
|
|||
|
||||
mozilla::ipc::IPCResult RecvPBackgroundIDBDatabaseConstructor(
|
||||
PBackgroundIDBDatabaseChild* aActor, const DatabaseSpec& aSpec,
|
||||
PBackgroundIDBFactoryRequestChild* aRequest) override;
|
||||
NotNull<PBackgroundIDBFactoryRequestChild*> aRequest) override;
|
||||
};
|
||||
|
||||
class BackgroundDatabaseChild;
|
||||
|
|
|
@ -2146,7 +2146,7 @@ class Factory final : public PBackgroundIDBFactoryParent,
|
|||
|
||||
PBackgroundIDBDatabaseParent* AllocPBackgroundIDBDatabaseParent(
|
||||
const DatabaseSpec& aSpec,
|
||||
PBackgroundIDBFactoryRequestParent* aRequest) override;
|
||||
NotNull<PBackgroundIDBFactoryRequestParent*> aRequest) override;
|
||||
|
||||
bool DeallocPBackgroundIDBDatabaseParent(
|
||||
PBackgroundIDBDatabaseParent* aActor) override;
|
||||
|
@ -9118,7 +9118,8 @@ bool Factory::DeallocPBackgroundIDBFactoryRequestParent(
|
|||
}
|
||||
|
||||
PBackgroundIDBDatabaseParent* Factory::AllocPBackgroundIDBDatabaseParent(
|
||||
const DatabaseSpec& aSpec, PBackgroundIDBFactoryRequestParent* aRequest) {
|
||||
const DatabaseSpec& aSpec,
|
||||
NotNull<PBackgroundIDBFactoryRequestParent*> aRequest) {
|
||||
MOZ_CRASH(
|
||||
"PBackgroundIDBDatabaseParent actors should be constructed "
|
||||
"manually!");
|
||||
|
@ -10268,7 +10269,8 @@ bool TransactionBase::VerifyRequestParams(
|
|||
}
|
||||
|
||||
for (const FileAddInfo& fileAddInfo : aParams.fileAddInfos()) {
|
||||
const PBackgroundIDBDatabaseFileParent* file = fileAddInfo.file().AsParent();
|
||||
const PBackgroundIDBDatabaseFileParent* file =
|
||||
fileAddInfo.file().AsParent();
|
||||
|
||||
switch (fileAddInfo.type()) {
|
||||
case StructuredCloneFileBase::eBlob:
|
||||
|
@ -15848,7 +15850,8 @@ void OpenDatabaseOp::SendResults() {
|
|||
|
||||
// XXX OpenDatabaseRequestResponse stores a raw pointer, can this be
|
||||
// avoided?
|
||||
response = OpenDatabaseRequestResponse{mDatabase.unsafeGetRawPtr()};
|
||||
response = OpenDatabaseRequestResponse{
|
||||
WrapNotNull(mDatabase.unsafeGetRawPtr())};
|
||||
} else {
|
||||
response = ClampResultCode(rv);
|
||||
#ifdef DEBUG
|
||||
|
@ -15987,7 +15990,7 @@ nsresult OpenDatabaseOp::EnsureDatabaseActorIsAlive() {
|
|||
mDatabase->SetActorAlive();
|
||||
|
||||
if (!factory->SendPBackgroundIDBDatabaseConstructor(
|
||||
mDatabase.unsafeGetRawPtr(), spec, this)) {
|
||||
mDatabase.unsafeGetRawPtr(), spec, WrapNotNull(this))) {
|
||||
IDB_REPORT_INTERNAL_ERR();
|
||||
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||
}
|
||||
|
|
|
@ -767,7 +767,8 @@ RefPtr<IDBRequest> IDBObjectStore::AddOrPut(JSContext* aCx,
|
|||
return Err(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
}
|
||||
|
||||
return FileAddInfo{fileActor, StructuredCloneFileBase::eBlob};
|
||||
return FileAddInfo{WrapNotNull(fileActor),
|
||||
StructuredCloneFileBase::eBlob};
|
||||
}
|
||||
|
||||
case StructuredCloneFileBase::eWasmBytecode:
|
||||
|
@ -781,7 +782,7 @@ RefPtr<IDBRequest> IDBObjectStore::AddOrPut(JSContext* aCx,
|
|||
return Err(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
}
|
||||
|
||||
return FileAddInfo{fileActor, file.Type()};
|
||||
return FileAddInfo{WrapNotNull(fileActor), file.Type()};
|
||||
}
|
||||
|
||||
default:
|
||||
|
|
|
@ -714,8 +714,8 @@ BrowserChild::ProvideWindow(nsIOpenWindowInfo* aOpenWindowInfo,
|
|||
// code back to our caller.
|
||||
ContentChild* cc = ContentChild::GetSingleton();
|
||||
return cc->ProvideWindowCommon(
|
||||
this, aOpenWindowInfo, aChromeFlags, aCalledFromJS, aURI, aName,
|
||||
aFeatures, aForceNoOpener, aForceNoReferrer, aIsPopupRequested,
|
||||
WrapNotNull(this), aOpenWindowInfo, aChromeFlags, aCalledFromJS, aURI,
|
||||
aName, aFeatures, aForceNoOpener, aForceNoReferrer, aIsPopupRequested,
|
||||
aLoadState, aWindowIsNew, aReturn);
|
||||
}
|
||||
|
||||
|
|
|
@ -971,14 +971,12 @@ static nsresult GetCreateWindowParams(nsIOpenWindowInfo* aOpenWindowInfo,
|
|||
}
|
||||
|
||||
nsresult ContentChild::ProvideWindowCommon(
|
||||
BrowserChild* aTabOpener, nsIOpenWindowInfo* aOpenWindowInfo,
|
||||
NotNull<BrowserChild*> aTabOpener, nsIOpenWindowInfo* aOpenWindowInfo,
|
||||
uint32_t aChromeFlags, bool aCalledFromJS, nsIURI* aURI,
|
||||
const nsAString& aName, const nsACString& aFeatures, bool aForceNoOpener,
|
||||
bool aForceNoReferrer, bool aIsPopupRequested,
|
||||
nsDocShellLoadState* aLoadState, bool* aWindowIsNew,
|
||||
BrowsingContext** aReturn) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aTabOpener, "We must have a tab opener");
|
||||
|
||||
*aReturn = nullptr;
|
||||
|
||||
nsAutoCString features(aFeatures);
|
||||
|
@ -1097,9 +1095,9 @@ nsresult ContentChild::ProvideWindowCommon(
|
|||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
auto newChild = MakeRefPtr<BrowserChild>(this, tabId, *aTabOpener,
|
||||
browsingContext, aChromeFlags,
|
||||
/* aIsTopLevel */ true);
|
||||
auto newChild = MakeNotNull<RefPtr<BrowserChild>>(
|
||||
this, tabId, *aTabOpener, browsingContext, aChromeFlags,
|
||||
/* aIsTopLevel */ true);
|
||||
|
||||
if (IsShuttingDown()) {
|
||||
return NS_ERROR_ABORT;
|
||||
|
@ -1119,8 +1117,7 @@ nsresult ContentChild::ProvideWindowCommon(
|
|||
}
|
||||
|
||||
// Tell the parent process to set up its PBrowserParent.
|
||||
PopupIPCTabContext ipcContext;
|
||||
ipcContext.opener() = aTabOpener;
|
||||
PopupIPCTabContext ipcContext(aTabOpener, 0);
|
||||
if (NS_WARN_IF(!SendConstructPopupBrowser(
|
||||
std::move(parentEp), std::move(windowParentEp), tabId, ipcContext,
|
||||
windowInit, aChromeFlags))) {
|
||||
|
@ -1136,9 +1133,11 @@ nsresult ContentChild::ProvideWindowCommon(
|
|||
|
||||
// Now that |newChild| has had its IPC link established, call |Init| to set it
|
||||
// up.
|
||||
// XXX: This MOZ_KnownLive is only necessary because the static analysis can't
|
||||
// tell that NotNull<RefPtr<BrowserChild>> is a strong pointer.
|
||||
RefPtr<nsPIDOMWindowOuter> parentWindow =
|
||||
parent ? parent->GetDOMWindow() : nullptr;
|
||||
if (NS_FAILED(newChild->Init(parentWindow, windowChild))) {
|
||||
if (NS_FAILED(MOZ_KnownLive(newChild)->Init(parentWindow, windowChild))) {
|
||||
return NS_ERROR_ABORT;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class ContentChild final : public PContentChild,
|
|||
};
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult ProvideWindowCommon(
|
||||
BrowserChild* aTabOpener, nsIOpenWindowInfo* aOpenWindowInfo,
|
||||
NotNull<BrowserChild*> aTabOpener, nsIOpenWindowInfo* aOpenWindowInfo,
|
||||
uint32_t aChromeFlags, bool aCalledFromJS, nsIURI* aURI,
|
||||
const nsAString& aName, const nsACString& aFeatures, bool aForceNoOpener,
|
||||
bool aForceNoReferrer, bool aIsPopupRequested,
|
||||
|
|
|
@ -74,7 +74,8 @@ nsresult TCPServerSocketParent::SendCallbackAccept(TCPSocketParent* socket) {
|
|||
// successfully, otherwise |socket| could be leaked.
|
||||
socket->AddIPDLReference();
|
||||
|
||||
mozilla::Unused << PTCPServerSocketParent::SendCallbackAccept(socket);
|
||||
mozilla::Unused << PTCPServerSocketParent::SendCallbackAccept(
|
||||
WrapNotNull(socket));
|
||||
} else {
|
||||
NS_ERROR("Sending data from PTCPSocketParent was failed.");
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ WebBrowserPersistResourcesChild::VisitDocument(
|
|||
// state that causes a document's parent actor to be exposed to
|
||||
// XPCOM (for both parent->child and child->parent construction),
|
||||
// which simplifies the lifetime management.
|
||||
SendVisitDocument(subActor);
|
||||
SendVisitDocument(WrapNotNull(subActor));
|
||||
subActor->Start(aSubDocument);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,11 @@ mozilla::ipc::IPCResult WebBrowserPersistResourcesParent::RecvVisitResource(
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult WebBrowserPersistResourcesParent::RecvVisitDocument(
|
||||
PWebBrowserPersistDocumentParent* aSubDocument) {
|
||||
NotNull<PWebBrowserPersistDocumentParent*> aSubDocument) {
|
||||
// Don't expose the subdocument to the visitor until it's ready
|
||||
// (until the actor isn't in START state).
|
||||
static_cast<WebBrowserPersistDocumentParent*>(aSubDocument)->SetOnReady(this);
|
||||
static_cast<WebBrowserPersistDocumentParent*>(aSubDocument.get())
|
||||
->SetOnReady(this);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class WebBrowserPersistResourcesParent final
|
|||
const nsContentPolicyType& aContentPolicyType) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvVisitDocument(
|
||||
PWebBrowserPersistDocumentParent* aSubDocument) override;
|
||||
NotNull<PWebBrowserPersistDocumentParent*> aSubDocument) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvVisitBrowsingContext(
|
||||
const dom::MaybeDiscarded<dom::BrowsingContext>& aContext) override;
|
||||
|
|
|
@ -108,9 +108,9 @@ void ImageBridgeChild::UseTextures(
|
|||
|
||||
bool readLocked = t.mTextureClient->OnForwardedToHost();
|
||||
|
||||
textures.AppendElement(TimedTexture(t.mTextureClient->GetIPDLActor(),
|
||||
t.mTimeStamp, t.mPictureRect,
|
||||
t.mFrameID, t.mProducerID, readLocked));
|
||||
textures.AppendElement(TimedTexture(
|
||||
WrapNotNull(t.mTextureClient->GetIPDLActor()), t.mTimeStamp,
|
||||
t.mPictureRect, t.mFrameID, t.mProducerID, readLocked));
|
||||
|
||||
// Wait end of usage on host side if TextureFlags::RECYCLE is set
|
||||
HoldUntilCompositableRefReleasedIfNecessary(t.mTextureClient);
|
||||
|
@ -853,7 +853,7 @@ static bool IBCAddOpDestroy(CompositableTransaction* aTxn,
|
|||
}
|
||||
|
||||
bool ImageBridgeChild::DestroyInTransaction(PTextureChild* aTexture) {
|
||||
return IBCAddOpDestroy(mTxn, OpDestroy(aTexture));
|
||||
return IBCAddOpDestroy(mTxn, OpDestroy(WrapNotNull(aTexture)));
|
||||
}
|
||||
|
||||
bool ImageBridgeChild::DestroyInTransaction(const CompositableHandle& aHandle) {
|
||||
|
@ -871,9 +871,9 @@ void ImageBridgeChild::RemoveTextureFromCompositable(
|
|||
return;
|
||||
}
|
||||
|
||||
mTxn->AddNoSwapEdit(
|
||||
CompositableOperation(aCompositable->GetIPCHandle(),
|
||||
OpRemoveTexture(aTexture->GetIPDLActor())));
|
||||
mTxn->AddNoSwapEdit(CompositableOperation(
|
||||
aCompositable->GetIPCHandle(),
|
||||
OpRemoveTexture(WrapNotNull(aTexture->GetIPDLActor()))));
|
||||
}
|
||||
|
||||
bool ImageBridgeChild::IsSameProcess() const {
|
||||
|
|
|
@ -350,7 +350,7 @@ void IpcResourceUpdateQueue::PushExternalImageForTexture(
|
|||
MOZ_RELEASE_ASSERT(aTexture->GetIPDLActor()->GetIPCChannel() ==
|
||||
mWriter.WrBridge()->GetIPCChannel());
|
||||
mUpdates.AppendElement(layers::OpPushExternalImageForTexture(
|
||||
aExtId, aKey, aTexture->GetIPDLActor(), aIsUpdate));
|
||||
aExtId, aKey, WrapNotNull(aTexture->GetIPDLActor()), aIsUpdate));
|
||||
}
|
||||
|
||||
bool IpcResourceUpdateQueue::UpdateImageBuffer(
|
||||
|
|
|
@ -391,7 +391,7 @@ void WebRenderBridgeChild::ReleaseCompositable(
|
|||
}
|
||||
|
||||
bool WebRenderBridgeChild::DestroyInTransaction(PTextureChild* aTexture) {
|
||||
return AddOpDestroy(OpDestroy(aTexture));
|
||||
return AddOpDestroy(OpDestroy(WrapNotNull(aTexture)));
|
||||
}
|
||||
|
||||
bool WebRenderBridgeChild::DestroyInTransaction(
|
||||
|
@ -411,9 +411,9 @@ void WebRenderBridgeChild::RemoveTextureFromCompositable(
|
|||
return;
|
||||
}
|
||||
|
||||
AddWebRenderParentCommand(
|
||||
CompositableOperation(aCompositable->GetIPCHandle(),
|
||||
OpRemoveTexture(aTexture->GetIPDLActor())));
|
||||
AddWebRenderParentCommand(CompositableOperation(
|
||||
aCompositable->GetIPCHandle(),
|
||||
OpRemoveTexture(WrapNotNull(aTexture->GetIPDLActor()))));
|
||||
}
|
||||
|
||||
void WebRenderBridgeChild::UseTextures(
|
||||
|
@ -434,9 +434,9 @@ void WebRenderBridgeChild::UseTextures(
|
|||
GetIPCChannel());
|
||||
bool readLocked = t.mTextureClient->OnForwardedToHost();
|
||||
|
||||
textures.AppendElement(TimedTexture(t.mTextureClient->GetIPDLActor(),
|
||||
t.mTimeStamp, t.mPictureRect,
|
||||
t.mFrameID, t.mProducerID, readLocked));
|
||||
textures.AppendElement(TimedTexture(
|
||||
WrapNotNull(t.mTextureClient->GetIPDLActor()), t.mTimeStamp,
|
||||
t.mPictureRect, t.mFrameID, t.mProducerID, readLocked));
|
||||
GetCompositorBridgeChild()->HoldUntilCompositableRefReleasedIfNecessary(
|
||||
t.mTextureClient);
|
||||
}
|
||||
|
|
|
@ -1691,7 +1691,7 @@ void WebRenderBridgeParent::MaybeCaptureScreenPixels() {
|
|||
#endif
|
||||
|
||||
mozilla::ipc::IPCResult WebRenderBridgeParent::RecvGetSnapshot(
|
||||
PTextureParent* aTexture, bool* aNeedsYFlip) {
|
||||
NotNull<PTextureParent*> aTexture, bool* aNeedsYFlip) {
|
||||
*aNeedsYFlip = false;
|
||||
CompositorBridgeParent* cbp = GetRootCompositorBridgeParent();
|
||||
if (mDestroyed || !cbp || cbp->IsPaused()) {
|
||||
|
|
|
@ -135,7 +135,7 @@ class WebRenderBridgeParent final : public PWebRenderBridgeParent,
|
|||
mozilla::ipc::IPCResult RecvParentCommands(
|
||||
const wr::IdNamespace& aIdNamespace,
|
||||
nsTArray<WebRenderParentCommand>&& commands) override;
|
||||
mozilla::ipc::IPCResult RecvGetSnapshot(PTextureParent* aTexture,
|
||||
mozilla::ipc::IPCResult RecvGetSnapshot(NotNull<PTextureParent*> aTexture,
|
||||
bool* aNeedsYFlip) override;
|
||||
|
||||
mozilla::ipc::IPCResult RecvSetLayersObserverEpoch(
|
||||
|
|
|
@ -529,7 +529,8 @@ void WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize) {
|
|||
|
||||
IntRect bounds = ToOutsideIntRect(mTarget->GetClipExtents());
|
||||
bool needsYFlip = false;
|
||||
if (!WrBridge()->SendGetSnapshot(texture->GetIPDLActor(), &needsYFlip)) {
|
||||
if (!WrBridge()->SendGetSnapshot(WrapNotNull(texture->GetIPDLActor()),
|
||||
&needsYFlip)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,9 @@ void Vibrate(const nsTArray<uint32_t>& pattern, WindowIdentifier&& id) {
|
|||
|
||||
WindowIdentifier newID(std::move(id));
|
||||
newID.AppendProcessID();
|
||||
Hal()->SendVibrate(pattern, newID.AsArray(),
|
||||
BrowserChild::GetFrom(newID.GetWindow()));
|
||||
if (BrowserChild* bc = BrowserChild::GetFrom(newID.GetWindow())) {
|
||||
Hal()->SendVibrate(pattern, newID.AsArray(), WrapNotNull(bc));
|
||||
}
|
||||
}
|
||||
|
||||
void CancelVibrate(WindowIdentifier&& id) {
|
||||
|
@ -49,8 +50,9 @@ void CancelVibrate(WindowIdentifier&& id) {
|
|||
|
||||
WindowIdentifier newID(std::move(id));
|
||||
newID.AppendProcessID();
|
||||
Hal()->SendCancelVibrate(newID.AsArray(),
|
||||
BrowserChild::GetFrom(newID.GetWindow()));
|
||||
if (BrowserChild* bc = BrowserChild::GetFrom(newID.GetWindow())) {
|
||||
Hal()->SendCancelVibrate(newID.AsArray(), WrapNotNull(bc));
|
||||
}
|
||||
}
|
||||
|
||||
void EnableBatteryNotifications() { Hal()->SendEnableBatteryNotifications(); }
|
||||
|
@ -151,7 +153,7 @@ class HalParent : public PHalParent,
|
|||
|
||||
virtual mozilla::ipc::IPCResult RecvVibrate(
|
||||
nsTArray<unsigned int>&& pattern, nsTArray<uint64_t>&& id,
|
||||
PBrowserParent* browserParent) override {
|
||||
NotNull<PBrowserParent*> browserParent) override {
|
||||
// We give all content vibration permission.
|
||||
// BrowserParent *browserParent = BrowserParent::GetFrom(browserParent);
|
||||
/* xxxkhuey wtf
|
||||
|
@ -163,7 +165,8 @@ class HalParent : public PHalParent,
|
|||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvCancelVibrate(
|
||||
nsTArray<uint64_t>&& id, PBrowserParent* browserParent) override {
|
||||
nsTArray<uint64_t>&& id,
|
||||
NotNull<PBrowserParent*> browserParent) override {
|
||||
// BrowserParent *browserParent = BrowserParent::GetFrom(browserParent);
|
||||
/* XXXkhuey wtf
|
||||
nsCOMPtr<nsIDOMWindow> window =
|
||||
|
|
|
@ -2549,7 +2549,7 @@ HttpChannelChild::OpenAlternativeOutputStream(const nsACString& aType,
|
|||
stream->AddIPDLReference();
|
||||
|
||||
if (!gNeckoChild->SendPAltDataOutputStreamConstructor(
|
||||
stream, nsCString(aType), aPredictedSize, this)) {
|
||||
stream, nsCString(aType), aPredictedSize, WrapNotNull(this))) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,8 @@ nsresult HttpConnectionMgrParent::AddTransaction(HttpTransactionShell* aTrans,
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
Unused << SendAddTransaction(aTrans->AsHttpTransactionParent(), aPriority);
|
||||
Unused << SendAddTransaction(WrapNotNull(aTrans->AsHttpTransactionParent()),
|
||||
aPriority);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -162,8 +163,8 @@ nsresult HttpConnectionMgrParent::AddTransactionWithStickyConn(
|
|||
}
|
||||
|
||||
Unused << SendAddTransactionWithStickyConn(
|
||||
aTrans->AsHttpTransactionParent(), aPriority,
|
||||
aTransWithStickyConn->AsHttpTransactionParent());
|
||||
WrapNotNull(aTrans->AsHttpTransactionParent()), aPriority,
|
||||
WrapNotNull(aTransWithStickyConn->AsHttpTransactionParent()));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -175,8 +176,8 @@ nsresult HttpConnectionMgrParent::RescheduleTransaction(
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
Unused << SendRescheduleTransaction(aTrans->AsHttpTransactionParent(),
|
||||
aPriority);
|
||||
Unused << SendRescheduleTransaction(
|
||||
WrapNotNull(aTrans->AsHttpTransactionParent()), aPriority);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -189,7 +190,7 @@ void HttpConnectionMgrParent::UpdateClassOfServiceOnTransaction(
|
|||
}
|
||||
|
||||
Unused << SendUpdateClassOfServiceOnTransaction(
|
||||
aTrans->AsHttpTransactionParent(), aClassOfService);
|
||||
WrapNotNull(aTrans->AsHttpTransactionParent()), aClassOfService);
|
||||
}
|
||||
|
||||
nsresult HttpConnectionMgrParent::CancelTransaction(
|
||||
|
@ -200,7 +201,8 @@ nsresult HttpConnectionMgrParent::CancelTransaction(
|
|||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
Unused << SendCancelTransaction(aTrans->AsHttpTransactionParent(), aReason);
|
||||
Unused << SendCancelTransaction(
|
||||
WrapNotNull(aTrans->AsHttpTransactionParent()), aReason);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -248,9 +250,9 @@ nsresult HttpConnectionMgrParent::SpeculativeConnect(
|
|||
auto task = [self, connInfo{std::move(connInfo)},
|
||||
overriderArgs{std::move(overriderArgs)}, aCaps,
|
||||
trans{std::move(trans)}, aFetchHTTPSRR]() {
|
||||
Maybe<AltSvcTransactionParent*> maybeTrans;
|
||||
Maybe<NotNull<AltSvcTransactionParent*>> maybeTrans;
|
||||
if (trans) {
|
||||
maybeTrans.emplace(trans.get());
|
||||
maybeTrans.emplace(WrapNotNull(trans.get()));
|
||||
}
|
||||
Unused << self->SendSpeculativeConnect(connInfo, overriderArgs, aCaps,
|
||||
maybeTrans, aFetchHTTPSRR);
|
||||
|
@ -301,7 +303,8 @@ nsresult HttpConnectionMgrParent::CompleteUpgrade(
|
|||
// We need to link the id and the upgrade listener here, so
|
||||
// WebSocketConnectionParent can connect to the listener correctly later.
|
||||
uint32_t id = AddHttpUpgradeListenerToMap(aUpgradeListener);
|
||||
Unused << SendStartWebSocketConnection(aTrans->AsHttpTransactionParent(), id);
|
||||
Unused << SendStartWebSocketConnection(
|
||||
WrapNotNull(aTrans->AsHttpTransactionParent()), id);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ nsresult HttpTransactionChild::InitInternal(
|
|||
uint32_t pushedStreamId = 0;
|
||||
if (aPushedStreamArg) {
|
||||
HttpTransactionChild* transChild = static_cast<HttpTransactionChild*>(
|
||||
aPushedStreamArg.ref().transWithPushedStream().AsChild());
|
||||
aPushedStreamArg.ref().transWithPushedStream().AsChild().get());
|
||||
transWithPushedStream = transChild->GetHttpTransaction();
|
||||
pushedStreamId = aPushedStreamArg.ref().pushedStreamId();
|
||||
}
|
||||
|
|
|
@ -123,14 +123,13 @@ nsresult HttpTransactionParent::Init(
|
|||
Maybe<H2PushedStreamArg> pushedStreamArg;
|
||||
if (aTransWithPushedStream && aPushedStreamId) {
|
||||
MOZ_ASSERT(aTransWithPushedStream->AsHttpTransactionParent());
|
||||
pushedStreamArg.emplace();
|
||||
pushedStreamArg.ref().transWithPushedStream() =
|
||||
aTransWithPushedStream->AsHttpTransactionParent();
|
||||
pushedStreamArg.ref().pushedStreamId() = aPushedStreamId;
|
||||
pushedStreamArg.emplace(
|
||||
WrapNotNull(aTransWithPushedStream->AsHttpTransactionParent()),
|
||||
aPushedStreamId);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThrottledInputChannel> throttled = do_QueryInterface(mEventsink);
|
||||
Maybe<PInputChannelThrottleQueueParent*> throttleQueue;
|
||||
Maybe<NotNull<PInputChannelThrottleQueueParent*>> throttleQueue;
|
||||
if (throttled) {
|
||||
nsCOMPtr<nsIInputChannelThrottleQueue> queue;
|
||||
nsresult rv = throttled->GetThrottleQueue(getter_AddRefs(queue));
|
||||
|
@ -140,7 +139,7 @@ nsresult HttpTransactionParent::Init(
|
|||
queue.get()));
|
||||
RefPtr<InputChannelThrottleQueueParent> tqParent = do_QueryObject(queue);
|
||||
MOZ_ASSERT(tqParent);
|
||||
throttleQueue.emplace(tqParent.get());
|
||||
throttleQueue.emplace(WrapNotNull(tqParent.get()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -495,7 +495,7 @@ WebSocketChannelChild::AsyncOpenNative(
|
|||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
Maybe<LoadInfoArgs> loadInfoArgs;
|
||||
Maybe<PTransportProviderChild*> transportProvider;
|
||||
Maybe<NotNull<PTransportProviderChild*>> transportProvider;
|
||||
|
||||
if (!mIsServerSide) {
|
||||
uri = aURI;
|
||||
|
@ -509,7 +509,7 @@ WebSocketChannelChild::AsyncOpenNative(
|
|||
nsresult rv = mServerTransportProvider->GetIPCChild(&ipcChild);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
transportProvider = Some(ipcChild);
|
||||
transportProvider = Some(WrapNotNull(ipcChild));
|
||||
}
|
||||
|
||||
// This must be called before sending constructor message.
|
||||
|
|
Загрузка…
Ссылка в новой задаче