Skip to content

Commit

Permalink
Backed out changeset 2be475352375 (bug 1689191) for causing build bus…
Browse files Browse the repository at this point in the history
…tages on RemoteLazyInputStreamThread.cpp. CLOSED TREE
  • Loading branch information
Iulian Moraru committed Jun 24, 2021
1 parent 7a2e51e commit dc35ffd
Show file tree
Hide file tree
Showing 23 changed files with 566 additions and 90 deletions.
30 changes: 30 additions & 0 deletions dom/ipc/ContentChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ void ContentChild::InitXPCOM(

GfxInfoBase::SetFeatureStatus(std::move(aXPCOMInit.gfxFeatureStatus()));

DataStorage::SetCachedStorageEntries(aXPCOMInit.dataStorage());

// Initialize the RemoteDecoderManager thread and its associated PBackground
// channel.
RemoteDecoderManagerChild::Init();
Expand Down Expand Up @@ -2261,6 +2263,34 @@ mozilla::ipc::IPCResult ContentChild::RecvCollectPerfStatsJSON(
return IPC_OK();
}

mozilla::ipc::IPCResult ContentChild::RecvDataStoragePut(
const nsString& aFilename, const DataStorageItem& aItem) {
RefPtr<DataStorage> storage = DataStorage::GetFromRawFileName(aFilename);
if (storage) {
storage->Put(aItem.key(), aItem.value(), aItem.type());
}
return IPC_OK();
}

mozilla::ipc::IPCResult ContentChild::RecvDataStorageRemove(
const nsString& aFilename, const nsCString& aKey,
const DataStorageType& aType) {
RefPtr<DataStorage> storage = DataStorage::GetFromRawFileName(aFilename);
if (storage) {
storage->Remove(aKey, aType);
}
return IPC_OK();
}

mozilla::ipc::IPCResult ContentChild::RecvDataStorageClear(
const nsString& aFilename) {
RefPtr<DataStorage> storage = DataStorage::GetFromRawFileName(aFilename);
if (storage) {
storage->Clear();
}
return IPC_OK();
}

mozilla::ipc::IPCResult ContentChild::RecvNotifyAlertsObserver(
const nsCString& aType, const nsString& aData) {
nsTArray<nsCOMPtr<nsIObserver>> observersToNotify;
Expand Down
9 changes: 9 additions & 0 deletions dom/ipc/ContentChild.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ class ContentChild final : public PContentChild,
mozilla::ipc::IPCResult RecvCollectPerfStatsJSON(
CollectPerfStatsJSONResolver&& aResolver);

mozilla::ipc::IPCResult RecvDataStoragePut(const nsString& aFilename,
const DataStorageItem& aItem);

mozilla::ipc::IPCResult RecvDataStorageRemove(const nsString& aFilename,
const nsCString& aKey,
const DataStorageType& aType);

mozilla::ipc::IPCResult RecvDataStorageClear(const nsString& aFilename);

mozilla::ipc::IPCResult RecvNotifyAlertsObserver(const nsCString& aType,
const nsString& aData);

Expand Down
3 changes: 3 additions & 0 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "mozilla/BenchmarkStorageParent.h"
#include "mozilla/ContentBlockingUserInteraction.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/DataStorage.h"
#include "mozilla/FOGIPC.h"
#include "mozilla/GlobalStyleSheetCache.h"
#include "mozilla/HangDetails.h"
Expand Down Expand Up @@ -2931,6 +2932,8 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {
widget::WinContentSystemParameters::GetSingleton()->GetParentValues();
#endif

DataStorage::GetAllChildProcessData(xpcomInit.dataStorage());

// Send the dynamic scalar definitions to the new process.
TelemetryIPC::GetDynamicScalarDefinitions(xpcomInit.dynamicScalarDefs());

Expand Down
6 changes: 6 additions & 0 deletions dom/ipc/PContent.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ include LookAndFeelTypes;
include protocol PSandboxTesting;
#endif

include "ipc/DataStorageIPCUtils.h";
include "ipc/MediaControlIPC.h";
include "mozilla/AntiTrackingIPCUtils.h";
include "mozilla/GfxMessageUtils.h";
Expand Down Expand Up @@ -339,6 +340,7 @@ struct XPCOMInitData
GfxVarUpdate[] gfxNonDefaultVarUpdates;
ContentDeviceData contentDeviceData;
GfxInfoFeatureStatus[] gfxFeatureStatus;
DataStorageEntry[] dataStorage;
nsCString[] appLocales;
nsCString[] requestedLocales;
DynamicScalarDefinition[] dynamicScalarDefs;
Expand Down Expand Up @@ -613,6 +615,10 @@ child:
async UpdatePerfStatsCollectionMask(uint64_t aMask);
async CollectPerfStatsJSON() returns (nsCString aStats);

async DataStoragePut(nsString aFilename, DataStorageItem aItem);
async DataStorageRemove(nsString aFilename, nsCString aKey, DataStorageType aType);
async DataStorageClear(nsString aFilename);

async NotifyAlertsObserver(nsCString topic, nsString data);

async GeolocationUpdate(nsIDOMGeoPosition aPosition);
Expand Down
7 changes: 1 addition & 6 deletions netwerk/base/nsNetUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
#include "nsNetUtil.h"

#include "mozilla/Atomics.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Components.h"
#include "mozilla/Encoding.h"
#include "mozilla/LoadContext.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Monitor.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/StaticPrefs_privacy.h"
Expand Down Expand Up @@ -2833,11 +2833,6 @@ nsresult NS_ShouldSecureUpgrade(
const OriginAttributes& aOriginAttributes, bool& aShouldUpgrade,
std::function<void(bool, nsresult)>&& aResultCallback,
bool& aWillCallback) {
MOZ_ASSERT(XRE_IsParentProcess());
if (!XRE_IsParentProcess()) {
return NS_ERROR_NOT_AVAILABLE;
}

aWillCallback = false;

// Even if we're in private browsing mode, we still enforce existing STS
Expand Down
6 changes: 3 additions & 3 deletions netwerk/protocol/http/AlternateServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ void AltSvcCache::EnsureStorageInited() {
return;
}

if (NS_FAILED(mStorage->Init())) {
if (NS_FAILED(mStorage->Init(nullptr))) {
mStorage = nullptr;
} else {
initialized = true;
Expand Down Expand Up @@ -1251,11 +1251,11 @@ void AltSvcCache::ClearAltServiceMappings() {
nsresult AltSvcCache::GetAltSvcCacheKeys(nsTArray<nsCString>& value) {
MOZ_ASSERT(NS_IsMainThread());
if (gHttpHandler->AllowAltSvc() && mStorage) {
nsTArray<DataStorageItem> items;
nsTArray<mozilla::psm::DataStorageItem> items;
mStorage->GetAll(&items);

for (const auto& item : items) {
value.AppendElement(item.key);
value.AppendElement(item.key());
}
}
return NS_OK;
Expand Down
Loading

0 comments on commit dc35ffd

Please sign in to comment.