Skip to content

Commit

Permalink
Bug 1121673: Use move references in IPDL. r=bent
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey committed Jan 16, 2015
1 parent f9ab710 commit c3bbe77
Show file tree
Hide file tree
Showing 71 changed files with 221 additions and 190 deletions.
2 changes: 1 addition & 1 deletion dom/base/nsContentPermissionHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ RemotePermissionRequest::DoAllow(JS::HandleValue aChoices)
// PContentPermissionRequestChild
bool
RemotePermissionRequest::Recv__delete__(const bool& aAllow,
const nsTArray<PermissionChoice>& aChoices)
InfallibleTArray<PermissionChoice>&& aChoices)
{
if (aAllow && mWindow->IsCurrentInnerWindow()) {
// Use 'undefined' if no choice is provided.
Expand Down
3 changes: 2 additions & 1 deletion dom/base/nsContentPermissionHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class RemotePermissionRequest MOZ_FINAL : public nsISupports

// It will be called when prompt dismissed.
virtual bool Recv__delete__(const bool &aAllow,
const nsTArray<PermissionChoice>& aChoices) MOZ_OVERRIDE;
InfallibleTArray<PermissionChoice>&& aChoices) MOZ_OVERRIDE;

void IPDLAddRef()
{
Expand Down Expand Up @@ -146,3 +146,4 @@ class RemotePermissionRequest MOZ_FINAL : public nsISupports
};

#endif // nsContentPermissionHelper_h

4 changes: 2 additions & 2 deletions dom/indexedDB/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3036,7 +3036,7 @@ class Database MOZ_FINAL
virtual bool
RecvPBackgroundIDBTransactionConstructor(
PBackgroundIDBTransactionParent* aActor,
const nsTArray<nsString>& aObjectStoreNames,
InfallibleTArray<nsString>&& aObjectStoreNames,
const Mode& aMode)
MOZ_OVERRIDE;

Expand Down Expand Up @@ -6526,7 +6526,7 @@ Database::AllocPBackgroundIDBTransactionParent(
bool
Database::RecvPBackgroundIDBTransactionConstructor(
PBackgroundIDBTransactionParent* aActor,
const nsTArray<nsString>& aObjectStoreNames,
InfallibleTArray<nsString>&& aObjectStoreNames,
const Mode& aMode)
{
AssertIsOnBackgroundThread();
Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/ContentBridgeChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ ContentBridgeChild::DeferredDestroy()
bool
ContentBridgeChild::RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
return nsIContentChild::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
return nsIContentChild::RecvAsyncMessage(aMsg, aData, Move(aCpows), aPrincipal);
}

PBlobChild*
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/ContentBridgeChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ContentBridgeChild MOZ_FINAL : public PContentBridgeChild

virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;

virtual PBlobChild*
Expand Down
10 changes: 6 additions & 4 deletions dom/ipc/ContentBridgeParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,22 @@ ContentBridgeParent::DeferredDestroy()
bool
ContentBridgeParent::RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals)
{
return nsIContentParent::RecvSyncMessage(aMsg, aData, aCpows, aPrincipal, aRetvals);
return nsIContentParent::RecvSyncMessage(aMsg, aData, Move(aCpows),
aPrincipal, aRetvals);
}

bool
ContentBridgeParent::RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
return nsIContentParent::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
return nsIContentParent::RecvAsyncMessage(aMsg, aData, Move(aCpows),
aPrincipal);
}

PBlobParent*
Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/ContentBridgeParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class ContentBridgeParent : public PContentBridgeParent
protected:
virtual bool RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<jsipc::CpowEntry>& aCpows,
InfallibleTArray<jsipc::CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;

virtual jsipc::PJavaScriptParent* AllocPJavaScriptParent() MOZ_OVERRIDE;
Expand Down
14 changes: 7 additions & 7 deletions dom/ipc/ContentChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1720,9 +1720,9 @@ ContentChild::DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor)
}

bool
ContentChild::RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
const InfallibleTArray<ResourceMapping>& resources,
const InfallibleTArray<OverrideMapping>& overrides,
ContentChild::RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages,
InfallibleTArray<ResourceMapping>&& resources,
InfallibleTArray<OverrideMapping>&& overrides,
const nsCString& locale,
const bool& reset)
{
Expand Down Expand Up @@ -1905,7 +1905,7 @@ ContentChild::RecvNotifyVisited(const URIParams& aURI)
bool
ContentChild::RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::sChildProcessManager;
Expand Down Expand Up @@ -1942,7 +1942,7 @@ ContentChild::RecvGeolocationError(const uint16_t& errorCode)
}

bool
ContentChild::RecvUpdateDictionaryList(const InfallibleTArray<nsString>& aDictionaries)
ContentChild::RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries)
{
mAvailableDictionaries = aDictionaries;
mozInlineSpellChecker::UpdateCanEnableInlineSpellChecking();
Expand Down Expand Up @@ -2443,8 +2443,8 @@ ContentChild::RecvOnAppThemeChanged()
bool
ContentChild::RecvStartProfiler(const uint32_t& aEntries,
const double& aInterval,
const nsTArray<nsCString>& aFeatures,
const nsTArray<nsCString>& aThreadNameFilters)
nsTArray<nsCString>&& aFeatures,
nsTArray<nsCString>&& aThreadNameFilters)
{
nsTArray<const char*> featureArray;
for (size_t i = 0; i < aFeatures.Length(); ++i) {
Expand Down
14 changes: 7 additions & 7 deletions dom/ipc/ContentChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ class ContentChild : public PContentChild
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() MOZ_OVERRIDE;
virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) MOZ_OVERRIDE;

virtual bool RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
const InfallibleTArray<ResourceMapping>& resources,
const InfallibleTArray<OverrideMapping>& overrides,
virtual bool RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages,
InfallibleTArray<ResourceMapping>&& resources,
InfallibleTArray<OverrideMapping>&& overrides,
const nsCString& locale,
const bool& reset) MOZ_OVERRIDE;
virtual bool RecvRegisterChromeItem(const ChromeRegistryItem& item) MOZ_OVERRIDE;
Expand Down Expand Up @@ -306,14 +306,14 @@ class ContentChild : public PContentChild

virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;

virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) MOZ_OVERRIDE;

virtual bool RecvGeolocationError(const uint16_t& errorCode) MOZ_OVERRIDE;

virtual bool RecvUpdateDictionaryList(const InfallibleTArray<nsString>& aDictionaries) MOZ_OVERRIDE;
virtual bool RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries) MOZ_OVERRIDE;

virtual bool RecvAddPermission(const IPC::Permission& permission) MOZ_OVERRIDE;

Expand Down Expand Up @@ -377,8 +377,8 @@ class ContentChild : public PContentChild

virtual bool RecvStartProfiler(const uint32_t& aEntries,
const double& aInterval,
const nsTArray<nsCString>& aFeatures,
const nsTArray<nsCString>& aThreadNameFilters) MOZ_OVERRIDE;
nsTArray<nsCString>&& aFeatures,
nsTArray<nsCString>&& aThreadNameFilters) MOZ_OVERRIDE;
virtual bool RecvStopProfiler() MOZ_OVERRIDE;
virtual bool RecvGetProfile(nsCString* aProfile) MOZ_OVERRIDE;
virtual bool RecvShutdown() MOZ_OVERRIDE;
Expand Down
27 changes: 15 additions & 12 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ class MemoryReportRequestParent : public PMemoryReportRequestParent

virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

virtual bool Recv__delete__(const uint32_t& aGeneration, const InfallibleTArray<MemoryReport>& aReport) MOZ_OVERRIDE;
virtual bool Recv__delete__(const uint32_t& aGeneration, InfallibleTArray<MemoryReport>&& aReport) MOZ_OVERRIDE;

private:
ContentParent* Owner()
{
Expand All @@ -408,7 +409,8 @@ MemoryReportRequestParent::ActorDestroy(ActorDestroyReason aWhy)
}

bool
MemoryReportRequestParent::Recv__delete__(const uint32_t& generation, const InfallibleTArray<MemoryReport>& childReports)
MemoryReportRequestParent::Recv__delete__(const uint32_t& generation,
nsTArray<MemoryReport>&& childReports)
{
nsRefPtr<nsMemoryReporterManager> mgr =
nsMemoryReporterManager::GetOrCreate();
Expand Down Expand Up @@ -2140,7 +2142,7 @@ FindFdProtocolFdMapping(const nsTArray<ProtocolFdMapping>& aFds,
ContentParent::ContentParent(ContentParent* aTemplate,
const nsAString& aAppManifestURL,
base::ProcessHandle aPid,
const nsTArray<ProtocolFdMapping>& aFds)
InfallibleTArray<ProtocolFdMapping>&& aFds)
: mAppManifestURL(aAppManifestURL)
, mIsForBrowser(false)
, mIsNuwaProcess(false)
Expand Down Expand Up @@ -2714,7 +2716,7 @@ ContentParent::RecvNuwaWaitForFreeze()

bool
ContentParent::RecvAddNewProcess(const uint32_t& aPid,
const InfallibleTArray<ProtocolFdMapping>& aFds)
InfallibleTArray<ProtocolFdMapping>&& aFds)
{
#ifdef MOZ_NUWA_PROCESS
if (!IsNuwaProcess()) {
Expand All @@ -2730,7 +2732,7 @@ ContentParent::RecvAddNewProcess(const uint32_t& aPid,
content = new ContentParent(this,
MAGIC_PREALLOCATED_APP_MANIFEST_URL,
aPid,
aFds);
Move(aFds));
content->Init();

size_t numNuwaPrefUpdates = sNuwaPrefUpdates ?
Expand Down Expand Up @@ -3902,32 +3904,33 @@ ContentParent::RecvCloseAlert(const nsString& aName,
bool
ContentParent::RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals)
{
return nsIContentParent::RecvSyncMessage(aMsg, aData, aCpows, aPrincipal,
aRetvals);
return nsIContentParent::RecvSyncMessage(aMsg, aData, Move(aCpows),
aPrincipal, aRetvals);
}

bool
ContentParent::RecvRpcMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals)
{
return nsIContentParent::RecvRpcMessage(aMsg, aData, aCpows, aPrincipal,
return nsIContentParent::RecvRpcMessage(aMsg, aData, Move(aCpows), aPrincipal,
aRetvals);
}

bool
ContentParent::RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
return nsIContentParent::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
return nsIContentParent::RecvAsyncMessage(aMsg, aData, Move(aCpows),
aPrincipal);
}

bool
Expand Down
10 changes: 5 additions & 5 deletions dom/ipc/ContentParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class ContentParent MOZ_FINAL : public PContentParent
ContentParent(ContentParent* aTemplate,
const nsAString& aAppManifestURL,
base::ProcessHandle aPid,
const nsTArray<ProtocolFdMapping>& aFds);
InfallibleTArray<ProtocolFdMapping>&& aFds);
#endif

// The common initialization for the constructors.
Expand Down Expand Up @@ -642,17 +642,17 @@ class ContentParent MOZ_FINAL : public PContentParent

virtual bool RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
virtual bool RecvRpcMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;

virtual bool RecvFilePathUpdateNotify(const nsString& aType,
Expand Down Expand Up @@ -713,7 +713,7 @@ class ContentParent MOZ_FINAL : public PContentParent
virtual bool RecvNuwaWaitForFreeze() MOZ_OVERRIDE;

virtual bool RecvAddNewProcess(const uint32_t& aPid,
const InfallibleTArray<ProtocolFdMapping>& aFds) MOZ_OVERRIDE;
InfallibleTArray<ProtocolFdMapping>&& aFds) MOZ_OVERRIDE;

virtual bool RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) MOZ_OVERRIDE;

Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/FilePickerParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
const bool& aAddToRecentDocs,
const nsString& aDefaultFile,
const nsString& aDefaultExtension,
const InfallibleTArray<nsString>& aFilters,
const InfallibleTArray<nsString>& aFilterNames,
InfallibleTArray<nsString>&& aFilters,
InfallibleTArray<nsString>&& aFilterNames,
const nsString& aDisplayDirectory)
{
if (!CreateFilePicker()) {
Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/FilePickerParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class FilePickerParent : public PFilePickerParent
const bool& aAddToRecentDocs,
const nsString& aDefaultFile,
const nsString& aDefaultExtension,
const InfallibleTArray<nsString>& aFilters,
const InfallibleTArray<nsString>& aFilterNames,
InfallibleTArray<nsString>&& aFilters,
InfallibleTArray<nsString>&& aFilterNames,
const nsString& aDisplayDirectory) MOZ_OVERRIDE;

virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/TabChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,7 @@ TabChild::RecvLoadRemoteScript(const nsString& aURL, const bool& aRunInGlobalSco
bool
TabChild::RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal)
{
if (mTabChildGlobal) {
Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/TabChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class TabChild MOZ_FINAL : public TabChildBase,
const bool& aRunInGlobalScope) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
InfallibleTArray<CpowEntry>&& aCpows,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;

virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) MOZ_OVERRIDE;
Expand Down
Loading

0 comments on commit c3bbe77

Please sign in to comment.