Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE

This commit is contained in:
Razvan Maries 2019-01-16 19:09:08 +02:00
Родитель 17fc46877b 4c67bec411
Коммит 3a732b5669
155 изменённых файлов: 5926 добавлений и 1515 удалений

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

@ -135,8 +135,8 @@ HandlerProvider::GetHandlerPayloadSize(
MOZ_ASSERT(mscom::IsCurrentThreadMTA());
if (!IsTargetInterfaceCacheable()) {
*aOutPayloadSize = mscom::StructToStream::GetEmptySize();
return S_OK;
// No handler, so no payload for this instance.
return E_NOTIMPL;
}
MutexAutoLock lock(mMutex);
@ -378,6 +378,11 @@ bool HandlerProvider::IsTargetInterfaceCacheable() {
HRESULT
HandlerProvider::WriteHandlerPayload(NotNull<mscom::IInterceptor*> aInterceptor,
NotNull<IStream*> aStream) {
if (!IsTargetInterfaceCacheable()) {
// No handler, so no payload for this instance.
return E_NOTIMPL;
}
MutexAutoLock lock(mMutex);
if (!mSerializer || !(*mSerializer)) {
@ -435,6 +440,13 @@ HandlerProvider::GetEffectiveOutParamIid(REFIID aCallIid, ULONG aCallMethod) {
return NEWEST_IA2_IID;
}
// IAccessible::get_accSelection
if ((aCallIid == IID_IAccessible || aCallIid == IID_IAccessible2 ||
aCallIid == IID_IAccessible2_2 || aCallIid == IID_IAccessible2_3) &&
aCallMethod == 19) {
return IID_IEnumVARIANT;
}
MOZ_ASSERT(false);
return IID_IUnknown;
}

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

@ -4155,10 +4155,8 @@ const BrowserSearch = {
* allowed values.
* @param type
* (string) Indicates how the user selected the search item.
* @param where
* (string) Where was the search link opened (e.g. new tab, current tab, ..).
*/
recordOneoffSearchInTelemetry(engine, source, type, where) {
recordOneoffSearchInTelemetry(engine, source, type) {
try {
const details = {type, isOneOff: true};
BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details);

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

@ -699,8 +699,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
[url, postData] =
this._parseAndRecordSearchEngineLoad(selectedOneOff.engine,
this.oneOffSearchQuery,
event, where,
openUILinkParams);
event);
} else if (action) {
switch (action.type) {
case "visiturl":
@ -776,8 +775,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
action.params.engineName,
action.params.searchSuggestion || action.params.searchQuery,
event,
where,
openUILinkParams,
actionDetails
);
break;
@ -904,8 +901,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<parameter name="engineOrEngineName"/>
<parameter name="query"/>
<parameter name="event"/>
<parameter name="openUILinkWhere"/>
<parameter name="openUILinkParams"/>
<parameter name="searchActionDetails"/>
<body><![CDATA[
let engine =
@ -913,7 +908,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
Services.search.getEngineByName(engineOrEngineName) :
engineOrEngineName;
let isOneOff = this.popup.oneOffSearchButtons
.maybeRecordTelemetry(event, openUILinkWhere, openUILinkParams);
.maybeRecordTelemetry(event);
// Infer the type of the event which triggered the search.
let eventType = "unknown";
if (event instanceof KeyboardEvent) {

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

@ -64,6 +64,7 @@
flex="1">&contentBlocking.title;</label>
<toolbarbutton id="tracking-protection-preferences-button"
class="identity-popup-preferences-button subviewbutton"
tooltiptext="&identity.contentBlockingPreferences.tooltip;"
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
</hbox>

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

@ -987,13 +987,9 @@ class SearchOneOffs {
*
* @param {Event} aEvent
* An event, like a click on a one-off button.
* @param {string} aOpenUILinkWhere
* The "where" passed to openUILink.
* @param {object} aOpenUILinkParams
* The "params" passed to openUILink.
* @returns {boolean} True if telemetry was recorded and false if not.
*/
maybeRecordTelemetry(aEvent, aOpenUILinkWhere, aOpenUILinkParams) {
maybeRecordTelemetry(aEvent) {
if (!aEvent) {
return false;
}
@ -1029,11 +1025,7 @@ class SearchOneOffs {
source += "-" + this.telemetryOrigin;
}
let tabBackground = aOpenUILinkWhere == "tab" &&
aOpenUILinkParams &&
aOpenUILinkParams.inBackground;
let where = tabBackground ? "tab-background" : aOpenUILinkWhere;
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type, where);
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type);
return true;
}

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

@ -304,7 +304,7 @@ class MozSearchbar extends MozXULElement {
if (!selection || (selection.index == -1)) {
oneOffRecorded = this.textbox.popup.oneOffButtons
.maybeRecordTelemetry(aEvent, aWhere, aParams);
.maybeRecordTelemetry(aEvent);
if (!oneOffRecorded) {
let source = "unknown";
let type = "unknown";
@ -325,8 +325,7 @@ class MozSearchbar extends MozXULElement {
if (!aEngine) {
aEngine = this.currentEngine;
}
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type,
aWhere);
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type);
}
}

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

@ -29,7 +29,7 @@ class UrlbarView {
this._mainContainer = this.panel.querySelector(".urlbarView-body-inner");
this._rows = this.panel.querySelector(".urlbarView-results");
this._rows.addEventListener("click", this);
this._rows.addEventListener("mouseup", this);
// For the horizontal fade-out effect, set the overflow attribute on result
// rows when they overflow.
@ -346,7 +346,12 @@ class UrlbarView {
}
}
_on_click(event) {
_on_mouseup(event) {
if (event.button == 2) {
// Ignore right clicks.
return;
}
let row = event.target;
while (!row.classList.contains("urlbarView-row")) {
row = row.parentNode;

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

@ -878,6 +878,8 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY identity.permissionsEmpty "You have not granted this site any special permissions.">
<!ENTITY identity.permissionsReloadHint "You may need to reload the page for changes to apply.">
<!ENTITY identity.permissionsPreferences.tooltip "Open Permissions Preferences">
<!ENTITY identity.contentBlockingPreferences.tooltip "Open Content Blocking Preferences">
<!-- Name for the tabs toolbar as spoken by screen readers.
The word "toolbar" is appended automatically and should not be contained below! -->

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

@ -19,8 +19,8 @@ inline HTMLBodyElement* Document::GetBodyElement() {
}
template <typename T>
size_t Document::FindDocStyleSheetInsertionPoint(
const nsTArray<T>& aDocSheets, const StyleSheet& aSheet) {
size_t Document::FindDocStyleSheetInsertionPoint(const nsTArray<T>& aDocSheets,
const StyleSheet& aSheet) {
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
// lowest index first

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

@ -31,7 +31,7 @@ namespace mozilla {
namespace dom {
class Document;
class Element;
}
} // namespace dom
/**
* Right now our identifier map entries contain information for 'name'

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

@ -175,8 +175,8 @@ class RemoteObjectProxy : public RemoteObjectProxyBase {
using RemoteObjectProxyBase::RemoteObjectProxyBase;
private:
bool DefinePropertiesAndFunctions(
JSContext* aCx, JS::Handle<JSObject*> aHolder) const final {
bool DefinePropertiesAndFunctions(JSContext* aCx,
JS::Handle<JSObject*> aHolder) const final {
return JS_DefineProperties(aCx, aHolder, P) &&
JS_DefineFunctions(aCx, aHolder, F);
}

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

@ -823,24 +823,24 @@ void GetEnumAttr(nsGenericHTMLElement* aContent, nsAtom* atom,
rv = aForm->GetActionURL(getter_AddRefs(actionURL), aOriginatingElement);
NS_ENSURE_SUCCESS(rv, rv);
// Check if CSP allows this form-action
nsCOMPtr<nsIContentSecurityPolicy> csp;
rv = aForm->NodePrincipal()->GetCsp(getter_AddRefs(csp));
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
bool permitsFormAction = true;
// Check if CSP allows this form-action
nsCOMPtr<nsIContentSecurityPolicy> csp;
rv = aForm->NodePrincipal()->GetCsp(getter_AddRefs(csp));
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
bool permitsFormAction = true;
// form-action is only enforced if explicitly defined in the
// policy - do *not* consult default-src, see:
// http://www.w3.org/TR/CSP2/#directive-default-src
rv = csp->Permits(aForm, nullptr /* nsICSPEventListener */, actionURL,
nsIContentSecurityPolicy::FORM_ACTION_DIRECTIVE, true,
&permitsFormAction);
NS_ENSURE_SUCCESS(rv, rv);
if (!permitsFormAction) {
return NS_ERROR_CSP_FORM_ACTION_VIOLATION;
}
}
// form-action is only enforced if explicitly defined in the
// policy - do *not* consult default-src, see:
// http://www.w3.org/TR/CSP2/#directive-default-src
rv = csp->Permits(aForm, nullptr /* nsICSPEventListener */, actionURL,
nsIContentSecurityPolicy::FORM_ACTION_DIRECTIVE, true,
&permitsFormAction);
NS_ENSURE_SUCCESS(rv, rv);
if (!permitsFormAction) {
return NS_ERROR_CSP_FORM_ACTION_VIOLATION;
}
}
// Get target
// The target is the originating element formtarget attribute if the element

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

@ -750,7 +750,8 @@ class HTMLInputElement final : public nsGenericHTMLFormElementWithState,
/*
* This locates the inner datetimebox UA Widget element and only the
* UA Widget
* element. This should fold into GetDateTimeBoxElement() when the XBL binding is removed.
* element. This should fold into GetDateTimeBoxElement() when the XBL binding
* is removed.
*/
Element* GetDateTimeBoxElementInUAWidget();

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

@ -33,6 +33,7 @@
#include "mozilla/SnappyUncompressInputStream.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/storage.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Unused.h"
#include "mozilla/UniquePtrExtensions.h"
#include "mozilla/dom/ContentParent.h"
@ -8329,6 +8330,17 @@ nsresult DeserializeStructuredCloneFile(FileManager* aFileManager,
RefPtr<FileInfo> fileInfo = aFileManager->GetFileInfo(id);
MOZ_ASSERT(fileInfo);
// XXX In bug 1432133, for some reasons FileInfo object cannot be got. This
// is just a short-term fix, and we are working on finding the real cause
// in bug 1519859.
if (!fileInfo) {
IDB_WARNING(
"Corrupt structured clone data detected in IndexedDB. Failing the "
"database request. Bug 1519859 will address this problem.");
Telemetry::ScalarAdd(Telemetry::ScalarID::IDB_FAILURE_FILEINFO_ERROR, 1);
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
}
aFile->mFileInfo.swap(fileInfo);
aFile->mType = type;

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

@ -54,8 +54,8 @@ NS_IMPL_ISUPPORTS(MemoryReportRequestClient, nsIRunnable)
const ReportCallback& aReportCallback,
const FinishCallback& aFinishCallback) {
RefPtr<MemoryReportRequestClient> request = new MemoryReportRequestClient(
aGeneration, aAnonymize, aDMDFile, aProcessString,
aReportCallback, aFinishCallback);
aGeneration, aAnonymize, aDMDFile, aProcessString, aReportCallback,
aFinishCallback);
DebugOnly<nsresult> rv;
if (aMinimizeMemoryUsage) {
@ -127,8 +127,7 @@ class FinishReportingCallback final : public nsIFinishReportingCallback {
explicit FinishReportingCallback(uint32_t aGeneration,
const FinishCallback& aFinishCallback)
: mGeneration(aGeneration),
mFinishCallback(aFinishCallback) {}
: mGeneration(aGeneration), mFinishCallback(aFinishCallback) {}
NS_IMETHOD Callback(nsISupports* aUnused) override {
return mFinishCallback(mGeneration) ? NS_OK : NS_ERROR_FAILURE;

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

@ -4180,54 +4180,54 @@ SourceListener::InitializeAsync() {
LOG("started all sources");
aHolder.Resolve(true, __func__);
})
->Then(GetMainThreadSerialEventTarget(), __func__,
[self = RefPtr<SourceListener>(this), this]() {
if (mStopped) {
// We were shut down during the async init
return SourceListenerPromise::CreateAndResolve(true, __func__);
}
->Then(
GetMainThreadSerialEventTarget(), __func__,
[self = RefPtr<SourceListener>(this), this]() {
if (mStopped) {
// We were shut down during the async init
return SourceListenerPromise::CreateAndResolve(true, __func__);
}
for (DeviceState* state :
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
if (!state) {
continue;
}
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
for (DeviceState* state :
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
if (!state) {
continue;
}
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
state->mDeviceEnabled = true;
state->mTrackEnabled = true;
state->mTrackEnabledTime = TimeStamp::Now();
state->mDeviceEnabled = true;
state->mTrackEnabled = true;
state->mTrackEnabledTime = TimeStamp::Now();
if (state == mVideoDeviceState.get() &&
!mStream->IsDestroyed()) {
mStream->SetPullingEnabled(kVideoTrack, true);
}
}
return SourceListenerPromise::CreateAndResolve(true, __func__);
},
[self = RefPtr<SourceListener>(this),
this](RefPtr<MediaMgrError>&& aResult) {
if (mStopped) {
return SourceListenerPromise::CreateAndReject(
std::move(aResult), __func__);
}
if (state == mVideoDeviceState.get() && !mStream->IsDestroyed()) {
mStream->SetPullingEnabled(kVideoTrack, true);
}
}
return SourceListenerPromise::CreateAndResolve(true, __func__);
},
[self = RefPtr<SourceListener>(this),
this](RefPtr<MediaMgrError>&& aResult) {
if (mStopped) {
return SourceListenerPromise::CreateAndReject(std::move(aResult),
__func__);
}
for (DeviceState* state :
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
if (!state) {
continue;
}
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
for (DeviceState* state :
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
if (!state) {
continue;
}
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
state->mStopped = true;
}
return SourceListenerPromise::CreateAndReject(std::move(aResult),
__func__);
});
state->mStopped = true;
}
return SourceListenerPromise::CreateAndReject(std::move(aResult),
__func__);
});
}
void SourceListener::Stop() {

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

@ -94,7 +94,7 @@ TEST(MP4Metadata, EmptyStream) {
TEST(MoofParser, EmptyStream) {
RefPtr<ByteStream> stream = new TestStream(nullptr, 0);
MoofParser parser(stream, 0, false);
MoofParser parser(stream, 0, false, true);
EXPECT_EQ(0u, parser.mOffset);
EXPECT_TRUE(parser.ReachedEnd());
@ -404,7 +404,7 @@ TEST(MoofParser, test_case_mp4) {
RefPtr<ByteStream> stream =
new TestStream(buffer.Elements(), buffer.Length());
MoofParser parser(stream, 0, false);
MoofParser parser(stream, 0, false, true);
EXPECT_EQ(0u, parser.mOffset) << tests[test].mFilename;
EXPECT_FALSE(parser.ReachedEnd()) << tests[test].mFilename;
EXPECT_TRUE(parser.mInitRange.IsEmpty()) << tests[test].mFilename;

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

@ -526,7 +526,8 @@ class MP4ContainerParser : public ContainerParser,
// consumers of ParseStartAndEndTimestamps to add their timestamp offset
// manually. This allows the ContainerParser to be shared across different
// timestampOffsets.
mParser = new MoofParser(mStream, 0, /* aIsAudio = */ false);
mParser = new MoofParser(mStream, 0, /* aIsAudio = */ false,
/* aIsMultitrackParser */ true);
DDLINKCHILD("parser", mParser.get());
mInitData = new MediaByteBuffer();
mCompleteInitSegmentRange = MediaByteRange();

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

@ -460,7 +460,7 @@ MP4Metadata::ResultAndIndice MP4Metadata::GetTrackIndice(
/*static*/ MP4Metadata::ResultAndByteBuffer MP4Metadata::Metadata(
ByteStream* aSource) {
auto parser = mozilla::MakeUnique<MoofParser>(aSource, 0, false);
auto parser = mozilla::MakeUnique<MoofParser>(aSource, 0, false, true);
RefPtr<mozilla::MediaByteBuffer> buffer = parser->Metadata();
if (!buffer) {
return {MediaResult(NS_ERROR_DOM_MEDIA_METADATA_ERR,

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

@ -55,7 +55,7 @@ bool MoofParser::RebuildFragmentedIndex(BoxContext& aContext) {
ParseMoov(box);
} else if (box.IsType("moof")) {
Moof moof(box, mTrex, mMvhd, mMdhd, mEdts, mSinf, &mLastDecodeTime,
mIsAudio);
mIsAudio, mIsMultitrackParser);
if (!moof.IsValid() && !box.Next().IsAvailable()) {
// Moof isn't valid abort search for now.
@ -227,11 +227,11 @@ void MoofParser::ParseTrak(Box& aBox) {
if (box.IsType("tkhd")) {
tkhd = Tkhd(box);
} else if (box.IsType("mdia")) {
if (!mTrex.mTrackId || tkhd.mTrackId == mTrex.mTrackId) {
if (mIsMultitrackParser || tkhd.mTrackId == mTrex.mTrackId) {
ParseMdia(box, tkhd);
}
} else if (box.IsType("edts") &&
(!mTrex.mTrackId || tkhd.mTrackId == mTrex.mTrackId)) {
(mIsMultitrackParser || tkhd.mTrackId == mTrex.mTrackId)) {
mEdts = Edts(box);
}
}
@ -251,12 +251,8 @@ void MoofParser::ParseMvex(Box& aBox) {
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
if (box.IsType("trex")) {
Trex trex = Trex(box);
if (!mTrex.mTrackId || trex.mTrackId == mTrex.mTrackId) {
auto trackId = mTrex.mTrackId;
if (mIsMultitrackParser || trex.mTrackId == mTrex.mTrackId) {
mTrex = trex;
// Keep the original trackId, as should it be 0 we want to continue
// parsing all tracks.
mTrex.mTrackId = trackId;
}
}
}
@ -299,8 +295,8 @@ void MoofParser::ParseStbl(Box& aBox) {
}
void MoofParser::ParseStsd(Box& aBox) {
if (mTrex.mTrackId == 0) {
// If mTrex.mTrackId is 0, then the parser is being used to read multiple
if (mIsMultitrackParser) {
// If mIsMultitrackParser, then the parser is being used to read multiple
// tracks metadata, and it is not a sane operation to try and map multiple
// sample description boxes, from different tracks, onto the parser, which
// is modeled around storing metadata for a single track.
@ -353,12 +349,14 @@ class CtsComparator {
};
Moof::Moof(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts,
Sinf& aSinf, uint64_t* aDecodeTime, bool aIsAudio)
Sinf& aSinf, uint64_t* aDecodeTime, bool aIsAudio,
bool aIsMultitrackParser)
: mRange(aBox.Range()), mTfhd(aTrex), mMaxRoundingError(35000) {
nsTArray<Box> psshBoxes;
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
if (box.IsType("traf")) {
ParseTraf(box, aTrex, aMvhd, aMdhd, aEdts, aSinf, aDecodeTime, aIsAudio);
ParseTraf(box, aTrex, aMvhd, aMdhd, aEdts, aSinf, aDecodeTime, aIsAudio,
aIsMultitrackParser);
}
if (box.IsType("pssh")) {
psshBoxes.AppendElement(box);
@ -506,14 +504,14 @@ bool Moof::ProcessCencAuxInfo(AtomType aScheme) {
void Moof::ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd,
Edts& aEdts, Sinf& aSinf, uint64_t* aDecodeTime,
bool aIsAudio) {
bool aIsAudio, bool aIsMultitrackParser) {
MOZ_ASSERT(aDecodeTime);
Tfdt tfdt;
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
if (box.IsType("tfhd")) {
mTfhd = Tfhd(box, aTrex);
} else if (!aTrex.mTrackId || mTfhd.mTrackId == aTrex.mTrackId) {
} else if (aIsMultitrackParser || mTfhd.mTrackId == aTrex.mTrackId) {
if (box.IsType("tfdt")) {
tfdt = Tfdt(box);
} else if (box.IsType("sgpd")) {
@ -551,7 +549,7 @@ void Moof::ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd,
}
}
}
if (aTrex.mTrackId && mTfhd.mTrackId != aTrex.mTrackId) {
if (!aIsMultitrackParser && mTfhd.mTrackId != aTrex.mTrackId) {
return;
}
// Now search for TRUN boxes.

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

@ -227,7 +227,8 @@ struct SampleDescriptionEntry {
class Moof final : public Atom {
public:
Moof(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts,
Sinf& aSinf, uint64_t* aDecoderTime, bool aIsAudio);
Sinf& aSinf, uint64_t* aDecoderTime, bool aIsAudio,
bool aIsMultitrackParser);
bool GetAuxInfo(AtomType aType, FallibleTArray<MediaByteRange>* aByteRanges);
void FixRounding(const Moof& aMoof);
@ -248,7 +249,8 @@ class Moof final : public Atom {
private:
// aDecodeTime is updated to the end of the parsed TRAF on return.
void ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts,
Sinf& aSinf, uint64_t* aDecodeTime, bool aIsAudio);
Sinf& aSinf, uint64_t* aDecodeTime, bool aIsAudio,
bool aIsMultitrackParser);
// aDecodeTime is updated to the end of the parsed TRUN on return.
Result<Ok, nsresult> ParseTrun(Box& aBox, Mvhd& aMvhd, Mdhd& aMdhd,
Edts& aEdts, uint64_t* aDecodeTime,
@ -267,14 +269,18 @@ DDLoggedTypeDeclName(MoofParser);
class MoofParser : public DecoderDoctorLifeLogger<MoofParser> {
public:
MoofParser(ByteStream* aSource, uint32_t aTrackId, bool aIsAudio)
MoofParser(ByteStream* aSource, uint32_t aTrackId, bool aIsAudio,
bool aIsMultitrackParser = false)
: mSource(aSource),
mOffset(0),
mTrex(aTrackId),
mIsAudio(aIsAudio),
mLastDecodeTime(0) {
// Setting the mTrex.mTrackId to 0 is a nasty work around for calculating
// the composition range for MSE. We need an array of tracks.
mLastDecodeTime(0),
mIsMultitrackParser(aIsMultitrackParser) {
// Setting mIsMultitrackParser is a nasty work around for calculating
// the composition range for MSE that causes the parser to parse multiple
// tracks. Ideally we'd store an array of tracks with different metadata
// for each.
DDLINKCHILD("source", aSource);
}
bool RebuildFragmentedIndex(const mozilla::MediaByteRangeSet& aByteRanges);
@ -326,6 +332,7 @@ class MoofParser : public DecoderDoctorLifeLogger<MoofParser> {
nsTArray<MediaByteRange> mMediaRanges;
bool mIsAudio;
uint64_t mLastDecodeTime;
bool mIsMultitrackParser;
};
} // namespace mozilla

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

@ -605,20 +605,19 @@ nsresult MediaEngineWebRTCMicrophoneSource::Stop(
}
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
NS_DispatchToMainThread(
media::NewRunnableFrom([that, stream = mStream]() {
if (stream->IsDestroyed()) {
return NS_OK;
}
NS_DispatchToMainThread(media::NewRunnableFrom([that, stream = mStream]() {
if (stream->IsDestroyed()) {
return NS_OK;
}
stream->GraphImpl()->AppendMessage(MakeUnique<StartStopMessage>(
that->mInputProcessing, StartStopMessage::Stop));
CubebUtils::AudioDeviceID deviceID = that->mDeviceInfo->DeviceID();
Maybe<CubebUtils::AudioDeviceID> id = Some(deviceID);
stream->CloseAudioInput(id, that->mInputProcessing);
stream->GraphImpl()->AppendMessage(MakeUnique<StartStopMessage>(
that->mInputProcessing, StartStopMessage::Stop));
CubebUtils::AudioDeviceID deviceID = that->mDeviceInfo->DeviceID();
Maybe<CubebUtils::AudioDeviceID> id = Some(deviceID);
stream->CloseAudioInput(id, that->mInputProcessing);
return NS_OK;
}));
return NS_OK;
}));
MOZ_ASSERT(mState == kStarted, "Should be started when stopping");
mState = kStopped;

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

@ -152,8 +152,9 @@ already_AddRefed<WakeLock> PowerManagerService::NewWakeLockOnBehalfOfProcess(
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
mozilla::dom::power::PowerManagerService::GetInstance)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
nsIPowerManagerService,
mozilla::dom::power::PowerManagerService::GetInstance)
static const mozilla::Module::CIDEntry kPowerManagerCIDs[] = {
// clang-format off
@ -171,13 +172,14 @@ static const mozilla::Module::ContractIDEntry kPowerManagerContracts[] = {
// We mark the power module as being available in the GPU process because the
// appshell depends on the power manager service.
static const mozilla::Module kPowerManagerModule = {mozilla::Module::kVersion,
kPowerManagerCIDs,
kPowerManagerContracts,
nullptr,
nullptr,
nullptr,
nullptr,
mozilla::Module::ALLOW_IN_GPU_PROCESS};
static const mozilla::Module kPowerManagerModule = {
mozilla::Module::kVersion,
kPowerManagerCIDs,
kPowerManagerContracts,
nullptr,
nullptr,
nullptr,
nullptr,
mozilla::Module::ALLOW_IN_GPU_PROCESS};
NSMODULE_DEFN(nsPowerManagerModule) = &kPowerManagerModule;

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

@ -40,9 +40,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(LoadedScript)
LoadedScript::LoadedScript(ScriptKind aKind, ScriptFetchOptions* aFetchOptions,
nsIURI* aBaseURL)
: mKind(aKind),
mFetchOptions(aFetchOptions),
mBaseURL(aBaseURL) {
: mKind(aKind), mFetchOptions(aFetchOptions), mBaseURL(aBaseURL) {
MOZ_ASSERT(mFetchOptions);
MOZ_ASSERT(mBaseURL);
}

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

@ -2301,9 +2301,8 @@ nsresult ScriptLoader::FillCompileOptionsForRequest(
bool isScriptElement =
!aRequest->IsModuleRequest() || aRequest->AsModuleRequest()->IsTopLevel();
aOptions->setIntroductionInfoToCaller(jsapi.cx(),
isScriptElement ? "scriptElement"
: "importedModule");
aOptions->setIntroductionInfoToCaller(
jsapi.cx(), isScriptElement ? "scriptElement" : "importedModule");
aOptions->setFileAndLine(aRequest->mURL.get(), aRequest->mLineNo);
aOptions->setIsRunOnce(true);
aOptions->setNoScriptRval(true);

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

@ -27,10 +27,10 @@ class SMILKeySpline {
* aX1, etc. are the x1, y1, x2, y2 cubic Bezier control points as defined
* by SMILANIM 3.2.3. They must each be in the range 0.0 <= x <= 1.0
*/
SMILKeySpline(double aX1, double aY1, double aX2, double aY2)
: mX1(0), mY1(0), mX2(0), mY2(0) {
Init(aX1, aY1, aX2, aY2);
}
SMILKeySpline(double aX1, double aY1, double aX2, double aY2)
: mX1(0), mY1(0), mX2(0), mY2(0) {
Init(aX1, aY1, aX2, aY2);
}
double X1() const { return mX1; }
double Y1() const { return mY1; }

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

@ -191,8 +191,7 @@ class SVGContentUtils {
/*
* Report a localized error message to the error console.
*/
static nsresult ReportToConsole(dom::Document* doc,
const char* aWarning,
static nsresult ReportToConsole(dom::Document* doc, const char* aWarning,
const char16_t** aParams,
uint32_t aParamsLength);

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

@ -77,8 +77,8 @@ class SVGIntegerPair {
mIndex(aIndex) {}
virtual ~DOMAnimatedInteger();
SVGIntegerPair* mVal; // kept alive because it belongs to content
PairIndex mIndex; // are we the first or second integer
SVGIntegerPair* mVal; // kept alive because it belongs to content
PairIndex mIndex; // are we the first or second integer
virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); }
virtual void SetBaseVal(int32_t aValue) override {

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

@ -78,8 +78,8 @@ class SVGNumberPair {
mIndex(aIndex) {}
virtual ~DOMAnimatedNumber();
SVGNumberPair* mVal; // kept alive because it belongs to content
PairIndex mIndex; // are we the first or second number
SVGNumberPair* mVal; // kept alive because it belongs to content
PairIndex mIndex; // are we the first or second number
virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); }
virtual void SetBaseVal(float aValue) override {

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

@ -46,7 +46,8 @@ bool SVGTests::HasExtension(const nsAString& aExtension) const {
if (aExtension.EqualsLiteral(str)) return true;
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1999/xhtml")
nsNameSpaceManager* nameSpaceManager = nsNameSpaceManager::GetInstance();
if (AsSVGElement()->IsInChromeDocument() || !nameSpaceManager->mMathMLDisabled) {
if (AsSVGElement()->IsInChromeDocument() ||
!nameSpaceManager->mMathMLDisabled) {
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1998/Math/MathML")
}
#undef SVG_SUPPORTED_EXTENSION

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

@ -460,8 +460,7 @@ RefPtr<PerformanceInfoPromise> WorkerDebugger::ReportPerformanceInfo() {
RefPtr<nsIURI> scriptURI = mWorkerPrivate->GetResolvedScriptURI();
if (NS_WARN_IF(!scriptURI)) {
// This can happen at shutdown, let's stop here.
return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE,
__func__);
return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
}
nsCString url = scriptURI->GetSpecOrDefault();

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

@ -152,8 +152,8 @@ class nsXBLStreamListener final : public nsIStreamListener,
AutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
nsWeakPtr mBoundDocument;
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
nsCOMPtr<Document> mBindingDocument; // Only set until OnStartRequest
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
nsCOMPtr<Document> mBindingDocument; // Only set until OnStartRequest
};
/* Implementation file */

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

@ -35,9 +35,7 @@ DOMIterator::DOMIterator(nsINode& aNode MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
nsresult DOMIterator::Init(nsRange& aRange) {
return mIter->Init(&aRange);
}
nsresult DOMIterator::Init(nsRange& aRange) { return mIter->Init(&aRange); }
DOMIterator::DOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
: mIter(&mPostOrderIter) {

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

@ -6,8 +6,8 @@
#include "TextServicesDocument.h"
#include "FilteredContentIterator.h" // for FilteredContentIterator
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/EditorUtils.h" // for AutoTransactionBatchExternal
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/EditorUtils.h" // for AutoTransactionBatchExternal
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/mozalloc.h" // for operator new, etc
@ -15,22 +15,22 @@
#include "nsAString.h" // for nsAString::Length, etc
#include "nsContentUtils.h" // for nsContentUtils
#include "nsComposeTxtSrvFilter.h"
#include "nsDebug.h" // for NS_ENSURE_TRUE, etc
#include "nsDependentSubstring.h" // for Substring
#include "nsError.h" // for NS_OK, NS_ERROR_FAILURE, etc
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
#include "nsIContent.h" // for nsIContent, etc
#include "nsID.h" // for NS_GET_IID
#include "nsIEditor.h" // for nsIEditor, etc
#include "nsINode.h" // for nsINode
#include "nsISelectionController.h" // for nsISelectionController, etc
#include "nsISupportsBase.h" // for nsISupports
#include "nsISupportsUtils.h" // for NS_IF_ADDREF, NS_ADDREF, etc
#include "mozilla/intl/WordBreaker.h" // for WordRange, WordBreaker
#include "nsRange.h" // for nsRange
#include "nsString.h" // for nsString, nsAutoString
#include "nscore.h" // for nsresult, NS_IMETHODIMP, etc
#include "mozilla/UniquePtr.h" // for UniquePtr
#include "nsDebug.h" // for NS_ENSURE_TRUE, etc
#include "nsDependentSubstring.h" // for Substring
#include "nsError.h" // for NS_OK, NS_ERROR_FAILURE, etc
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
#include "nsIContent.h" // for nsIContent, etc
#include "nsID.h" // for NS_GET_IID
#include "nsIEditor.h" // for nsIEditor, etc
#include "nsINode.h" // for nsINode
#include "nsISelectionController.h" // for nsISelectionController, etc
#include "nsISupportsBase.h" // for nsISupports
#include "nsISupportsUtils.h" // for NS_IF_ADDREF, NS_ADDREF, etc
#include "mozilla/intl/WordBreaker.h" // for WordRange, WordBreaker
#include "nsRange.h" // for nsRange
#include "nsString.h" // for nsString, nsAutoString
#include "nscore.h" // for nsresult, NS_IMETHODIMP, etc
#include "mozilla/UniquePtr.h" // for UniquePtr
namespace mozilla {

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

@ -29,7 +29,7 @@ class TextEditor;
namespace dom {
class Document;
class Element;
};
}; // namespace dom
/**
* The TextServicesDocument presents the document in as a bunch of flattened

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

@ -310,8 +310,7 @@ GLContextEGL::GLContextEGL(CreateContextFlags flags, const SurfaceCaps& caps,
#endif
}
void
GLContextEGL::OnMarkDestroyed() {
void GLContextEGL::OnMarkDestroyed() {
if (mSurfaceOverride != EGL_NO_SURFACE) {
SetEGLSurfaceOverride(EGL_NO_SURFACE);
}

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

@ -17,7 +17,8 @@ void FrameMetrics::RecalculateLayoutViewportOffset() {
if (!mIsRootContent) {
return;
}
KeepLayoutViewportEnclosingVisualViewport(GetVisualViewport(), mLayoutViewport);
KeepLayoutViewportEnclosingVisualViewport(GetVisualViewport(),
mLayoutViewport);
}
/* static */ void FrameMetrics::KeepLayoutViewportEnclosingVisualViewport(

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

@ -13,7 +13,7 @@
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
#include "mozilla/gfx/Point.h" // for IntPoint
#include "mozilla/Maybe.h"
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/TimeStamp.h" // for TimeStamp
#include "mozilla/TypedEnumBits.h"
#include "nsRegion.h"
#include "nsStyleConsts.h"
@ -420,7 +420,7 @@ MOZ_DEFINE_ENUM_CLASS_WITH_BASE(CompositionPayloadType, uint8_t, (
// clang-format on
struct CompositionPayload {
bool operator ==(const CompositionPayload& aOther) const {
bool operator==(const CompositionPayload& aOther) const {
return mType == aOther.mType && mTimeStamp == aOther.mTimeStamp;
}
/* The type of payload that is in this composition */

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

@ -205,7 +205,8 @@ static ScreenMargin ScrollFrame(nsIContent* aContent,
aRequest, actualScrollOffset);
}
} else if (aRequest.IsRootContent() &&
aRequest.GetScrollOffset() != aRequest.GetLayoutViewport().TopLeft()) {
aRequest.GetScrollOffset() !=
aRequest.GetLayoutViewport().TopLeft()) {
// APZ uses the visual viewport's offset to calculate where to place the
// display port, so the display port is misplaced when a pinch zoom occurs.
//

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

@ -170,8 +170,9 @@ class CrossProcessCompositorBridgeParent final
void UpdatePaintTime(LayerTransactionParent* aLayerTree,
const TimeDuration& aPaintTime) override;
void RegisterPayload(LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) override;
void RegisterPayload(
LayerTransactionParent* aLayerTree,
const InfallibleTArray<CompositionPayload>& aPayload) override;
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId,

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

@ -710,7 +710,7 @@ struct ParamTraits<mozilla::layers::SimpleLayerAttributes>
template <>
struct ParamTraits<mozilla::layers::ScrollUpdateInfo>
: public PlainOldDataSerializer<mozilla::layers::ScrollUpdateInfo> {};
template <>
struct ParamTraits<mozilla::layers::CompositionPayloadType>
: public ContiguousEnumSerializerInclusive<
@ -719,8 +719,7 @@ struct ParamTraits<mozilla::layers::CompositionPayloadType>
mozilla::layers::kHighestCompositionPayloadType> {};
template <>
struct ParamTraits<mozilla::layers::CompositionPayload>
{
struct ParamTraits<mozilla::layers::CompositionPayload> {
typedef mozilla::layers::CompositionPayload paramType;
static void Write(Message* aMsg, const paramType& aParam) {
@ -728,7 +727,8 @@ struct ParamTraits<mozilla::layers::CompositionPayload>
WriteParam(aMsg, aParam.mTimeStamp);
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
static bool Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult) {
return ReadParam(aMsg, aIter, &aResult->mType) &&
ReadParam(aMsg, aIter, &aResult->mTimeStamp);
}

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

@ -20,7 +20,9 @@
//#define CLIP_LOG(...) printf_stderr("CLIP: " __VA_ARGS__)
// clang-format off
//#define CLIP_LOG(...) if (XRE_IsContentProcess()) printf_stderr("CLIP: " __VA_ARGS__)
// clang-format on
namespace mozilla {
namespace layers {

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

@ -11,71 +11,50 @@
namespace mozilla {
namespace layers {
RenderRootStateManager::RenderRootStateManager(WebRenderLayerManager* aLayerManager)
: mLayerManager(aLayerManager)
, mDestroyed(false)
{
}
RenderRootStateManager::RenderRootStateManager(
WebRenderLayerManager* aLayerManager)
: mLayerManager(aLayerManager), mDestroyed(false) {}
RenderRootStateManager::~RenderRootStateManager()
{}
RenderRootStateManager::~RenderRootStateManager() {}
// RenderRootStateManager shares its ref count with the WebRenderLayerManager that
// created it. You can think of the two classes as being one unit, except there
// are multiple RenderRootStateManagers per WebRenderLayerManager. Since we need
// to reference the WebRenderLayerManager and it needs to reference us, this
// avoids us needing to involve the cycle collector.
void
RenderRootStateManager::AddRef()
{
mLayerManager->AddRef();
}
// RenderRootStateManager shares its ref count with the WebRenderLayerManager
// that created it. You can think of the two classes as being one unit, except
// there are multiple RenderRootStateManagers per WebRenderLayerManager. Since
// we need to reference the WebRenderLayerManager and it needs to reference us,
// this avoids us needing to involve the cycle collector.
void RenderRootStateManager::AddRef() { mLayerManager->AddRef(); }
void
RenderRootStateManager::Release()
{
mLayerManager->Release();
}
void RenderRootStateManager::Release() { mLayerManager->Release(); }
WebRenderBridgeChild*
RenderRootStateManager::WrBridge() const
{
WebRenderBridgeChild* RenderRootStateManager::WrBridge() const {
return mLayerManager->WrBridge();
}
WebRenderCommandBuilder&
RenderRootStateManager::CommandBuilder()
{
WebRenderCommandBuilder& RenderRootStateManager::CommandBuilder() {
return mLayerManager->CommandBuilder();
}
RenderRootStateManager::WebRenderUserDataRefTable*
RenderRootStateManager::GetWebRenderUserDataTable()
{
RenderRootStateManager::GetWebRenderUserDataTable() {
return mLayerManager->GetWebRenderUserDataTable();
}
wr::IpcResourceUpdateQueue&
RenderRootStateManager::AsyncResourceUpdates()
{
wr::IpcResourceUpdateQueue& RenderRootStateManager::AsyncResourceUpdates() {
MOZ_ASSERT(NS_IsMainThread());
if (!mAsyncResourceUpdates) {
mAsyncResourceUpdates.emplace(WrBridge());
RefPtr<Runnable> task = NewRunnableMethod(
"RenderRootStateManager::FlushAsyncResourceUpdates",
this, &RenderRootStateManager::FlushAsyncResourceUpdates);
"RenderRootStateManager::FlushAsyncResourceUpdates", this,
&RenderRootStateManager::FlushAsyncResourceUpdates);
NS_DispatchToMainThread(task.forget());
}
return mAsyncResourceUpdates.ref();
}
void
RenderRootStateManager::Destroy()
{
void RenderRootStateManager::Destroy() {
ClearAsyncAnimations();
if (WrBridge()) {
@ -90,9 +69,7 @@ RenderRootStateManager::Destroy()
mDestroyed = true;
}
void
RenderRootStateManager::FlushAsyncResourceUpdates()
{
void RenderRootStateManager::FlushAsyncResourceUpdates() {
MOZ_ASSERT(NS_IsMainThread());
if (!mAsyncResourceUpdates) {
@ -106,21 +83,16 @@ RenderRootStateManager::FlushAsyncResourceUpdates()
mAsyncResourceUpdates.reset();
}
void
RenderRootStateManager::AddImageKeyForDiscard(wr::ImageKey key)
{
void RenderRootStateManager::AddImageKeyForDiscard(wr::ImageKey key) {
mImageKeysToDelete.AppendElement(key);
}
void
RenderRootStateManager::AddBlobImageKeyForDiscard(wr::BlobImageKey key)
{
void RenderRootStateManager::AddBlobImageKeyForDiscard(wr::BlobImageKey key) {
mBlobImageKeysToDelete.AppendElement(key);
}
void
RenderRootStateManager::DiscardImagesInTransaction(wr::IpcResourceUpdateQueue& aResources)
{
void RenderRootStateManager::DiscardImagesInTransaction(
wr::IpcResourceUpdateQueue& aResources) {
for (const auto& key : mImageKeysToDelete) {
aResources.DeleteImage(key);
}
@ -131,9 +103,7 @@ RenderRootStateManager::DiscardImagesInTransaction(wr::IpcResourceUpdateQueue& a
mBlobImageKeysToDelete.Clear();
}
void
RenderRootStateManager::DiscardLocalImages()
{
void RenderRootStateManager::DiscardLocalImages() {
// Removes images but doesn't tell the parent side about them
// This is useful in empty / failed transactions where we created
// image keys but didn't tell the parent about them yet.
@ -141,16 +111,12 @@ RenderRootStateManager::DiscardLocalImages()
mBlobImageKeysToDelete.Clear();
}
void
RenderRootStateManager::ClearCachedResources()
{
void RenderRootStateManager::ClearCachedResources() {
mActiveCompositorAnimationIds.clear();
mDiscardedCompositorAnimationsIds.Clear();
}
void
RenderRootStateManager::AddActiveCompositorAnimationId(uint64_t aId)
{
void RenderRootStateManager::AddActiveCompositorAnimationId(uint64_t aId) {
// In layers-free mode we track the active compositor animation ids on the
// client side so that we don't try to discard the same animation id multiple
// times. We could just ignore the multiple-discard on the parent side, but
@ -158,53 +124,42 @@ RenderRootStateManager::AddActiveCompositorAnimationId(uint64_t aId)
mActiveCompositorAnimationIds.insert(aId);
}
void
RenderRootStateManager::AddCompositorAnimationsIdForDiscard(uint64_t aId)
{
void RenderRootStateManager::AddCompositorAnimationsIdForDiscard(uint64_t aId) {
if (mActiveCompositorAnimationIds.erase(aId)) {
// For layers-free ensure we don't try to discard an animation id that wasn't
// active. We also remove it from mActiveCompositorAnimationIds so we don't
// discard it again unless it gets re-activated.
// For layers-free ensure we don't try to discard an animation id that
// wasn't active. We also remove it from mActiveCompositorAnimationIds so we
// don't discard it again unless it gets re-activated.
mDiscardedCompositorAnimationsIds.AppendElement(aId);
}
}
void
RenderRootStateManager::DiscardCompositorAnimations()
{
if (WrBridge()->IPCOpen() &&
!mDiscardedCompositorAnimationsIds.IsEmpty()) {
WrBridge()->
SendDeleteCompositorAnimations(mDiscardedCompositorAnimationsIds);
void RenderRootStateManager::DiscardCompositorAnimations() {
if (WrBridge()->IPCOpen() && !mDiscardedCompositorAnimationsIds.IsEmpty()) {
WrBridge()->SendDeleteCompositorAnimations(
mDiscardedCompositorAnimationsIds);
}
mDiscardedCompositorAnimationsIds.Clear();
}
void
RenderRootStateManager::RegisterAsyncAnimation(const wr::ImageKey& aKey,
SharedSurfacesAnimation* aAnimation)
{
void RenderRootStateManager::RegisterAsyncAnimation(
const wr::ImageKey& aKey, SharedSurfacesAnimation* aAnimation) {
mAsyncAnimations.insert(std::make_pair(wr::AsUint64(aKey), aAnimation));
}
void
RenderRootStateManager::DeregisterAsyncAnimation(const wr::ImageKey& aKey)
{
void RenderRootStateManager::DeregisterAsyncAnimation(
const wr::ImageKey& aKey) {
mAsyncAnimations.erase(wr::AsUint64(aKey));
}
void
RenderRootStateManager::ClearAsyncAnimations()
{
void RenderRootStateManager::ClearAsyncAnimations() {
for (const auto& i : mAsyncAnimations) {
i.second->Invalidate(this);
}
mAsyncAnimations.clear();
}
void
RenderRootStateManager::WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair>& aPairs)
{
void RenderRootStateManager::WrReleasedImages(
const nsTArray<wr::ExternalImageKeyPair>& aPairs) {
// A SharedSurfaceAnimation object's lifetime is tied to its owning
// ImageContainer. When the ImageContainer is released,
// SharedSurfaceAnimation::Destroy is called which should ensure it is removed
@ -223,54 +178,41 @@ RenderRootStateManager::WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair
}
}
void
RenderRootStateManager::AddWebRenderParentCommand(const WebRenderParentCommand& aCmd)
{
void RenderRootStateManager::AddWebRenderParentCommand(
const WebRenderParentCommand& aCmd) {
WrBridge()->AddWebRenderParentCommand(aCmd);
}
void
RenderRootStateManager::UpdateResources(wr::IpcResourceUpdateQueue& aResources)
{
void RenderRootStateManager::UpdateResources(
wr::IpcResourceUpdateQueue& aResources) {
WrBridge()->UpdateResources(aResources);
}
void
RenderRootStateManager::AddPipelineIdForAsyncCompositable(const wr::PipelineId& aPipelineId,
const CompositableHandle& aHandle)
{
void RenderRootStateManager::AddPipelineIdForAsyncCompositable(
const wr::PipelineId& aPipelineId, const CompositableHandle& aHandle) {
WrBridge()->AddPipelineIdForAsyncCompositable(aPipelineId, aHandle);
}
void
RenderRootStateManager::AddPipelineIdForCompositable(const wr::PipelineId& aPipelineId,
const CompositableHandle& aHandle)
{
void RenderRootStateManager::AddPipelineIdForCompositable(
const wr::PipelineId& aPipelineId, const CompositableHandle& aHandle) {
WrBridge()->AddPipelineIdForCompositable(aPipelineId, aHandle);
}
void
RenderRootStateManager::RemovePipelineIdForCompositable(const wr::PipelineId& aPipelineId)
{
void RenderRootStateManager::RemovePipelineIdForCompositable(
const wr::PipelineId& aPipelineId) {
WrBridge()->RemovePipelineIdForCompositable(aPipelineId);
}
/// Release TextureClient that is bounded to ImageKey.
/// It is used for recycling TextureClient.
void
RenderRootStateManager::ReleaseTextureOfImage(const wr::ImageKey& aKey)
{
/// Release TextureClient that is bounded to ImageKey.
/// It is used for recycling TextureClient.
void RenderRootStateManager::ReleaseTextureOfImage(const wr::ImageKey& aKey) {
WrBridge()->ReleaseTextureOfImage(aKey);
}
wr::FontInstanceKey
RenderRootStateManager::GetFontKeyForScaledFont(gfx::ScaledFont* aScaledFont,
wr::IpcResourceUpdateQueue* aResources)
{
wr::FontInstanceKey RenderRootStateManager::GetFontKeyForScaledFont(
gfx::ScaledFont* aScaledFont, wr::IpcResourceUpdateQueue* aResources) {
return WrBridge()->GetFontKeyForScaledFont(aScaledFont, aResources);
}
wr::FontKey
RenderRootStateManager::GetFontKeyForUnscaledFont(gfx::UnscaledFont* aUnscaledFont,
wr::IpcResourceUpdateQueue* aResources)
{
wr::FontKey RenderRootStateManager::GetFontKeyForUnscaledFont(
gfx::UnscaledFont* aUnscaledFont, wr::IpcResourceUpdateQueue* aResources) {
return WrBridge()->GetFontKeyForUnscaledFont(aUnscaledFont, aResources);
}
} // namespace layers
} // namespace mozilla
} // namespace layers
} // namespace mozilla

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

@ -16,11 +16,11 @@ namespace mozilla {
namespace layers {
class RenderRootStateManager
{
typedef nsTHashtable<nsRefPtrHashKey<WebRenderUserData>> WebRenderUserDataRefTable;
class RenderRootStateManager {
typedef nsTHashtable<nsRefPtrHashKey<WebRenderUserData>>
WebRenderUserDataRefTable;
public:
public:
void AddRef();
void Release();
@ -32,10 +32,7 @@ public:
WebRenderBridgeChild* WrBridge() const;
WebRenderCommandBuilder& CommandBuilder();
WebRenderUserDataRefTable* GetWebRenderUserDataTable();
WebRenderLayerManager* LayerManager()
{
return mLayerManager;
}
WebRenderLayerManager* LayerManager() { return mLayerManager; }
void AddImageKeyForDiscard(wr::ImageKey key);
void AddBlobImageKeyForDiscard(wr::BlobImageKey key);
@ -51,7 +48,8 @@ public:
void AddCompositorAnimationsIdForDiscard(uint64_t aId);
void DiscardCompositorAnimations();
void RegisterAsyncAnimation(const wr::ImageKey& aKey, SharedSurfacesAnimation* aAnimation);
void RegisterAsyncAnimation(const wr::ImageKey& aKey,
SharedSurfacesAnimation* aAnimation);
void DeregisterAsyncAnimation(const wr::ImageKey& aKey);
void ClearAsyncAnimations();
void WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair>& aPairs);
@ -66,19 +64,23 @@ public:
/// Release TextureClient that is bounded to ImageKey.
/// It is used for recycling TextureClient.
void ReleaseTextureOfImage(const wr::ImageKey& aKey);
wr::FontInstanceKey GetFontKeyForScaledFont(gfx::ScaledFont* aScaledFont,
wr::IpcResourceUpdateQueue* aResources = nullptr);
wr::FontKey GetFontKeyForUnscaledFont(gfx::UnscaledFont* aUnscaledFont,
wr::IpcResourceUpdateQueue* aResources = nullptr);
wr::FontInstanceKey GetFontKeyForScaledFont(
gfx::ScaledFont* aScaledFont,
wr::IpcResourceUpdateQueue* aResources = nullptr);
wr::FontKey GetFontKeyForUnscaledFont(
gfx::UnscaledFont* aUnscaledFont,
wr::IpcResourceUpdateQueue* aResources = nullptr);
void FlushAsyncResourceUpdates();
private:
private:
~RenderRootStateManager();
WebRenderLayerManager* mLayerManager;
Maybe<wr::IpcResourceUpdateQueue> mAsyncResourceUpdates;
nsTArray<wr::ImageKey> mImageKeysToDelete;
nsTArray<wr::BlobImageKey> mBlobImageKeysToDelete;
std::unordered_map<uint64_t, RefPtr<SharedSurfacesAnimation>> mAsyncAnimations;
std::unordered_map<uint64_t, RefPtr<SharedSurfacesAnimation>>
mAsyncAnimations;
// Set of compositor animation ids for which there are active animations (as
// of the last transaction) on the compositor side.
@ -92,7 +94,7 @@ private:
friend class WebRenderLayerManager;
};
} // namespace layers
} // namespace mozilla
} // namespace layers
} // namespace mozilla
#endif /* GFX_RENDERROOTSTATEMANAGER_H */

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

@ -1067,8 +1067,9 @@ static bool IsItemProbablyActive(nsDisplayItem* aItem,
bool is2D = t.Is2D(&t2d);
GP("active: %d\n", transformItem->MayBeAnimated(aDisplayListBuilder));
return transformItem->MayBeAnimated(aDisplayListBuilder, false) ||
!is2D || HasActiveChildren(*transformItem->GetChildren(),
aDisplayListBuilder);
!is2D ||
HasActiveChildren(*transformItem->GetChildren(),
aDisplayListBuilder);
}
case DisplayItemType::TYPE_OPACITY: {
nsDisplayOpacity* opacityItem = static_cast<nsDisplayOpacity*>(aItem);
@ -2303,8 +2304,7 @@ Maybe<wr::WrImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
recorder->FlushItem(IntRect(0, 0, size.width, size.height));
TakeExternalSurfaces(recorder, maskData->mExternalSurfaces,
mManager->GetRenderRootStateManager(),
aResources);
mManager->GetRenderRootStateManager(), aResources);
recorder->Finish();
Range<uint8_t> bytes((uint8_t*)recorder->mOutputStream.mData,

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

@ -1940,9 +1940,7 @@ class gfxFont {
// The return value is interpreted as a horizontal advance in 16.16 fixed
// point format.
virtual int32_t GetGlyphWidth(uint16_t aGID) {
return -1;
}
virtual int32_t GetGlyphWidth(uint16_t aGID) { return -1; }
bool IsSpaceGlyphInvisible(DrawTarget* aRefDrawTarget,
const gfxTextRun* aTextRun);

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

@ -308,10 +308,10 @@ void nsWebPDecoder::ApplyColorProfile(const char* aProfile, size_t aLength) {
uint32_t profileSpace = qcms_profile_get_color_space(mInProfile);
if (profileSpace == icSigGrayData) {
// WebP doesn't produce grayscale data, this must be corrupt.
MOZ_LOG(
sWebPLog, LogLevel::Error,
("[this=%p] nsWebPDecoder::ApplyColorProfile -- ignoring grayscale color profile\n",
this));
MOZ_LOG(sWebPLog, LogLevel::Error,
("[this=%p] nsWebPDecoder::ApplyColorProfile -- ignoring grayscale "
"color profile\n",
this));
return;
}

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

@ -15,15 +15,13 @@ namespace base {
// thread-safe access, since it will only be modified in testing.
static AtExitManager* g_top_manager = NULL;
AtExitManager::AtExitManager() : lock_("AtExitManager"),
next_manager_(NULL) {
AtExitManager::AtExitManager() : lock_("AtExitManager"), next_manager_(NULL) {
DCHECK(!g_top_manager);
g_top_manager = this;
}
AtExitManager::AtExitManager(bool shadow) : lock_("AtExitManager"),
next_manager_(g_top_manager)
{
AtExitManager::AtExitManager(bool shadow)
: lock_("AtExitManager"), next_manager_(g_top_manager) {
DCHECK(shadow || !g_top_manager);
g_top_manager = this;
}

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

@ -243,15 +243,13 @@ class NowSingleton {
private:
explicit NowSingleton(mozilla::StaticMutex& aMutex)
: lock_(aMutex)
, rollover_(TimeDelta::FromMilliseconds(0))
, last_seen_(0)
{
}
: lock_(aMutex),
rollover_(TimeDelta::FromMilliseconds(0)),
last_seen_(0) {}
~NowSingleton() = default;
mozilla::StaticMutex& lock_; // To protected last_seen_ and rollover_.
TimeDelta rollover_; // Accumulation of time lost due to rollover.
TimeDelta rollover_; // Accumulation of time lost due to rollover.
DWORD last_seen_; // The last timeGetTime value we saw, to detect rollover.
DISALLOW_COPY_AND_ASSIGN(NowSingleton);

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

@ -150,9 +150,7 @@ class PipeMap {
}
private:
explicit PipeMap(mozilla::StaticMutex& aMutex)
: lock_(aMutex)
{}
explicit PipeMap(mozilla::StaticMutex& aMutex) : lock_(aMutex) {}
~PipeMap() = default;
mozilla::StaticMutex& lock_;

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

@ -20,15 +20,20 @@
// in the code below. Making them equal also ensures that if new process
// types are added, people will know they may need to add crash reporting
// support in various places because compilation errors will be triggered here.
static_assert(nsICrashService::PROCESS_TYPE_MAIN == (int)GeckoProcessType_Default,
static_assert(nsICrashService::PROCESS_TYPE_MAIN ==
(int)GeckoProcessType_Default,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_PLUGIN == (int)GeckoProcessType_Plugin,
static_assert(nsICrashService::PROCESS_TYPE_PLUGIN ==
(int)GeckoProcessType_Plugin,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_CONTENT == (int)GeckoProcessType_Content,
static_assert(nsICrashService::PROCESS_TYPE_CONTENT ==
(int)GeckoProcessType_Content,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_IPDLUNITTEST == (int)GeckoProcessType_IPDLUnitTest,
static_assert(nsICrashService::PROCESS_TYPE_IPDLUNITTEST ==
(int)GeckoProcessType_IPDLUnitTest,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_GMPLUGIN == (int)GeckoProcessType_GMPlugin,
static_assert(nsICrashService::PROCESS_TYPE_GMPLUGIN ==
(int)GeckoProcessType_GMPlugin,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_GPU == (int)GeckoProcessType_GPU,
"GeckoProcessType enum is out of sync with nsICrashService!");
@ -36,14 +41,15 @@ static_assert(nsICrashService::PROCESS_TYPE_VR == (int)GeckoProcessType_VR,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_RDD == (int)GeckoProcessType_RDD,
"GeckoProcessType enum is out of sync with nsICrashService!");
static_assert(nsICrashService::PROCESS_TYPE_SOCKET == (int)GeckoProcessType_Socket,
static_assert(nsICrashService::PROCESS_TYPE_SOCKET ==
(int)GeckoProcessType_Socket,
"GeckoProcessType enum is out of sync with nsICrashService!");
// Add new static asserts here if you add more process types.
// Update this static assert as well.
static_assert(nsICrashService::PROCESS_TYPE_SOCKET + 1 == (int)GeckoProcessType_End,
static_assert(nsICrashService::PROCESS_TYPE_SOCKET + 1 ==
(int)GeckoProcessType_End,
"GeckoProcessType enum is out of sync with nsICrashService!");
namespace mozilla {
namespace ipc {
@ -116,14 +122,14 @@ bool CrashReporterHost::FinalizeCrashReport() {
// unit tests), but that's OK.
switch (mProcessType) {
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
case GeckoProcessType_##enum_name: \
type.AssignLiteral(string_name); \
break;
case GeckoProcessType_##enum_name: \
type.AssignLiteral(string_name); \
break;
#include "mozilla/GeckoProcessTypes.h"
#undef GECKO_PROCESS_TYPE
default:
NS_ERROR("unknown process type");
break;
default:
NS_ERROR("unknown process type");
break;
}
}
annotations[CrashReporter::Annotation::ProcessType] = type;
@ -188,13 +194,13 @@ bool CrashReporterHost::FinalizeCrashReport() {
} else {
switch (aProcessType) {
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
case GeckoProcessType_##enum_name: \
telemetryKey.AssignLiteral(string_name); \
break;
case GeckoProcessType_##enum_name: \
telemetryKey.AssignLiteral(string_name); \
break;
#include "mozilla/GeckoProcessTypes.h"
#undef GECKO_PROCESS_TYPE
// We can't really hit this, thanks to the above switch, but having it here
// will placate the compiler.
// We can't really hit this, thanks to the above switch, but having it
// here will placate the compiler.
default:
NS_ERROR("unknown process type");
return;

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

@ -381,7 +381,8 @@ bool IndirectBindingMap::lookup(jsid name, ModuleEnvironmentObject** envOut,
}
SetProxyReservedSlot(object, ExportsSlot, ObjectValue(*exports));
SetProxyReservedSlot(object, BindingsSlot, PrivateValue(rootedBindings.release()));
SetProxyReservedSlot(object, BindingsSlot,
PrivateValue(rootedBindings.release()));
return &object->as<ModuleNamespaceObject>();
}

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

@ -985,8 +985,8 @@ class NameResolver {
MOZ_ASSERT(parents[initialParents] == cur,
"pushed child shouldn't change underneath us");
AlwaysPoison(&parents[initialParents], 0xFF, sizeof(parents[initialParents]),
MemCheckKind::MakeUndefined);
AlwaysPoison(&parents[initialParents], 0xFF,
sizeof(parents[initialParents]), MemCheckKind::MakeUndefined);
return true;
}

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

@ -592,7 +592,7 @@ inline size_t Arena::finalize(FreeOp* fop, AllocKind thingKind,
} else {
t->finalize(fop);
AlwaysPoison(t, JS_SWEPT_TENURED_PATTERN, thingSize,
MemCheckKind::MakeUndefined);
MemCheckKind::MakeUndefined);
gcTracer.traceTenuredFinalize(t);
}
}
@ -3587,8 +3587,8 @@ void GCRuntime::sweepFromBackgroundThread(AutoLockHelperThreadState& lock) {
AutoUnlockHelperThreadState unlock(lock);
sweepBackgroundThings(zones, freeLifoAlloc);
// The main thread may call queueZonesAndStartBackgroundSweep() while this is
// running so we must check there is no more work after releasing the
// The main thread may call queueZonesAndStartBackgroundSweep() while this
// is running so we must check there is no more work after releasing the
// lock.
} while (!backgroundSweepZones.ref().isEmpty());
}
@ -3642,8 +3642,7 @@ void GCRuntime::startBackgroundFree() {
}
void BackgroundFreeTask::run() {
AutoTraceLog logFreeing(TraceLoggerForCurrentThread(),
TraceLogger_GCFree);
AutoTraceLog logFreeing(TraceLoggerForCurrentThread(), TraceLogger_GCFree);
AutoLockHelperThreadState lock;
@ -3666,16 +3665,15 @@ void GCRuntime::freeFromBackgroundThread(AutoLockHelperThreadState& lock) {
lifoBlocks.freeAll();
for (Nursery::BufferSet::Range r = buffers.all(); !r.empty(); r.popFront()) {
for (Nursery::BufferSet::Range r = buffers.all(); !r.empty();
r.popFront()) {
rt->defaultFreeOp()->free_(r.front());
}
} while (!lifoBlocksToFree.ref().isEmpty() ||
!buffersToFreeAfterMinorGC.ref().empty());
}
void GCRuntime::waitBackgroundFreeEnd() {
freeTask.join();
}
void GCRuntime::waitBackgroundFreeEnd() { freeTask.join(); }
struct IsAboutToBeFinalizedFunctor {
template <typename T>
@ -6935,8 +6933,8 @@ static bool ShouldCleanUpEverything(JS::gcreason::Reason reason,
}
static bool ShouldSweepOnBackgroundThread(JS::gcreason::Reason reason) {
return reason != JS::gcreason::DESTROY_RUNTIME &&
!gcTracer.traceEnabled() && CanUseExtraThreads();
return reason != JS::gcreason::DESTROY_RUNTIME && !gcTracer.traceEnabled() &&
CanUseExtraThreads();
}
void GCRuntime::incrementalSlice(SliceBudget& budget,

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

@ -166,8 +166,9 @@ class FreeSpan {
return nullptr; // The span is empty.
}
checkSpan(arena);
DebugOnlyPoison(reinterpret_cast<void*>(thing), JS_ALLOCATED_TENURED_PATTERN,
thingSize, MemCheckKind::MakeUndefined);
DebugOnlyPoison(reinterpret_cast<void*>(thing),
JS_ALLOCATED_TENURED_PATTERN, thingSize,
MemCheckKind::MakeUndefined);
return reinterpret_cast<TenuredCell*>(thing);
}
@ -237,7 +238,7 @@ class Arena {
*/
static const size_t DELAYED_MARKING_FLAG_BITS = 3;
static const size_t DELAYED_MARKING_ARENA_BITS =
JS_BITS_PER_WORD - 8 - DELAYED_MARKING_FLAG_BITS;
JS_BITS_PER_WORD - 8 - DELAYED_MARKING_FLAG_BITS;
size_t onDelayedMarkingList_ : 1;
size_t hasDelayedBlackMarking_ : 1;
size_t hasDelayedGrayMarking_ : 1;

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

@ -974,7 +974,7 @@ static bool TraceKindParticipatesInCC(JS::TraceKind kind) {
return DispatchTraceKindTyped(ParticipatesInCCFunctor(), kind);
}
#endif // DEBUG
#endif // DEBUG
template <typename T>
bool js::GCMarker::mark(T* thing) {

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

@ -72,8 +72,7 @@ inline void js::NurseryChunk::poisonAndInit(JSRuntime* rt, size_t extent) {
MOZ_ASSERT(extent <= ChunkSize);
MOZ_MAKE_MEM_UNDEFINED(this, extent);
Poison(this, JS_FRESH_NURSERY_PATTERN, extent,
MemCheckKind::MakeUndefined);
Poison(this, JS_FRESH_NURSERY_PATTERN, extent, MemCheckKind::MakeUndefined);
new (&trailer) gc::ChunkTrailer(rt, &rt->gc.storeBuffer());
}
@ -182,9 +181,7 @@ bool js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGCBgAlloc& lock) {
return true;
}
js::Nursery::~Nursery() {
disable();
}
js::Nursery::~Nursery() { disable(); }
void js::Nursery::enable() {
MOZ_ASSERT(isEmpty());

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

@ -312,8 +312,7 @@ class Nursery {
}
size_t sizeOfMallocedBuffers(mozilla::MallocSizeOf mallocSizeOf) const {
size_t total = 0;
for (BufferSet::Range r = mallocedBuffers.all(); !r.empty();
r.popFront()) {
for (BufferSet::Range r = mallocedBuffers.all(); !r.empty(); r.popFront()) {
total += mallocSizeOf(r.front());
}
total += mallocedBuffers.shallowSizeOfExcludingThis(mallocSizeOf);

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

@ -181,8 +181,9 @@ Phase Statistics::lookupChildPhase(PhaseKind phaseKind) const {
}
if (phase == Phase::NONE) {
MOZ_CRASH_UNSAFE_PRINTF("Child phase kind %u not found under current phase kind %u",
unsigned(phaseKind), unsigned(currentPhaseKind()));
MOZ_CRASH_UNSAFE_PRINTF(
"Child phase kind %u not found under current phase kind %u",
unsigned(phaseKind), unsigned(currentPhaseKind()));
}
return phase;

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

@ -1,3 +1,4 @@
// |jit-test| --more-compartments
const dbg = new Debugger();
const g = evalcx("lazy");
dbg.addDebuggee(g);

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

@ -78,3 +78,10 @@ function testTypedArrayLazyBuffer(global) {
}
testTypedArrayLazyBuffer(newGlobal());
testTypedArrayLazyBuffer(newGlobal({sameCompartmentAs: this}));
function testEvalcx() {
var g = newGlobal();
evalcx("this.x = 7", g);
assertEq(g.x, 7);
}
testEvalcx();

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

@ -1740,8 +1740,8 @@ bool BaselineCodeGen<Handler>::emit_JSOP_FUNCTIONTHIS() {
frame.pushThis();
// In strict mode code or self-hosted functions, |this| is left alone.
if (script->strict() || (function() && function()->isSelfHostedBuiltin())) {
// In strict mode code, |this| is left alone.
if (script->strict()) {
return true;
}

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

@ -5413,9 +5413,9 @@ void CodeGenerator::visitDefVar(LDefVar* lir) {
JSScript* script = current->mir()->info().script();
jsbytecode* pc = lir->mir()->resumePoint()->pc();
pushArg(ImmPtr(pc)); // jsbytecode*
pushArg(ImmGCPtr(script)); // JSScript*
pushArg(envChain); // JSObject*
pushArg(ImmPtr(pc)); // jsbytecode*
pushArg(ImmGCPtr(script)); // JSScript*
pushArg(envChain); // JSObject*
callVM(DefVarInfo, lir);
}

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

@ -12852,8 +12852,8 @@ AbortReasonOr<Ok> IonBuilder::jsop_functionthis() {
MOZ_ASSERT(info().funMaybeLazy());
MOZ_ASSERT(!info().funMaybeLazy()->isArrow());
if (script()->strict() || info().funMaybeLazy()->isSelfHostedBuiltin()) {
// No need to wrap primitive |this| in strict mode or self-hosted code.
if (script()->strict()) {
// No need to wrap primitive |this| in strict mode.
current->pushSlot(info().thisSlot());
return Ok();
}

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

@ -150,8 +150,7 @@ class IonTryNoteFilter {
class TryNoteIterIon : public TryNoteIter<IonTryNoteFilter> {
public:
TryNoteIterIon(JSContext* cx, const InlineFrameIterator& frame)
: TryNoteIter(cx, frame.script(), frame.pc(),
IonTryNoteFilter(frame)) {}
: TryNoteIter(cx, frame.script(), frame.pc(), IonTryNoteFilter(frame)) {}
};
static void HandleExceptionIon(JSContext* cx, const InlineFrameIterator& frame,
@ -323,8 +322,7 @@ class BaselineTryNoteFilter {
class TryNoteIterBaseline : public TryNoteIter<BaselineTryNoteFilter> {
public:
TryNoteIterBaseline(JSContext* cx, BaselineFrame* frame, jsbytecode* pc)
: TryNoteIter(cx, frame->script(), pc, BaselineTryNoteFilter(frame)) {
}
: TryNoteIter(cx, frame->script(), pc, BaselineTryNoteFilter(frame)) {}
};
// Close all live iterators on a BaselineFrame due to exception unwinding. The

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

@ -43,7 +43,7 @@ static constexpr FloatRegister ScratchDoubleReg = {FloatRegisters::d31,
FloatRegisters::Double};
struct ScratchDoubleScope : public AutoFloatRegisterScope {
explicit ScratchDoubleScope(MacroAssembler& masm)
: AutoFloatRegisterScope(masm, ScratchDoubleReg) {}
: AutoFloatRegisterScope(masm, ScratchDoubleReg) {}
};
static constexpr FloatRegister ReturnFloat32Reg = {FloatRegisters::s0,
@ -52,7 +52,7 @@ static constexpr FloatRegister ScratchFloat32Reg = {FloatRegisters::s31,
FloatRegisters::Single};
struct ScratchFloat32Scope : public AutoFloatRegisterScope {
explicit ScratchFloat32Scope(MacroAssembler& masm)
: AutoFloatRegisterScope(masm, ScratchFloat32Reg) {}
: AutoFloatRegisterScope(masm, ScratchFloat32Reg) {}
};
static constexpr Register InvalidReg{Registers::invalid_reg};

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

@ -493,10 +493,10 @@ void MacroAssembler::storeRegsInMask(LiveRegisterSet set, Address dest,
} else {
MOZ_CRASH("Unknown register type.");
}
}
MOZ_ASSERT(numFpu == 0);
// Padding to keep the stack aligned, taken from the x64 and mips64 implementations.
// Padding to keep the stack aligned, taken from the x64 and mips64
// implementations.
diffF -= diffF % sizeof(uintptr_t);
MOZ_ASSERT(diffF == 0);
}

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

@ -3557,8 +3557,8 @@ CompileOptions& CompileOptions::setIntroductionInfoToCaller(
DescribeScriptedCallerForCompilation(cx, &maybeScript, &filename, &lineno,
&pcOffset, &mutedErrors);
if (filename) {
return setIntroductionInfo(filename, introductionType, lineno,
maybeScript, pcOffset);
return setIntroductionInfo(filename, introductionType, lineno, maybeScript,
pcOffset);
} else {
return setIntroductionType(introductionType);
}

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

@ -1328,9 +1328,11 @@ JS_FRIEND_API void js::SetWindowProxy(JSContext* cx, HandleObject global,
CHECK_THREAD(cx);
cx->check(global, windowProxy);
MOZ_ASSERT(IsWindowProxy(windowProxy));
global->as<GlobalObject>().setWindowProxy(windowProxy);
GlobalObject& globalObj = global->as<GlobalObject>();
globalObj.setWindowProxy(windowProxy);
globalObj.lexicalEnvironment().setWindowProxyThisValue(windowProxy);
}
JS_FRIEND_API JSObject* js::ToWindowIfWindowProxy(JSObject* obj) {

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

@ -3767,6 +3767,13 @@ static void SetStandardRealmOptions(JS::RealmOptions& options) {
static JSObject* NewSandbox(JSContext* cx, bool lazy) {
JS::RealmOptions options;
SetStandardRealmOptions(options);
if (defaultToSameCompartment) {
options.creationOptions().setExistingCompartment(cx->global());
} else {
options.creationOptions().setNewCompartmentAndZone();
}
RootedObject obj(cx,
JS_NewGlobalObject(cx, &sandbox_class, nullptr,
JS::DontFireOnNewGlobalHook, options));
@ -3848,17 +3855,13 @@ static bool EvalInContext(JSContext* cx, unsigned argc, Value* vp) {
DescribeScriptedCaller(cx, &filename, &lineno);
{
Maybe<JSAutoRealm> ar;
unsigned flags;
JSObject* unwrapped = UncheckedUnwrap(sobj, true, &flags);
if (flags & Wrapper::CROSS_COMPARTMENT) {
sobj = unwrapped;
ar.emplace(cx, sobj);
}
sobj = UncheckedUnwrap(sobj, true);
JSAutoRealm ar(cx, sobj);
sobj = ToWindowIfWindowProxy(sobj);
if (!(sobj->getClass()->flags & JSCLASS_IS_GLOBAL)) {
if (!JS_IsGlobalObject(sobj)) {
JS_ReportErrorASCII(cx, "Invalid scope argument to evalcx");
return false;
}

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

@ -4213,9 +4213,9 @@ static T* findDebuggerInVector(Debugger* dbg,
// a ReadBarriered version for findDebuggerInVector
// TODO: Bug 1515934 - findDebuggerInVector<T> triggers read barriers.
static ReadBarriered<Debugger*>*
findDebuggerInVector(Debugger* dbg,
Vector<ReadBarriered<Debugger*>, 0, js::SystemAllocPolicy>* vec) {
static ReadBarriered<Debugger*>* findDebuggerInVector(
Debugger* dbg,
Vector<ReadBarriered<Debugger*>, 0, js::SystemAllocPolicy>* vec) {
ReadBarriered<Debugger*>* p;
for (p = vec->begin(); p != vec->end(); p++) {
if (p->unbarrieredGet() == dbg) {

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

@ -1133,17 +1133,20 @@ bool LexicalEnvironmentObject::isExtensible() const {
Value LexicalEnvironmentObject::thisValue() const {
MOZ_ASSERT(isExtensible());
Value v = getReservedSlot(THIS_VALUE_OR_SCOPE_SLOT);
if (v.isObject()) {
// A WindowProxy may have been attached after this environment was
// created so check ToWindowProxyIfWindow again. For example,
// GlobalObject::createInternal will construct its lexical environment
// before SetWindowProxy can be called.
// See also: js::GetThisValue / js::GetThisValueOfLexical
return ObjectValue(*ToWindowProxyIfWindow(&v.toObject()));
}
// Windows must never be exposed to script. setWindowProxyThisValue should
// have set this to the WindowProxy.
MOZ_ASSERT_IF(v.isObject(), !IsWindow(&v.toObject()));
return v;
}
void LexicalEnvironmentObject::setWindowProxyThisValue(JSObject* obj) {
MOZ_ASSERT(isGlobal());
MOZ_ASSERT(IsWindowProxy(obj));
setReservedSlot(THIS_VALUE_OR_SCOPE_SLOT, ObjectValue(*obj));
}
const Class LexicalEnvironmentObject::class_ = {
"LexicalEnvironment",
JSCLASS_HAS_RESERVED_SLOTS(LexicalEnvironmentObject::RESERVED_SLOTS) |

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

@ -567,6 +567,8 @@ class LexicalEnvironmentObject : public EnvironmentObject {
return enclosingEnvironment().as<GlobalObject>();
}
void setWindowProxyThisValue(JSObject* obj);
// Global and non-syntactic lexical scopes are extensible. All other
// lexical scopes are not.
bool isExtensible() const;

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

@ -119,12 +119,14 @@ bool js::GetFunctionThis(JSContext* cx, AbstractFramePtr frame,
MOZ_ASSERT(frame.isFunctionFrame());
MOZ_ASSERT(!frame.callee()->isArrow());
if (frame.thisArgument().isObject() || frame.callee()->strict() ||
frame.callee()->isSelfHostedBuiltin()) {
if (frame.thisArgument().isObject() || frame.callee()->strict()) {
res.set(frame.thisArgument());
return true;
}
MOZ_ASSERT(!frame.callee()->isSelfHostedBuiltin(),
"Self-hosted builtins must be strict");
RootedValue thisv(cx, frame.thisArgument());
// If there is a NSVO on environment chain, use it as basis for fallback
@ -1105,8 +1107,7 @@ class InterpreterTryNoteFilter {
}
};
class TryNoteIterInterpreter
: public TryNoteIter<InterpreterTryNoteFilter> {
class TryNoteIterInterpreter : public TryNoteIter<InterpreterTryNoteFilter> {
public:
TryNoteIterInterpreter(JSContext* cx, const InterpreterRegs& regs)
: TryNoteIter(cx, regs.fp()->script(), regs.pc,

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

@ -415,7 +415,6 @@ class MOZ_STACK_CLASS TryNoteIter {
uint32_t start = tn_->start;
uint32_t length = tn_->length;
return offset - start < length;
}
bool done() const { return tn_ == tnEnd_; }
const JSTryNote* operator*() const { return tn_; }

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

@ -119,7 +119,7 @@ inline js::GlobalObject& JSScript::global() const {
return *realm()->maybeGlobal();
}
inline bool JSScript::hasGlobal(const js::GlobalObject *global) const {
inline bool JSScript::hasGlobal(const js::GlobalObject* global) const {
return global == realm()->unsafeUnbarrieredMaybeGlobal();
}

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

@ -1382,7 +1382,8 @@ ScriptSourceObject* ScriptSourceObject::createInternal(JSContext* cx,
obj->initReservedSlot(ELEMENT_SLOT, MagicValue(JS_GENERIC_MAGIC));
obj->initReservedSlot(ELEMENT_PROPERTY_SLOT, MagicValue(JS_GENERIC_MAGIC));
obj->initReservedSlot(INTRODUCTION_SCRIPT_SLOT, MagicValue(JS_GENERIC_MAGIC));
obj->initReservedSlot(INTRODUCTION_SOURCE_OBJECT_SLOT, MagicValue(JS_GENERIC_MAGIC));
obj->initReservedSlot(INTRODUCTION_SOURCE_OBJECT_SLOT,
MagicValue(JS_GENERIC_MAGIC));
return obj;
}

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

@ -1677,8 +1677,8 @@ bool SavedStacks::getLocation(JSContext* cx, const FrameIter& iter,
}
void SavedStacks::chooseSamplingProbability(Realm* realm) {
// Use unbarriered version to prevent triggering read barrier while collecting,
// this is safe as long as global does not escape.
// Use unbarriered version to prevent triggering read barrier while
// collecting, this is safe as long as global does not escape.
GlobalObject* global = realm->unsafeUnbarrieredMaybeGlobal();
if (!global) {
return;
@ -1703,8 +1703,7 @@ void SavedStacks::chooseSamplingProbability(Realm* realm) {
if (dbgp->trackingAllocationSites && dbgp->enabled) {
foundAnyDebuggers = true;
probability =
std::max(dbgp->allocationSamplingProbability, probability);
probability = std::max(dbgp->allocationSamplingProbability, probability);
}
}
MOZ_ASSERT(foundAnyDebuggers);

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

@ -3347,6 +3347,7 @@ bool JSRuntime::cloneSelfHostedFunctionScript(JSContext* cx,
MOZ_ASSERT(sourceFun->nargs() == targetFun->nargs());
MOZ_ASSERT(sourceScript->hasRest() == targetFun->nonLazyScript()->hasRest());
MOZ_ASSERT(targetFun->strict(), "Self-hosted builtins must be strict");
// The target function might have been relazified after its flags changed.
targetFun->setFlags(targetFun->flags() | sourceFun->flags());

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

@ -1325,7 +1325,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidatorShared {
using MathNameMap = HashMap<PropertyName*, MathBuiltin>;
using ArrayViewVector = Vector<ArrayView>;
protected:
protected:
JSContext* cx_;
CodeNode* moduleFunctionNode_;
PropertyName* moduleFunctionName_;

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

@ -259,8 +259,10 @@ static const double arm64IonBytecodesPerMs = 750; // Estimate
static const double x64DesktopTierCutoff = x64IonBytecodesPerMs * tierCutoffMs;
static const double x86DesktopTierCutoff = x86IonBytecodesPerMs * tierCutoffMs;
static const double x86MobileTierCutoff = x86DesktopTierCutoff / 2; // Guess
static const double arm32MobileTierCutoff = arm32IonBytecodesPerMs * tierCutoffMs;
static const double arm64MobileTierCutoff = arm64IonBytecodesPerMs * tierCutoffMs;
static const double arm32MobileTierCutoff =
arm32IonBytecodesPerMs * tierCutoffMs;
static const double arm64MobileTierCutoff =
arm64IonBytecodesPerMs * tierCutoffMs;
static double CodesizeCutoff(SystemClass cls) {
switch (cls) {

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

@ -701,12 +701,9 @@ static void LayoutModuleDtor() {
xpcModuleDtor();
}
static const mozilla::Module kLayoutModule = {mozilla::Module::kVersion,
kLayoutCIDs,
kLayoutContracts,
kLayoutCategories,
nullptr,
Initialize,
LayoutModuleDtor};
static const mozilla::Module kLayoutModule = {
mozilla::Module::kVersion, kLayoutCIDs, kLayoutContracts,
kLayoutCategories, nullptr, Initialize,
LayoutModuleDtor};
NSMODULE_DEFN(nsLayoutModule) = &kLayoutModule;

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

@ -14,29 +14,30 @@
#endif
#if (defined(XP_WIN) && !defined(HAVE_64BIT_BUILD)) || defined(ANDROID)
// Blink's magic depth limit from its HTML parser (513) plus as much as fits in the
// default run-time stack on armv7 Android on Dalvik when using display: block minus
// a bit just to be sure. The Dalvik default stack crashes at 588. ART can do a few
// frames more. Using the same number for 32-bit Windows for consistency. Over there,
// Blink's magic depth of 513 doesn't fit in the default stack of 1 MB, but this magic
// depth fits when the default is grown by mere 192 KB (tested in 64 KB increments).
// Blink's magic depth limit from its HTML parser (513) plus as much as fits in
// the default run-time stack on armv7 Android on Dalvik when using display:
// block minus a bit just to be sure. The Dalvik default stack crashes at 588.
// ART can do a few frames more. Using the same number for 32-bit Windows for
// consistency. Over there, Blink's magic depth of 513 doesn't fit in the
// default stack of 1 MB, but this magic depth fits when the default is grown by
// mere 192 KB (tested in 64 KB increments).
//
// 32-bit Windows has a different limit compared to 64-bit desktop, because the
// default stack size affects all threads and consumes address space. Fixing that
// is bug 1257522.
// default stack size affects all threads and consumes address space. Fixing
// that is bug 1257522.
//
// 32-bit Android on ARM already happens to have defaults that are close enough to
// what makes sense as a temporary measure on Windows, so adjusting the Android
// stack can be a follow-up. The stack on 64-bit ARM needs adjusting in any case
// before 64-bit ARM can become tier-1. See bug 1400811.
// 32-bit Android on ARM already happens to have defaults that are close enough
// to what makes sense as a temporary measure on Windows, so adjusting the
// Android stack can be a follow-up. The stack on 64-bit ARM needs adjusting in
// any case before 64-bit ARM can become tier-1. See bug 1400811.
//
// Ideally, we'd get rid of this smaller limit and make 32-bit Windows and Android
// capable of working with the Linux/Mac/Win64 number below.
// Ideally, we'd get rid of this smaller limit and make 32-bit Windows and
// Android capable of working with the Linux/Mac/Win64 number below.
#define MAX_REFLOW_DEPTH 585
#else
// Blink's magic depth limit from its HTML parser times two. Also just about fits
// within the system default runtime stack limit of 8 MB on 64-bit Mac and Linux with
// display: table-cell.
// Blink's magic depth limit from its HTML parser times two. Also just about
// fits within the system default runtime stack limit of 8 MB on 64-bit Mac and
// Linux with display: table-cell.
#define MAX_REFLOW_DEPTH 1026
#endif

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

@ -1898,7 +1898,7 @@ bool BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1,
};
const nsIFrame* ancestor =
nsLayoutUtils::FindNearestCommonAncestorFrame(aFrame1, aFrame2);
nsLayoutUtils::FindNearestCommonAncestorFrame(aFrame1, aFrame2);
MOZ_ASSERT(ancestor);
// Map inline-end and inline-start to physical sides for checking presence

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

@ -33,7 +33,7 @@ class Rule;
namespace dom {
class Document;
class Element;
}
} // namespace dom
struct MutationClosureData {
MutationClosureData() : mClosure(nullptr), mElement(nullptr), mModType(0) {}

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

@ -21,10 +21,7 @@ CFLAGS += [
'-I%s/dist/include/dav1d/' % TOPOBJDIR,
]
if CONFIG['CC_TYPE'] == 'clang':
CFLAGS += ['-mstack-alignment=32']
elif CONFIG['CC_TYPE'] == 'gcc':
CFLAGS += ['-mpreferred-stack-boundary=5']
# This is Linux only for now
# Attaching config.asm file
if CONFIG['CPU_ARCH'] == 'x86':
@ -32,6 +29,12 @@ if CONFIG['CPU_ARCH'] == 'x86':
SOURCES += ['x86_32/config.asm']
if CONFIG['CPU_ARCH'] == 'x86_64':
# Change the default stack aligment (16) to 32
if CONFIG['CC_TYPE'] == 'clang':
CFLAGS += ['-mstack-alignment=32']
elif CONFIG['CC_TYPE'] == 'gcc':
CFLAGS += ['-mpreferred-stack-boundary=5']
if CONFIG['OS_TARGET'] == 'Darwin':
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR]
SOURCES += ['x86_64/osx/config.asm']

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

@ -5,5 +5,7 @@
%define ARCH_X86_64 0
%define STACK_ALIGNMENT 32
%define PIC 1
%define STACK_ALIGNMENT 16

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

@ -5,7 +5,5 @@
%define ARCH_X86_64 1
%define PIC 1
%define STACK_ALIGNMENT 32

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

@ -36,7 +36,8 @@
#define CONFIG_8BPC 1
// Enable asm
#if ARCH_X86_64 == 1 && defined(__linux__) && !defined(__ANDROID__)
#if (ARCH_x86_32 == 1 || ARCH_X86_64 == 1) && defined(__linux__) && \
!defined(__ANDROID__)
#define HAVE_ASM 1
#else
#define HAVE_ASM 0
@ -53,7 +54,7 @@
#endif
// unistd.h is used by tools, which we do not
// built, so we do not really care.
// build, so we do not really care.
#define HAVE_UNISTD_H 1
// Important when asm is enabled
@ -61,5 +62,8 @@
#define PREFIX 1
#endif
// aligment is 32 in evry case
#if ARCH_X86_32 == 1 && defined(__linux__) && !defined(__ANDROID__)
#define STACK_ALIGNMENT 16
#else
#define STACK_ALIGNMENT 32
#endif

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

@ -25,16 +25,19 @@ SOURCES += [
]
# Enable ASM on Linux for now.
if CONFIG['OS_TARGET'] == 'Linux' and CONFIG['CPU_ARCH'] == 'x86_64':
if CONFIG['OS_TARGET'] == 'Linux' and (CONFIG['CPU_ARCH'] in ('x86', 'x86_64')):
# Default stack aligment is 16 bytes
DIRS += ['asm']
if CONFIG['CC_TYPE'] == 'clang':
CFLAGS += ['-mstack-alignment=32']
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mstackrealign']
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mstackrealign']
elif CONFIG['CC_TYPE'] == 'gcc':
CFLAGS += ['-mpreferred-stack-boundary=5']
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mincoming-stack-boundary=4']
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mincoming-stack-boundary=4']
if CONFIG['CPU_ARCH'] == 'x86_64':
# Update stack aligment to 32 bytes
if CONFIG['CC_TYPE'] == 'clang':
CFLAGS += ['-mstack-alignment=32']
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mstackrealign']
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mstackrealign']
elif CONFIG['CC_TYPE'] == 'gcc':
CFLAGS += ['-mpreferred-stack-boundary=5']
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mincoming-stack-boundary=4']
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mincoming-stack-boundary=4']
# common sources
SOURCES += [

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

@ -20,7 +20,7 @@ origin:
# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: commit b53a99b97f93d0eb15d1f532739ca062fe44b4ca
release: commit f813285c1d1a5421e0180efbb7cbdd377cd31c69 (2019-01-13T22:08:25.000Z).
# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/

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

@ -21,7 +21,7 @@ namespace mozilla {
namespace dom {
class Document;
}
}
} // namespace mozilla
struct VisitedURI {
nsCOMPtr<nsIURI> mURI;

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

@ -1905,11 +1905,10 @@ pref("network.http.rcwn.max_wait_before_racing_ms", 500);
// all available active connections.
pref("network.http.focused_window_transaction_ratio", "0.9");
// XXX Disable for intranet downloading issue.
// This is the size of the flow control window (KB) (i.e., the amount of data
// that the parent can send to the child before getting an ack). 0 for disable
// the flow control.
pref("network.http.send_window_size", 0);
pref("network.http.send_window_size", 1024);
// Whether or not we give more priority to active tab.
// Note that this requires restart for changes to take effect.

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

@ -449,7 +449,8 @@ void nsIOService::NotifySocketProcessPrefsChanged(const char *aName) {
dom::Pref pref(nsCString(aName), /* isLocked */ false, null_t(), null_t());
Preferences::GetPreference(&pref);
auto sendPrefUpdate = [pref]() {
Unused << gIOService->mSocketProcess->GetActor()->SendPreferenceUpdate(pref);
Unused << gIOService->mSocketProcess->GetActor()->SendPreferenceUpdate(
pref);
};
CallOrWaitForSocketProcess(sendPrefUpdate);
}
@ -469,13 +470,14 @@ void nsIOService::OnProcessLaunchComplete(SocketProcessHost *aHost,
if (!mPendingEvents.IsEmpty()) {
nsTArray<std::function<void()>> pendingEvents;
mPendingEvents.SwapElements(pendingEvents);
for (auto& func : pendingEvents) {
for (auto &func : pendingEvents) {
func();
}
}
}
void nsIOService::CallOrWaitForSocketProcess(const std::function<void()>& aFunc) {
void nsIOService::CallOrWaitForSocketProcess(
const std::function<void()> &aFunc) {
MOZ_ASSERT(NS_IsMainThread());
if (IsSocketProcessLaunchComplete() && SocketProcessReady()) {
aFunc();
@ -499,9 +501,9 @@ void nsIOService::OnProcessUnexpectedShutdown(SocketProcessHost *aHost) {
RefPtr<MemoryReportingProcess> nsIOService::GetSocketProcessMemoryReporter() {
// Check the prefs here again, since we don't want to create
// SocketProcessMemoryReporter for some tests.
if (!Preferences::GetBool("network.process.enabled") || !SocketProcessReady()) {
if (!Preferences::GetBool("network.process.enabled") ||
!SocketProcessReady()) {
return nullptr;
}
return new SocketProcessMemoryReporter();

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

@ -62,8 +62,8 @@ class OfflineObserver final : public nsIObserver {
} else if (!strcmp(aTopic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID)) {
nsCOMPtr<nsIObserverService> obs =
mozilla::services::GetObserverService();
obs->RemoveObserver(this, NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC);
obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
obs->RemoveObserver(this, NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC);
obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
}
return NS_OK;

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

@ -880,7 +880,11 @@ void HttpChannelChild::OnTransportAndData(const nsresult& channelStatus,
bool HttpChannelChild::NeedToReportBytesRead() {
if (mCacheNeedToReportBytesReadInitialized) {
return mNeedToReportBytesRead;
// No need to send SendRecvBytes when diversion starts since the parent
// process will suspend for diversion triggered in during OnStrartRequest at
// child side, which is earlier. Parent will take over the flow control
// after the diverting starts. Sending |SendBytesRead| is redundant.
return mNeedToReportBytesRead && !mDivertingToParent;
}
// Might notify parent for partial cache, and the IPC message is ignored by

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

@ -1609,6 +1609,7 @@ HttpChannelParent::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
// We're going to run out of sending window size
if (mSendWindowSize > 0 && mSendWindowSize <= count) {
MOZ_ASSERT(!mSuspendedForFlowControl);
LOG((" suspend the channel due to e10s backpressure"));
Unused << mChannel->Suspend();
mSuspendedForFlowControl = true;
mHasSuspendedByBackPressure = true;
@ -1652,7 +1653,8 @@ bool HttpChannelParent::NeedFlowControl() {
mozilla::ipc::IPCResult HttpChannelParent::RecvBytesRead(
const int32_t& aCount) {
if (!NeedFlowControl()) {
// no more flow control after diviersion starts
if (!NeedFlowControl() || mDivertingFromChild) {
return IPC_OK();
}
@ -1661,6 +1663,7 @@ mozilla::ipc::IPCResult HttpChannelParent::RecvBytesRead(
if (mSendWindowSize <= 0 && mSendWindowSize + aCount > 0) {
MOZ_ASSERT(mSuspendedForFlowControl);
LOG((" resume the channel due to e10s backpressure relief"));
Unused << mChannel->Resume();
mSuspendedForFlowControl = false;
@ -2076,6 +2079,14 @@ nsresult HttpChannelParent::SuspendForDiversion() {
rv = mParentListener->SuspendForDiversion();
MOZ_ASSERT(NS_SUCCEEDED(rv));
// After we suspend for diversion, we don't need the flow control since the
// channel is suspended until all the data is consumed and no more e10s later.
// No point to have another redundant suspension.
if (mSuspendedForFlowControl) {
Unused << mChannel->Resume();
mSuspendedForFlowControl = false;
}
// Once this is set, no more OnStart/OnData/OnStop callbacks should be sent
// to the child.
mDivertingFromChild = true;

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

@ -15,8 +15,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
NS_DEFINE_NAMED_CID(NS_PARSER_CID);
static const mozilla::Module::CIDEntry kParserCIDs[] = {
{&kNS_PARSER_CID, false, nullptr, nsParserConstructor},
{nullptr}};
{&kNS_PARSER_CID, false, nullptr, nsParserConstructor}, {nullptr}};
static nsresult Initialize() {
nsresult rv = nsHTMLTags::AddRefTable();

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

@ -150,6 +150,27 @@ And once done:
#. Wait for Firefox to pick-up the changes for your settings key
Global Notifications
====================
The polling for changes process sends two notifications that observers can register to:
* ``remote-settings:changes-poll-start``: Polling for changes is starting. triggered either by the scheduled timer or a push broadcast.
* ``remote-settings:changes-poll-end``: Polling for changes has ended
.. code-block:: javascript
const observer = {
observe(aSubject, aTopic, aData) {
Services.obs.removeObserver(this, "remote-settings:changes-poll-start");
const { expectedTimestamp } = JSON.parse(aData);
console.log("Polling started", expectedTimestamp ? "from push broadcast" : "by scheduled trigger");
},
};
Services.obs.addObserver(observer, "remote-settings:changes-poll-start");
Advanced Options
================

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

@ -168,6 +168,8 @@ function remoteSettingsFunction() {
}
}
Services.obs.notifyObservers(null, "remote-settings:changes-poll-start", JSON.stringify({ expectedTimestamp }));
const lastEtag = gPrefs.getCharPref(PREF_SETTINGS_LAST_ETAG, "");
let pollResult;
@ -226,6 +228,7 @@ function remoteSettingsFunction() {
// the one in the local database.
try {
await client.maybeSync(last_modified, { loadDump });
// Save last time this client was successfully synced.
Services.prefs.setIntPref(client.lastCheckTimePref, checkedServerTimeInSeconds);
} catch (e) {
@ -245,7 +248,7 @@ function remoteSettingsFunction() {
gPrefs.setCharPref(PREF_SETTINGS_LAST_ETAG, currentEtag);
}
Services.obs.notifyObservers(null, "remote-settings-changes-polled");
Services.obs.notifyObservers(null, "remote-settings:changes-poll-end");
};
/**

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше