зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE
This commit is contained in:
Коммит
3a732b5669
|
@ -135,8 +135,8 @@ HandlerProvider::GetHandlerPayloadSize(
|
||||||
MOZ_ASSERT(mscom::IsCurrentThreadMTA());
|
MOZ_ASSERT(mscom::IsCurrentThreadMTA());
|
||||||
|
|
||||||
if (!IsTargetInterfaceCacheable()) {
|
if (!IsTargetInterfaceCacheable()) {
|
||||||
*aOutPayloadSize = mscom::StructToStream::GetEmptySize();
|
// No handler, so no payload for this instance.
|
||||||
return S_OK;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexAutoLock lock(mMutex);
|
MutexAutoLock lock(mMutex);
|
||||||
|
@ -378,6 +378,11 @@ bool HandlerProvider::IsTargetInterfaceCacheable() {
|
||||||
HRESULT
|
HRESULT
|
||||||
HandlerProvider::WriteHandlerPayload(NotNull<mscom::IInterceptor*> aInterceptor,
|
HandlerProvider::WriteHandlerPayload(NotNull<mscom::IInterceptor*> aInterceptor,
|
||||||
NotNull<IStream*> aStream) {
|
NotNull<IStream*> aStream) {
|
||||||
|
if (!IsTargetInterfaceCacheable()) {
|
||||||
|
// No handler, so no payload for this instance.
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
MutexAutoLock lock(mMutex);
|
MutexAutoLock lock(mMutex);
|
||||||
|
|
||||||
if (!mSerializer || !(*mSerializer)) {
|
if (!mSerializer || !(*mSerializer)) {
|
||||||
|
@ -435,6 +440,13 @@ HandlerProvider::GetEffectiveOutParamIid(REFIID aCallIid, ULONG aCallMethod) {
|
||||||
return NEWEST_IA2_IID;
|
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);
|
MOZ_ASSERT(false);
|
||||||
return IID_IUnknown;
|
return IID_IUnknown;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4155,10 +4155,8 @@ const BrowserSearch = {
|
||||||
* allowed values.
|
* allowed values.
|
||||||
* @param type
|
* @param type
|
||||||
* (string) Indicates how the user selected the search item.
|
* (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 {
|
try {
|
||||||
const details = {type, isOneOff: true};
|
const details = {type, isOneOff: true};
|
||||||
BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details);
|
BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details);
|
||||||
|
|
|
@ -699,8 +699,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
[url, postData] =
|
[url, postData] =
|
||||||
this._parseAndRecordSearchEngineLoad(selectedOneOff.engine,
|
this._parseAndRecordSearchEngineLoad(selectedOneOff.engine,
|
||||||
this.oneOffSearchQuery,
|
this.oneOffSearchQuery,
|
||||||
event, where,
|
event);
|
||||||
openUILinkParams);
|
|
||||||
} else if (action) {
|
} else if (action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case "visiturl":
|
case "visiturl":
|
||||||
|
@ -776,8 +775,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
action.params.engineName,
|
action.params.engineName,
|
||||||
action.params.searchSuggestion || action.params.searchQuery,
|
action.params.searchSuggestion || action.params.searchQuery,
|
||||||
event,
|
event,
|
||||||
where,
|
|
||||||
openUILinkParams,
|
|
||||||
actionDetails
|
actionDetails
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -904,8 +901,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
<parameter name="engineOrEngineName"/>
|
<parameter name="engineOrEngineName"/>
|
||||||
<parameter name="query"/>
|
<parameter name="query"/>
|
||||||
<parameter name="event"/>
|
<parameter name="event"/>
|
||||||
<parameter name="openUILinkWhere"/>
|
|
||||||
<parameter name="openUILinkParams"/>
|
|
||||||
<parameter name="searchActionDetails"/>
|
<parameter name="searchActionDetails"/>
|
||||||
<body><![CDATA[
|
<body><![CDATA[
|
||||||
let engine =
|
let engine =
|
||||||
|
@ -913,7 +908,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
Services.search.getEngineByName(engineOrEngineName) :
|
Services.search.getEngineByName(engineOrEngineName) :
|
||||||
engineOrEngineName;
|
engineOrEngineName;
|
||||||
let isOneOff = this.popup.oneOffSearchButtons
|
let isOneOff = this.popup.oneOffSearchButtons
|
||||||
.maybeRecordTelemetry(event, openUILinkWhere, openUILinkParams);
|
.maybeRecordTelemetry(event);
|
||||||
// Infer the type of the event which triggered the search.
|
// Infer the type of the event which triggered the search.
|
||||||
let eventType = "unknown";
|
let eventType = "unknown";
|
||||||
if (event instanceof KeyboardEvent) {
|
if (event instanceof KeyboardEvent) {
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
flex="1">&contentBlocking.title;</label>
|
flex="1">&contentBlocking.title;</label>
|
||||||
<toolbarbutton id="tracking-protection-preferences-button"
|
<toolbarbutton id="tracking-protection-preferences-button"
|
||||||
class="identity-popup-preferences-button subviewbutton"
|
class="identity-popup-preferences-button subviewbutton"
|
||||||
|
tooltiptext="&identity.contentBlockingPreferences.tooltip;"
|
||||||
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
|
oncommand="ContentBlocking.openPreferences('identityPopup-TP-preferencesButton'); gIdentityHandler.recordClick('cb_prefs_button');" />
|
||||||
</hbox>
|
</hbox>
|
||||||
|
|
||||||
|
|
|
@ -987,13 +987,9 @@ class SearchOneOffs {
|
||||||
*
|
*
|
||||||
* @param {Event} aEvent
|
* @param {Event} aEvent
|
||||||
* An event, like a click on a one-off button.
|
* 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.
|
* @returns {boolean} True if telemetry was recorded and false if not.
|
||||||
*/
|
*/
|
||||||
maybeRecordTelemetry(aEvent, aOpenUILinkWhere, aOpenUILinkParams) {
|
maybeRecordTelemetry(aEvent) {
|
||||||
if (!aEvent) {
|
if (!aEvent) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1029,11 +1025,7 @@ class SearchOneOffs {
|
||||||
source += "-" + this.telemetryOrigin;
|
source += "-" + this.telemetryOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
let tabBackground = aOpenUILinkWhere == "tab" &&
|
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type);
|
||||||
aOpenUILinkParams &&
|
|
||||||
aOpenUILinkParams.inBackground;
|
|
||||||
let where = tabBackground ? "tab-background" : aOpenUILinkWhere;
|
|
||||||
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type, where);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -304,7 +304,7 @@ class MozSearchbar extends MozXULElement {
|
||||||
|
|
||||||
if (!selection || (selection.index == -1)) {
|
if (!selection || (selection.index == -1)) {
|
||||||
oneOffRecorded = this.textbox.popup.oneOffButtons
|
oneOffRecorded = this.textbox.popup.oneOffButtons
|
||||||
.maybeRecordTelemetry(aEvent, aWhere, aParams);
|
.maybeRecordTelemetry(aEvent);
|
||||||
if (!oneOffRecorded) {
|
if (!oneOffRecorded) {
|
||||||
let source = "unknown";
|
let source = "unknown";
|
||||||
let type = "unknown";
|
let type = "unknown";
|
||||||
|
@ -325,8 +325,7 @@ class MozSearchbar extends MozXULElement {
|
||||||
if (!aEngine) {
|
if (!aEngine) {
|
||||||
aEngine = this.currentEngine;
|
aEngine = this.currentEngine;
|
||||||
}
|
}
|
||||||
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type,
|
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type);
|
||||||
aWhere);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class UrlbarView {
|
||||||
this._mainContainer = this.panel.querySelector(".urlbarView-body-inner");
|
this._mainContainer = this.panel.querySelector(".urlbarView-body-inner");
|
||||||
this._rows = this.panel.querySelector(".urlbarView-results");
|
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
|
// For the horizontal fade-out effect, set the overflow attribute on result
|
||||||
// rows when they overflow.
|
// 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;
|
let row = event.target;
|
||||||
while (!row.classList.contains("urlbarView-row")) {
|
while (!row.classList.contains("urlbarView-row")) {
|
||||||
row = row.parentNode;
|
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.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.permissionsReloadHint "You may need to reload the page for changes to apply.">
|
||||||
<!ENTITY identity.permissionsPreferences.tooltip "Open Permissions Preferences">
|
<!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.
|
<!-- Name for the tabs toolbar as spoken by screen readers.
|
||||||
The word "toolbar" is appended automatically and should not be contained below! -->
|
The word "toolbar" is appended automatically and should not be contained below! -->
|
||||||
|
|
|
@ -19,8 +19,8 @@ inline HTMLBodyElement* Document::GetBodyElement() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
size_t Document::FindDocStyleSheetInsertionPoint(
|
size_t Document::FindDocStyleSheetInsertionPoint(const nsTArray<T>& aDocSheets,
|
||||||
const nsTArray<T>& aDocSheets, const StyleSheet& aSheet) {
|
const StyleSheet& aSheet) {
|
||||||
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
|
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
|
||||||
|
|
||||||
// lowest index first
|
// lowest index first
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Document;
|
class Document;
|
||||||
class Element;
|
class Element;
|
||||||
}
|
} // namespace dom
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Right now our identifier map entries contain information for 'name'
|
* Right now our identifier map entries contain information for 'name'
|
||||||
|
|
|
@ -175,8 +175,8 @@ class RemoteObjectProxy : public RemoteObjectProxyBase {
|
||||||
using RemoteObjectProxyBase::RemoteObjectProxyBase;
|
using RemoteObjectProxyBase::RemoteObjectProxyBase;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool DefinePropertiesAndFunctions(
|
bool DefinePropertiesAndFunctions(JSContext* aCx,
|
||||||
JSContext* aCx, JS::Handle<JSObject*> aHolder) const final {
|
JS::Handle<JSObject*> aHolder) const final {
|
||||||
return JS_DefineProperties(aCx, aHolder, P) &&
|
return JS_DefineProperties(aCx, aHolder, P) &&
|
||||||
JS_DefineFunctions(aCx, aHolder, F);
|
JS_DefineFunctions(aCx, aHolder, F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -823,24 +823,24 @@ void GetEnumAttr(nsGenericHTMLElement* aContent, nsAtom* atom,
|
||||||
rv = aForm->GetActionURL(getter_AddRefs(actionURL), aOriginatingElement);
|
rv = aForm->GetActionURL(getter_AddRefs(actionURL), aOriginatingElement);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// Check if CSP allows this form-action
|
// Check if CSP allows this form-action
|
||||||
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
nsCOMPtr<nsIContentSecurityPolicy> csp;
|
||||||
rv = aForm->NodePrincipal()->GetCsp(getter_AddRefs(csp));
|
rv = aForm->NodePrincipal()->GetCsp(getter_AddRefs(csp));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
if (csp) {
|
if (csp) {
|
||||||
bool permitsFormAction = true;
|
bool permitsFormAction = true;
|
||||||
|
|
||||||
// form-action is only enforced if explicitly defined in the
|
// form-action is only enforced if explicitly defined in the
|
||||||
// policy - do *not* consult default-src, see:
|
// policy - do *not* consult default-src, see:
|
||||||
// http://www.w3.org/TR/CSP2/#directive-default-src
|
// http://www.w3.org/TR/CSP2/#directive-default-src
|
||||||
rv = csp->Permits(aForm, nullptr /* nsICSPEventListener */, actionURL,
|
rv = csp->Permits(aForm, nullptr /* nsICSPEventListener */, actionURL,
|
||||||
nsIContentSecurityPolicy::FORM_ACTION_DIRECTIVE, true,
|
nsIContentSecurityPolicy::FORM_ACTION_DIRECTIVE, true,
|
||||||
&permitsFormAction);
|
&permitsFormAction);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
if (!permitsFormAction) {
|
if (!permitsFormAction) {
|
||||||
return NS_ERROR_CSP_FORM_ACTION_VIOLATION;
|
return NS_ERROR_CSP_FORM_ACTION_VIOLATION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get target
|
// Get target
|
||||||
// The target is the originating element formtarget attribute if the element
|
// 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
|
* This locates the inner datetimebox UA Widget element and only the
|
||||||
* UA Widget
|
* 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();
|
Element* GetDateTimeBoxElementInUAWidget();
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "mozilla/SnappyUncompressInputStream.h"
|
#include "mozilla/SnappyUncompressInputStream.h"
|
||||||
#include "mozilla/StaticPtr.h"
|
#include "mozilla/StaticPtr.h"
|
||||||
#include "mozilla/storage.h"
|
#include "mozilla/storage.h"
|
||||||
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/UniquePtrExtensions.h"
|
#include "mozilla/UniquePtrExtensions.h"
|
||||||
#include "mozilla/dom/ContentParent.h"
|
#include "mozilla/dom/ContentParent.h"
|
||||||
|
@ -8329,6 +8330,17 @@ nsresult DeserializeStructuredCloneFile(FileManager* aFileManager,
|
||||||
|
|
||||||
RefPtr<FileInfo> fileInfo = aFileManager->GetFileInfo(id);
|
RefPtr<FileInfo> fileInfo = aFileManager->GetFileInfo(id);
|
||||||
MOZ_ASSERT(fileInfo);
|
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->mFileInfo.swap(fileInfo);
|
||||||
aFile->mType = type;
|
aFile->mType = type;
|
||||||
|
|
|
@ -54,8 +54,8 @@ NS_IMPL_ISUPPORTS(MemoryReportRequestClient, nsIRunnable)
|
||||||
const ReportCallback& aReportCallback,
|
const ReportCallback& aReportCallback,
|
||||||
const FinishCallback& aFinishCallback) {
|
const FinishCallback& aFinishCallback) {
|
||||||
RefPtr<MemoryReportRequestClient> request = new MemoryReportRequestClient(
|
RefPtr<MemoryReportRequestClient> request = new MemoryReportRequestClient(
|
||||||
aGeneration, aAnonymize, aDMDFile, aProcessString,
|
aGeneration, aAnonymize, aDMDFile, aProcessString, aReportCallback,
|
||||||
aReportCallback, aFinishCallback);
|
aFinishCallback);
|
||||||
|
|
||||||
DebugOnly<nsresult> rv;
|
DebugOnly<nsresult> rv;
|
||||||
if (aMinimizeMemoryUsage) {
|
if (aMinimizeMemoryUsage) {
|
||||||
|
@ -127,8 +127,7 @@ class FinishReportingCallback final : public nsIFinishReportingCallback {
|
||||||
|
|
||||||
explicit FinishReportingCallback(uint32_t aGeneration,
|
explicit FinishReportingCallback(uint32_t aGeneration,
|
||||||
const FinishCallback& aFinishCallback)
|
const FinishCallback& aFinishCallback)
|
||||||
: mGeneration(aGeneration),
|
: mGeneration(aGeneration), mFinishCallback(aFinishCallback) {}
|
||||||
mFinishCallback(aFinishCallback) {}
|
|
||||||
|
|
||||||
NS_IMETHOD Callback(nsISupports* aUnused) override {
|
NS_IMETHOD Callback(nsISupports* aUnused) override {
|
||||||
return mFinishCallback(mGeneration) ? NS_OK : NS_ERROR_FAILURE;
|
return mFinishCallback(mGeneration) ? NS_OK : NS_ERROR_FAILURE;
|
||||||
|
|
|
@ -4180,54 +4180,54 @@ SourceListener::InitializeAsync() {
|
||||||
LOG("started all sources");
|
LOG("started all sources");
|
||||||
aHolder.Resolve(true, __func__);
|
aHolder.Resolve(true, __func__);
|
||||||
})
|
})
|
||||||
->Then(GetMainThreadSerialEventTarget(), __func__,
|
->Then(
|
||||||
[self = RefPtr<SourceListener>(this), this]() {
|
GetMainThreadSerialEventTarget(), __func__,
|
||||||
if (mStopped) {
|
[self = RefPtr<SourceListener>(this), this]() {
|
||||||
// We were shut down during the async init
|
if (mStopped) {
|
||||||
return SourceListenerPromise::CreateAndResolve(true, __func__);
|
// We were shut down during the async init
|
||||||
}
|
return SourceListenerPromise::CreateAndResolve(true, __func__);
|
||||||
|
}
|
||||||
|
|
||||||
for (DeviceState* state :
|
for (DeviceState* state :
|
||||||
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
|
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
|
||||||
|
|
||||||
state->mDeviceEnabled = true;
|
state->mDeviceEnabled = true;
|
||||||
state->mTrackEnabled = true;
|
state->mTrackEnabled = true;
|
||||||
state->mTrackEnabledTime = TimeStamp::Now();
|
state->mTrackEnabledTime = TimeStamp::Now();
|
||||||
|
|
||||||
if (state == mVideoDeviceState.get() &&
|
if (state == mVideoDeviceState.get() && !mStream->IsDestroyed()) {
|
||||||
!mStream->IsDestroyed()) {
|
mStream->SetPullingEnabled(kVideoTrack, true);
|
||||||
mStream->SetPullingEnabled(kVideoTrack, true);
|
}
|
||||||
}
|
}
|
||||||
}
|
return SourceListenerPromise::CreateAndResolve(true, __func__);
|
||||||
return SourceListenerPromise::CreateAndResolve(true, __func__);
|
},
|
||||||
},
|
[self = RefPtr<SourceListener>(this),
|
||||||
[self = RefPtr<SourceListener>(this),
|
this](RefPtr<MediaMgrError>&& aResult) {
|
||||||
this](RefPtr<MediaMgrError>&& aResult) {
|
if (mStopped) {
|
||||||
if (mStopped) {
|
return SourceListenerPromise::CreateAndReject(std::move(aResult),
|
||||||
return SourceListenerPromise::CreateAndReject(
|
__func__);
|
||||||
std::move(aResult), __func__);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (DeviceState* state :
|
for (DeviceState* state :
|
||||||
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
|
{mAudioDeviceState.get(), mVideoDeviceState.get()}) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
|
MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
|
||||||
|
|
||||||
state->mStopped = true;
|
state->mStopped = true;
|
||||||
}
|
}
|
||||||
return SourceListenerPromise::CreateAndReject(std::move(aResult),
|
return SourceListenerPromise::CreateAndReject(std::move(aResult),
|
||||||
__func__);
|
__func__);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SourceListener::Stop() {
|
void SourceListener::Stop() {
|
||||||
|
|
|
@ -94,7 +94,7 @@ TEST(MP4Metadata, EmptyStream) {
|
||||||
TEST(MoofParser, EmptyStream) {
|
TEST(MoofParser, EmptyStream) {
|
||||||
RefPtr<ByteStream> stream = new TestStream(nullptr, 0);
|
RefPtr<ByteStream> stream = new TestStream(nullptr, 0);
|
||||||
|
|
||||||
MoofParser parser(stream, 0, false);
|
MoofParser parser(stream, 0, false, true);
|
||||||
EXPECT_EQ(0u, parser.mOffset);
|
EXPECT_EQ(0u, parser.mOffset);
|
||||||
EXPECT_TRUE(parser.ReachedEnd());
|
EXPECT_TRUE(parser.ReachedEnd());
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ TEST(MoofParser, test_case_mp4) {
|
||||||
RefPtr<ByteStream> stream =
|
RefPtr<ByteStream> stream =
|
||||||
new TestStream(buffer.Elements(), buffer.Length());
|
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_EQ(0u, parser.mOffset) << tests[test].mFilename;
|
||||||
EXPECT_FALSE(parser.ReachedEnd()) << tests[test].mFilename;
|
EXPECT_FALSE(parser.ReachedEnd()) << tests[test].mFilename;
|
||||||
EXPECT_TRUE(parser.mInitRange.IsEmpty()) << 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
|
// consumers of ParseStartAndEndTimestamps to add their timestamp offset
|
||||||
// manually. This allows the ContainerParser to be shared across different
|
// manually. This allows the ContainerParser to be shared across different
|
||||||
// timestampOffsets.
|
// timestampOffsets.
|
||||||
mParser = new MoofParser(mStream, 0, /* aIsAudio = */ false);
|
mParser = new MoofParser(mStream, 0, /* aIsAudio = */ false,
|
||||||
|
/* aIsMultitrackParser */ true);
|
||||||
DDLINKCHILD("parser", mParser.get());
|
DDLINKCHILD("parser", mParser.get());
|
||||||
mInitData = new MediaByteBuffer();
|
mInitData = new MediaByteBuffer();
|
||||||
mCompleteInitSegmentRange = MediaByteRange();
|
mCompleteInitSegmentRange = MediaByteRange();
|
||||||
|
|
|
@ -460,7 +460,7 @@ MP4Metadata::ResultAndIndice MP4Metadata::GetTrackIndice(
|
||||||
|
|
||||||
/*static*/ MP4Metadata::ResultAndByteBuffer MP4Metadata::Metadata(
|
/*static*/ MP4Metadata::ResultAndByteBuffer MP4Metadata::Metadata(
|
||||||
ByteStream* aSource) {
|
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();
|
RefPtr<mozilla::MediaByteBuffer> buffer = parser->Metadata();
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
return {MediaResult(NS_ERROR_DOM_MEDIA_METADATA_ERR,
|
return {MediaResult(NS_ERROR_DOM_MEDIA_METADATA_ERR,
|
||||||
|
|
|
@ -55,7 +55,7 @@ bool MoofParser::RebuildFragmentedIndex(BoxContext& aContext) {
|
||||||
ParseMoov(box);
|
ParseMoov(box);
|
||||||
} else if (box.IsType("moof")) {
|
} else if (box.IsType("moof")) {
|
||||||
Moof moof(box, mTrex, mMvhd, mMdhd, mEdts, mSinf, &mLastDecodeTime,
|
Moof moof(box, mTrex, mMvhd, mMdhd, mEdts, mSinf, &mLastDecodeTime,
|
||||||
mIsAudio);
|
mIsAudio, mIsMultitrackParser);
|
||||||
|
|
||||||
if (!moof.IsValid() && !box.Next().IsAvailable()) {
|
if (!moof.IsValid() && !box.Next().IsAvailable()) {
|
||||||
// Moof isn't valid abort search for now.
|
// Moof isn't valid abort search for now.
|
||||||
|
@ -227,11 +227,11 @@ void MoofParser::ParseTrak(Box& aBox) {
|
||||||
if (box.IsType("tkhd")) {
|
if (box.IsType("tkhd")) {
|
||||||
tkhd = Tkhd(box);
|
tkhd = Tkhd(box);
|
||||||
} else if (box.IsType("mdia")) {
|
} else if (box.IsType("mdia")) {
|
||||||
if (!mTrex.mTrackId || tkhd.mTrackId == mTrex.mTrackId) {
|
if (mIsMultitrackParser || tkhd.mTrackId == mTrex.mTrackId) {
|
||||||
ParseMdia(box, tkhd);
|
ParseMdia(box, tkhd);
|
||||||
}
|
}
|
||||||
} else if (box.IsType("edts") &&
|
} else if (box.IsType("edts") &&
|
||||||
(!mTrex.mTrackId || tkhd.mTrackId == mTrex.mTrackId)) {
|
(mIsMultitrackParser || tkhd.mTrackId == mTrex.mTrackId)) {
|
||||||
mEdts = Edts(box);
|
mEdts = Edts(box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,12 +251,8 @@ void MoofParser::ParseMvex(Box& aBox) {
|
||||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||||
if (box.IsType("trex")) {
|
if (box.IsType("trex")) {
|
||||||
Trex trex = Trex(box);
|
Trex trex = Trex(box);
|
||||||
if (!mTrex.mTrackId || trex.mTrackId == mTrex.mTrackId) {
|
if (mIsMultitrackParser || trex.mTrackId == mTrex.mTrackId) {
|
||||||
auto trackId = mTrex.mTrackId;
|
|
||||||
mTrex = trex;
|
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) {
|
void MoofParser::ParseStsd(Box& aBox) {
|
||||||
if (mTrex.mTrackId == 0) {
|
if (mIsMultitrackParser) {
|
||||||
// If mTrex.mTrackId is 0, then the parser is being used to read multiple
|
// 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
|
// tracks metadata, and it is not a sane operation to try and map multiple
|
||||||
// sample description boxes, from different tracks, onto the parser, which
|
// sample description boxes, from different tracks, onto the parser, which
|
||||||
// is modeled around storing metadata for a single track.
|
// 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,
|
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) {
|
: mRange(aBox.Range()), mTfhd(aTrex), mMaxRoundingError(35000) {
|
||||||
nsTArray<Box> psshBoxes;
|
nsTArray<Box> psshBoxes;
|
||||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||||
if (box.IsType("traf")) {
|
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")) {
|
if (box.IsType("pssh")) {
|
||||||
psshBoxes.AppendElement(box);
|
psshBoxes.AppendElement(box);
|
||||||
|
@ -506,14 +504,14 @@ bool Moof::ProcessCencAuxInfo(AtomType aScheme) {
|
||||||
|
|
||||||
void Moof::ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd,
|
void Moof::ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd,
|
||||||
Edts& aEdts, Sinf& aSinf, uint64_t* aDecodeTime,
|
Edts& aEdts, Sinf& aSinf, uint64_t* aDecodeTime,
|
||||||
bool aIsAudio) {
|
bool aIsAudio, bool aIsMultitrackParser) {
|
||||||
MOZ_ASSERT(aDecodeTime);
|
MOZ_ASSERT(aDecodeTime);
|
||||||
Tfdt tfdt;
|
Tfdt tfdt;
|
||||||
|
|
||||||
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
for (Box box = aBox.FirstChild(); box.IsAvailable(); box = box.Next()) {
|
||||||
if (box.IsType("tfhd")) {
|
if (box.IsType("tfhd")) {
|
||||||
mTfhd = Tfhd(box, aTrex);
|
mTfhd = Tfhd(box, aTrex);
|
||||||
} else if (!aTrex.mTrackId || mTfhd.mTrackId == aTrex.mTrackId) {
|
} else if (aIsMultitrackParser || mTfhd.mTrackId == aTrex.mTrackId) {
|
||||||
if (box.IsType("tfdt")) {
|
if (box.IsType("tfdt")) {
|
||||||
tfdt = Tfdt(box);
|
tfdt = Tfdt(box);
|
||||||
} else if (box.IsType("sgpd")) {
|
} 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;
|
return;
|
||||||
}
|
}
|
||||||
// Now search for TRUN boxes.
|
// Now search for TRUN boxes.
|
||||||
|
|
|
@ -227,7 +227,8 @@ struct SampleDescriptionEntry {
|
||||||
class Moof final : public Atom {
|
class Moof final : public Atom {
|
||||||
public:
|
public:
|
||||||
Moof(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts,
|
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);
|
bool GetAuxInfo(AtomType aType, FallibleTArray<MediaByteRange>* aByteRanges);
|
||||||
void FixRounding(const Moof& aMoof);
|
void FixRounding(const Moof& aMoof);
|
||||||
|
|
||||||
|
@ -248,7 +249,8 @@ class Moof final : public Atom {
|
||||||
private:
|
private:
|
||||||
// aDecodeTime is updated to the end of the parsed TRAF on return.
|
// aDecodeTime is updated to the end of the parsed TRAF on return.
|
||||||
void ParseTraf(Box& aBox, Trex& aTrex, Mvhd& aMvhd, Mdhd& aMdhd, Edts& aEdts,
|
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.
|
// aDecodeTime is updated to the end of the parsed TRUN on return.
|
||||||
Result<Ok, nsresult> ParseTrun(Box& aBox, Mvhd& aMvhd, Mdhd& aMdhd,
|
Result<Ok, nsresult> ParseTrun(Box& aBox, Mvhd& aMvhd, Mdhd& aMdhd,
|
||||||
Edts& aEdts, uint64_t* aDecodeTime,
|
Edts& aEdts, uint64_t* aDecodeTime,
|
||||||
|
@ -267,14 +269,18 @@ DDLoggedTypeDeclName(MoofParser);
|
||||||
|
|
||||||
class MoofParser : public DecoderDoctorLifeLogger<MoofParser> {
|
class MoofParser : public DecoderDoctorLifeLogger<MoofParser> {
|
||||||
public:
|
public:
|
||||||
MoofParser(ByteStream* aSource, uint32_t aTrackId, bool aIsAudio)
|
MoofParser(ByteStream* aSource, uint32_t aTrackId, bool aIsAudio,
|
||||||
|
bool aIsMultitrackParser = false)
|
||||||
: mSource(aSource),
|
: mSource(aSource),
|
||||||
mOffset(0),
|
mOffset(0),
|
||||||
mTrex(aTrackId),
|
mTrex(aTrackId),
|
||||||
mIsAudio(aIsAudio),
|
mIsAudio(aIsAudio),
|
||||||
mLastDecodeTime(0) {
|
mLastDecodeTime(0),
|
||||||
// Setting the mTrex.mTrackId to 0 is a nasty work around for calculating
|
mIsMultitrackParser(aIsMultitrackParser) {
|
||||||
// the composition range for MSE. We need an array of tracks.
|
// 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);
|
DDLINKCHILD("source", aSource);
|
||||||
}
|
}
|
||||||
bool RebuildFragmentedIndex(const mozilla::MediaByteRangeSet& aByteRanges);
|
bool RebuildFragmentedIndex(const mozilla::MediaByteRangeSet& aByteRanges);
|
||||||
|
@ -326,6 +332,7 @@ class MoofParser : public DecoderDoctorLifeLogger<MoofParser> {
|
||||||
nsTArray<MediaByteRange> mMediaRanges;
|
nsTArray<MediaByteRange> mMediaRanges;
|
||||||
bool mIsAudio;
|
bool mIsAudio;
|
||||||
uint64_t mLastDecodeTime;
|
uint64_t mLastDecodeTime;
|
||||||
|
bool mIsMultitrackParser;
|
||||||
};
|
};
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
|
|
|
@ -605,20 +605,19 @@ nsresult MediaEngineWebRTCMicrophoneSource::Stop(
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
|
RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
|
||||||
NS_DispatchToMainThread(
|
NS_DispatchToMainThread(media::NewRunnableFrom([that, stream = mStream]() {
|
||||||
media::NewRunnableFrom([that, stream = mStream]() {
|
if (stream->IsDestroyed()) {
|
||||||
if (stream->IsDestroyed()) {
|
return NS_OK;
|
||||||
return NS_OK;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stream->GraphImpl()->AppendMessage(MakeUnique<StartStopMessage>(
|
stream->GraphImpl()->AppendMessage(MakeUnique<StartStopMessage>(
|
||||||
that->mInputProcessing, StartStopMessage::Stop));
|
that->mInputProcessing, StartStopMessage::Stop));
|
||||||
CubebUtils::AudioDeviceID deviceID = that->mDeviceInfo->DeviceID();
|
CubebUtils::AudioDeviceID deviceID = that->mDeviceInfo->DeviceID();
|
||||||
Maybe<CubebUtils::AudioDeviceID> id = Some(deviceID);
|
Maybe<CubebUtils::AudioDeviceID> id = Some(deviceID);
|
||||||
stream->CloseAudioInput(id, that->mInputProcessing);
|
stream->CloseAudioInput(id, that->mInputProcessing);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
MOZ_ASSERT(mState == kStarted, "Should be started when stopping");
|
MOZ_ASSERT(mState == kStarted, "Should be started when stopping");
|
||||||
mState = kStopped;
|
mState = kStopped;
|
||||||
|
|
|
@ -152,8 +152,9 @@ already_AddRefed<WakeLock> PowerManagerService::NewWakeLockOnBehalfOfProcess(
|
||||||
|
|
||||||
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
|
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
|
||||||
|
|
||||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
|
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
|
||||||
mozilla::dom::power::PowerManagerService::GetInstance)
|
nsIPowerManagerService,
|
||||||
|
mozilla::dom::power::PowerManagerService::GetInstance)
|
||||||
|
|
||||||
static const mozilla::Module::CIDEntry kPowerManagerCIDs[] = {
|
static const mozilla::Module::CIDEntry kPowerManagerCIDs[] = {
|
||||||
// clang-format off
|
// 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
|
// We mark the power module as being available in the GPU process because the
|
||||||
// appshell depends on the power manager service.
|
// appshell depends on the power manager service.
|
||||||
static const mozilla::Module kPowerManagerModule = {mozilla::Module::kVersion,
|
static const mozilla::Module kPowerManagerModule = {
|
||||||
kPowerManagerCIDs,
|
mozilla::Module::kVersion,
|
||||||
kPowerManagerContracts,
|
kPowerManagerCIDs,
|
||||||
nullptr,
|
kPowerManagerContracts,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr,
|
nullptr,
|
||||||
mozilla::Module::ALLOW_IN_GPU_PROCESS};
|
nullptr,
|
||||||
|
mozilla::Module::ALLOW_IN_GPU_PROCESS};
|
||||||
|
|
||||||
NSMODULE_DEFN(nsPowerManagerModule) = &kPowerManagerModule;
|
NSMODULE_DEFN(nsPowerManagerModule) = &kPowerManagerModule;
|
||||||
|
|
|
@ -40,9 +40,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(LoadedScript)
|
||||||
|
|
||||||
LoadedScript::LoadedScript(ScriptKind aKind, ScriptFetchOptions* aFetchOptions,
|
LoadedScript::LoadedScript(ScriptKind aKind, ScriptFetchOptions* aFetchOptions,
|
||||||
nsIURI* aBaseURL)
|
nsIURI* aBaseURL)
|
||||||
: mKind(aKind),
|
: mKind(aKind), mFetchOptions(aFetchOptions), mBaseURL(aBaseURL) {
|
||||||
mFetchOptions(aFetchOptions),
|
|
||||||
mBaseURL(aBaseURL) {
|
|
||||||
MOZ_ASSERT(mFetchOptions);
|
MOZ_ASSERT(mFetchOptions);
|
||||||
MOZ_ASSERT(mBaseURL);
|
MOZ_ASSERT(mBaseURL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2301,9 +2301,8 @@ nsresult ScriptLoader::FillCompileOptionsForRequest(
|
||||||
|
|
||||||
bool isScriptElement =
|
bool isScriptElement =
|
||||||
!aRequest->IsModuleRequest() || aRequest->AsModuleRequest()->IsTopLevel();
|
!aRequest->IsModuleRequest() || aRequest->AsModuleRequest()->IsTopLevel();
|
||||||
aOptions->setIntroductionInfoToCaller(jsapi.cx(),
|
aOptions->setIntroductionInfoToCaller(
|
||||||
isScriptElement ? "scriptElement"
|
jsapi.cx(), isScriptElement ? "scriptElement" : "importedModule");
|
||||||
: "importedModule");
|
|
||||||
aOptions->setFileAndLine(aRequest->mURL.get(), aRequest->mLineNo);
|
aOptions->setFileAndLine(aRequest->mURL.get(), aRequest->mLineNo);
|
||||||
aOptions->setIsRunOnce(true);
|
aOptions->setIsRunOnce(true);
|
||||||
aOptions->setNoScriptRval(true);
|
aOptions->setNoScriptRval(true);
|
||||||
|
|
|
@ -27,10 +27,10 @@ class SMILKeySpline {
|
||||||
* aX1, etc. are the x1, y1, x2, y2 cubic Bezier control points as defined
|
* 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
|
* 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)
|
SMILKeySpline(double aX1, double aY1, double aX2, double aY2)
|
||||||
: mX1(0), mY1(0), mX2(0), mY2(0) {
|
: mX1(0), mY1(0), mX2(0), mY2(0) {
|
||||||
Init(aX1, aY1, aX2, aY2);
|
Init(aX1, aY1, aX2, aY2);
|
||||||
}
|
}
|
||||||
|
|
||||||
double X1() const { return mX1; }
|
double X1() const { return mX1; }
|
||||||
double Y1() const { return mY1; }
|
double Y1() const { return mY1; }
|
||||||
|
|
|
@ -191,8 +191,7 @@ class SVGContentUtils {
|
||||||
/*
|
/*
|
||||||
* Report a localized error message to the error console.
|
* Report a localized error message to the error console.
|
||||||
*/
|
*/
|
||||||
static nsresult ReportToConsole(dom::Document* doc,
|
static nsresult ReportToConsole(dom::Document* doc, const char* aWarning,
|
||||||
const char* aWarning,
|
|
||||||
const char16_t** aParams,
|
const char16_t** aParams,
|
||||||
uint32_t aParamsLength);
|
uint32_t aParamsLength);
|
||||||
|
|
||||||
|
|
|
@ -77,8 +77,8 @@ class SVGIntegerPair {
|
||||||
mIndex(aIndex) {}
|
mIndex(aIndex) {}
|
||||||
virtual ~DOMAnimatedInteger();
|
virtual ~DOMAnimatedInteger();
|
||||||
|
|
||||||
SVGIntegerPair* mVal; // kept alive because it belongs to content
|
SVGIntegerPair* mVal; // kept alive because it belongs to content
|
||||||
PairIndex mIndex; // are we the first or second integer
|
PairIndex mIndex; // are we the first or second integer
|
||||||
|
|
||||||
virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||||
virtual void SetBaseVal(int32_t aValue) override {
|
virtual void SetBaseVal(int32_t aValue) override {
|
||||||
|
|
|
@ -78,8 +78,8 @@ class SVGNumberPair {
|
||||||
mIndex(aIndex) {}
|
mIndex(aIndex) {}
|
||||||
virtual ~DOMAnimatedNumber();
|
virtual ~DOMAnimatedNumber();
|
||||||
|
|
||||||
SVGNumberPair* mVal; // kept alive because it belongs to content
|
SVGNumberPair* mVal; // kept alive because it belongs to content
|
||||||
PairIndex mIndex; // are we the first or second number
|
PairIndex mIndex; // are we the first or second number
|
||||||
|
|
||||||
virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); }
|
||||||
virtual void SetBaseVal(float aValue) override {
|
virtual void SetBaseVal(float aValue) override {
|
||||||
|
|
|
@ -46,7 +46,8 @@ bool SVGTests::HasExtension(const nsAString& aExtension) const {
|
||||||
if (aExtension.EqualsLiteral(str)) return true;
|
if (aExtension.EqualsLiteral(str)) return true;
|
||||||
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1999/xhtml")
|
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1999/xhtml")
|
||||||
nsNameSpaceManager* nameSpaceManager = nsNameSpaceManager::GetInstance();
|
nsNameSpaceManager* nameSpaceManager = nsNameSpaceManager::GetInstance();
|
||||||
if (AsSVGElement()->IsInChromeDocument() || !nameSpaceManager->mMathMLDisabled) {
|
if (AsSVGElement()->IsInChromeDocument() ||
|
||||||
|
!nameSpaceManager->mMathMLDisabled) {
|
||||||
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1998/Math/MathML")
|
SVG_SUPPORTED_EXTENSION("http://www.w3.org/1998/Math/MathML")
|
||||||
}
|
}
|
||||||
#undef SVG_SUPPORTED_EXTENSION
|
#undef SVG_SUPPORTED_EXTENSION
|
||||||
|
|
|
@ -460,8 +460,7 @@ RefPtr<PerformanceInfoPromise> WorkerDebugger::ReportPerformanceInfo() {
|
||||||
RefPtr<nsIURI> scriptURI = mWorkerPrivate->GetResolvedScriptURI();
|
RefPtr<nsIURI> scriptURI = mWorkerPrivate->GetResolvedScriptURI();
|
||||||
if (NS_WARN_IF(!scriptURI)) {
|
if (NS_WARN_IF(!scriptURI)) {
|
||||||
// This can happen at shutdown, let's stop here.
|
// This can happen at shutdown, let's stop here.
|
||||||
return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE,
|
return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||||
__func__);
|
|
||||||
}
|
}
|
||||||
nsCString url = scriptURI->GetSpecOrDefault();
|
nsCString url = scriptURI->GetSpecOrDefault();
|
||||||
|
|
||||||
|
|
|
@ -152,8 +152,8 @@ class nsXBLStreamListener final : public nsIStreamListener,
|
||||||
AutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
|
AutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
|
||||||
|
|
||||||
nsWeakPtr mBoundDocument;
|
nsWeakPtr mBoundDocument;
|
||||||
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
|
nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
|
||||||
nsCOMPtr<Document> mBindingDocument; // Only set until OnStartRequest
|
nsCOMPtr<Document> mBindingDocument; // Only set until OnStartRequest
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Implementation file */
|
/* Implementation file */
|
||||||
|
|
|
@ -35,9 +35,7 @@ DOMIterator::DOMIterator(nsINode& aNode MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult DOMIterator::Init(nsRange& aRange) {
|
nsresult DOMIterator::Init(nsRange& aRange) { return mIter->Init(&aRange); }
|
||||||
return mIter->Init(&aRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
DOMIterator::DOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
DOMIterator::DOMIterator(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
||||||
: mIter(&mPostOrderIter) {
|
: mIter(&mPostOrderIter) {
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include "TextServicesDocument.h"
|
#include "TextServicesDocument.h"
|
||||||
|
|
||||||
#include "FilteredContentIterator.h" // for FilteredContentIterator
|
#include "FilteredContentIterator.h" // for FilteredContentIterator
|
||||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
|
||||||
#include "mozilla/EditorUtils.h" // for AutoTransactionBatchExternal
|
#include "mozilla/EditorUtils.h" // for AutoTransactionBatchExternal
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/Selection.h"
|
#include "mozilla/dom/Selection.h"
|
||||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||||
|
@ -15,22 +15,22 @@
|
||||||
#include "nsAString.h" // for nsAString::Length, etc
|
#include "nsAString.h" // for nsAString::Length, etc
|
||||||
#include "nsContentUtils.h" // for nsContentUtils
|
#include "nsContentUtils.h" // for nsContentUtils
|
||||||
#include "nsComposeTxtSrvFilter.h"
|
#include "nsComposeTxtSrvFilter.h"
|
||||||
#include "nsDebug.h" // for NS_ENSURE_TRUE, etc
|
#include "nsDebug.h" // for NS_ENSURE_TRUE, etc
|
||||||
#include "nsDependentSubstring.h" // for Substring
|
#include "nsDependentSubstring.h" // for Substring
|
||||||
#include "nsError.h" // for NS_OK, NS_ERROR_FAILURE, etc
|
#include "nsError.h" // for NS_OK, NS_ERROR_FAILURE, etc
|
||||||
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
|
#include "nsGenericHTMLElement.h" // for nsGenericHTMLElement
|
||||||
#include "nsIContent.h" // for nsIContent, etc
|
#include "nsIContent.h" // for nsIContent, etc
|
||||||
#include "nsID.h" // for NS_GET_IID
|
#include "nsID.h" // for NS_GET_IID
|
||||||
#include "nsIEditor.h" // for nsIEditor, etc
|
#include "nsIEditor.h" // for nsIEditor, etc
|
||||||
#include "nsINode.h" // for nsINode
|
#include "nsINode.h" // for nsINode
|
||||||
#include "nsISelectionController.h" // for nsISelectionController, etc
|
#include "nsISelectionController.h" // for nsISelectionController, etc
|
||||||
#include "nsISupportsBase.h" // for nsISupports
|
#include "nsISupportsBase.h" // for nsISupports
|
||||||
#include "nsISupportsUtils.h" // for NS_IF_ADDREF, NS_ADDREF, etc
|
#include "nsISupportsUtils.h" // for NS_IF_ADDREF, NS_ADDREF, etc
|
||||||
#include "mozilla/intl/WordBreaker.h" // for WordRange, WordBreaker
|
#include "mozilla/intl/WordBreaker.h" // for WordRange, WordBreaker
|
||||||
#include "nsRange.h" // for nsRange
|
#include "nsRange.h" // for nsRange
|
||||||
#include "nsString.h" // for nsString, nsAutoString
|
#include "nsString.h" // for nsString, nsAutoString
|
||||||
#include "nscore.h" // for nsresult, NS_IMETHODIMP, etc
|
#include "nscore.h" // for nsresult, NS_IMETHODIMP, etc
|
||||||
#include "mozilla/UniquePtr.h" // for UniquePtr
|
#include "mozilla/UniquePtr.h" // for UniquePtr
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class TextEditor;
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Document;
|
class Document;
|
||||||
class Element;
|
class Element;
|
||||||
};
|
}; // namespace dom
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The TextServicesDocument presents the document in as a bunch of flattened
|
* The TextServicesDocument presents the document in as a bunch of flattened
|
||||||
|
|
|
@ -310,8 +310,7 @@ GLContextEGL::GLContextEGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void GLContextEGL::OnMarkDestroyed() {
|
||||||
GLContextEGL::OnMarkDestroyed() {
|
|
||||||
if (mSurfaceOverride != EGL_NO_SURFACE) {
|
if (mSurfaceOverride != EGL_NO_SURFACE) {
|
||||||
SetEGLSurfaceOverride(EGL_NO_SURFACE);
|
SetEGLSurfaceOverride(EGL_NO_SURFACE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@ void FrameMetrics::RecalculateLayoutViewportOffset() {
|
||||||
if (!mIsRootContent) {
|
if (!mIsRootContent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
KeepLayoutViewportEnclosingVisualViewport(GetVisualViewport(), mLayoutViewport);
|
KeepLayoutViewportEnclosingVisualViewport(GetVisualViewport(),
|
||||||
|
mLayoutViewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void FrameMetrics::KeepLayoutViewportEnclosingVisualViewport(
|
/* static */ void FrameMetrics::KeepLayoutViewportEnclosingVisualViewport(
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
|
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
|
||||||
#include "mozilla/gfx/Point.h" // for IntPoint
|
#include "mozilla/gfx/Point.h" // for IntPoint
|
||||||
#include "mozilla/Maybe.h"
|
#include "mozilla/Maybe.h"
|
||||||
#include "mozilla/TimeStamp.h" // for TimeStamp
|
#include "mozilla/TimeStamp.h" // for TimeStamp
|
||||||
#include "mozilla/TypedEnumBits.h"
|
#include "mozilla/TypedEnumBits.h"
|
||||||
#include "nsRegion.h"
|
#include "nsRegion.h"
|
||||||
#include "nsStyleConsts.h"
|
#include "nsStyleConsts.h"
|
||||||
|
@ -420,7 +420,7 @@ MOZ_DEFINE_ENUM_CLASS_WITH_BASE(CompositionPayloadType, uint8_t, (
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
struct CompositionPayload {
|
struct CompositionPayload {
|
||||||
bool operator ==(const CompositionPayload& aOther) const {
|
bool operator==(const CompositionPayload& aOther) const {
|
||||||
return mType == aOther.mType && mTimeStamp == aOther.mTimeStamp;
|
return mType == aOther.mType && mTimeStamp == aOther.mTimeStamp;
|
||||||
}
|
}
|
||||||
/* The type of payload that is in this composition */
|
/* The type of payload that is in this composition */
|
||||||
|
|
|
@ -205,7 +205,8 @@ static ScreenMargin ScrollFrame(nsIContent* aContent,
|
||||||
aRequest, actualScrollOffset);
|
aRequest, actualScrollOffset);
|
||||||
}
|
}
|
||||||
} else if (aRequest.IsRootContent() &&
|
} 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
|
// 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.
|
// display port, so the display port is misplaced when a pinch zoom occurs.
|
||||||
//
|
//
|
||||||
|
|
|
@ -170,8 +170,9 @@ class CrossProcessCompositorBridgeParent final
|
||||||
|
|
||||||
void UpdatePaintTime(LayerTransactionParent* aLayerTree,
|
void UpdatePaintTime(LayerTransactionParent* aLayerTree,
|
||||||
const TimeDuration& aPaintTime) override;
|
const TimeDuration& aPaintTime) override;
|
||||||
void RegisterPayload(LayerTransactionParent* aLayerTree,
|
void RegisterPayload(
|
||||||
const InfallibleTArray<CompositionPayload>& aPayload) override;
|
LayerTransactionParent* aLayerTree,
|
||||||
|
const InfallibleTArray<CompositionPayload>& aPayload) override;
|
||||||
|
|
||||||
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(
|
PWebRenderBridgeParent* AllocPWebRenderBridgeParent(
|
||||||
const wr::PipelineId& aPipelineId,
|
const wr::PipelineId& aPipelineId,
|
||||||
|
|
|
@ -710,7 +710,7 @@ struct ParamTraits<mozilla::layers::SimpleLayerAttributes>
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::layers::ScrollUpdateInfo>
|
struct ParamTraits<mozilla::layers::ScrollUpdateInfo>
|
||||||
: public PlainOldDataSerializer<mozilla::layers::ScrollUpdateInfo> {};
|
: public PlainOldDataSerializer<mozilla::layers::ScrollUpdateInfo> {};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::layers::CompositionPayloadType>
|
struct ParamTraits<mozilla::layers::CompositionPayloadType>
|
||||||
: public ContiguousEnumSerializerInclusive<
|
: public ContiguousEnumSerializerInclusive<
|
||||||
|
@ -719,8 +719,7 @@ struct ParamTraits<mozilla::layers::CompositionPayloadType>
|
||||||
mozilla::layers::kHighestCompositionPayloadType> {};
|
mozilla::layers::kHighestCompositionPayloadType> {};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct ParamTraits<mozilla::layers::CompositionPayload>
|
struct ParamTraits<mozilla::layers::CompositionPayload> {
|
||||||
{
|
|
||||||
typedef mozilla::layers::CompositionPayload paramType;
|
typedef mozilla::layers::CompositionPayload paramType;
|
||||||
|
|
||||||
static void Write(Message* aMsg, const paramType& aParam) {
|
static void Write(Message* aMsg, const paramType& aParam) {
|
||||||
|
@ -728,7 +727,8 @@ struct ParamTraits<mozilla::layers::CompositionPayload>
|
||||||
WriteParam(aMsg, aParam.mTimeStamp);
|
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) &&
|
return ReadParam(aMsg, aIter, &aResult->mType) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mTimeStamp);
|
ReadParam(aMsg, aIter, &aResult->mTimeStamp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,9 @@
|
||||||
|
|
||||||
//#define CLIP_LOG(...) printf_stderr("CLIP: " __VA_ARGS__)
|
//#define CLIP_LOG(...) printf_stderr("CLIP: " __VA_ARGS__)
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
//#define CLIP_LOG(...) if (XRE_IsContentProcess()) printf_stderr("CLIP: " __VA_ARGS__)
|
//#define CLIP_LOG(...) if (XRE_IsContentProcess()) printf_stderr("CLIP: " __VA_ARGS__)
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
|
@ -11,71 +11,50 @@
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
RenderRootStateManager::RenderRootStateManager(WebRenderLayerManager* aLayerManager)
|
RenderRootStateManager::RenderRootStateManager(
|
||||||
: mLayerManager(aLayerManager)
|
WebRenderLayerManager* aLayerManager)
|
||||||
, mDestroyed(false)
|
: mLayerManager(aLayerManager), mDestroyed(false) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
RenderRootStateManager::~RenderRootStateManager()
|
RenderRootStateManager::~RenderRootStateManager() {}
|
||||||
{}
|
|
||||||
|
|
||||||
// RenderRootStateManager shares its ref count with the WebRenderLayerManager that
|
// RenderRootStateManager shares its ref count with the WebRenderLayerManager
|
||||||
// created it. You can think of the two classes as being one unit, except there
|
// that created it. You can think of the two classes as being one unit, except
|
||||||
// are multiple RenderRootStateManagers per WebRenderLayerManager. Since we need
|
// there are multiple RenderRootStateManagers per WebRenderLayerManager. Since
|
||||||
// to reference the WebRenderLayerManager and it needs to reference us, this
|
// we need to reference the WebRenderLayerManager and it needs to reference us,
|
||||||
// avoids us needing to involve the cycle collector.
|
// this avoids us needing to involve the cycle collector.
|
||||||
void
|
void RenderRootStateManager::AddRef() { mLayerManager->AddRef(); }
|
||||||
RenderRootStateManager::AddRef()
|
|
||||||
{
|
|
||||||
mLayerManager->AddRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::Release() { mLayerManager->Release(); }
|
||||||
RenderRootStateManager::Release()
|
|
||||||
{
|
|
||||||
mLayerManager->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
WebRenderBridgeChild* RenderRootStateManager::WrBridge() const {
|
||||||
WebRenderBridgeChild*
|
|
||||||
RenderRootStateManager::WrBridge() const
|
|
||||||
{
|
|
||||||
return mLayerManager->WrBridge();
|
return mLayerManager->WrBridge();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRenderCommandBuilder&
|
WebRenderCommandBuilder& RenderRootStateManager::CommandBuilder() {
|
||||||
RenderRootStateManager::CommandBuilder()
|
|
||||||
{
|
|
||||||
return mLayerManager->CommandBuilder();
|
return mLayerManager->CommandBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderRootStateManager::WebRenderUserDataRefTable*
|
RenderRootStateManager::WebRenderUserDataRefTable*
|
||||||
RenderRootStateManager::GetWebRenderUserDataTable()
|
RenderRootStateManager::GetWebRenderUserDataTable() {
|
||||||
{
|
|
||||||
return mLayerManager->GetWebRenderUserDataTable();
|
return mLayerManager->GetWebRenderUserDataTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
wr::IpcResourceUpdateQueue&
|
wr::IpcResourceUpdateQueue& RenderRootStateManager::AsyncResourceUpdates() {
|
||||||
RenderRootStateManager::AsyncResourceUpdates()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!mAsyncResourceUpdates) {
|
if (!mAsyncResourceUpdates) {
|
||||||
mAsyncResourceUpdates.emplace(WrBridge());
|
mAsyncResourceUpdates.emplace(WrBridge());
|
||||||
|
|
||||||
RefPtr<Runnable> task = NewRunnableMethod(
|
RefPtr<Runnable> task = NewRunnableMethod(
|
||||||
"RenderRootStateManager::FlushAsyncResourceUpdates",
|
"RenderRootStateManager::FlushAsyncResourceUpdates", this,
|
||||||
this, &RenderRootStateManager::FlushAsyncResourceUpdates);
|
&RenderRootStateManager::FlushAsyncResourceUpdates);
|
||||||
NS_DispatchToMainThread(task.forget());
|
NS_DispatchToMainThread(task.forget());
|
||||||
}
|
}
|
||||||
|
|
||||||
return mAsyncResourceUpdates.ref();
|
return mAsyncResourceUpdates.ref();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::Destroy() {
|
||||||
RenderRootStateManager::Destroy()
|
|
||||||
{
|
|
||||||
ClearAsyncAnimations();
|
ClearAsyncAnimations();
|
||||||
|
|
||||||
if (WrBridge()) {
|
if (WrBridge()) {
|
||||||
|
@ -90,9 +69,7 @@ RenderRootStateManager::Destroy()
|
||||||
mDestroyed = true;
|
mDestroyed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::FlushAsyncResourceUpdates() {
|
||||||
RenderRootStateManager::FlushAsyncResourceUpdates()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
if (!mAsyncResourceUpdates) {
|
if (!mAsyncResourceUpdates) {
|
||||||
|
@ -106,21 +83,16 @@ RenderRootStateManager::FlushAsyncResourceUpdates()
|
||||||
mAsyncResourceUpdates.reset();
|
mAsyncResourceUpdates.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::AddImageKeyForDiscard(wr::ImageKey key) {
|
||||||
RenderRootStateManager::AddImageKeyForDiscard(wr::ImageKey key)
|
|
||||||
{
|
|
||||||
mImageKeysToDelete.AppendElement(key);
|
mImageKeysToDelete.AppendElement(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::AddBlobImageKeyForDiscard(wr::BlobImageKey key) {
|
||||||
RenderRootStateManager::AddBlobImageKeyForDiscard(wr::BlobImageKey key)
|
|
||||||
{
|
|
||||||
mBlobImageKeysToDelete.AppendElement(key);
|
mBlobImageKeysToDelete.AppendElement(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::DiscardImagesInTransaction(
|
||||||
RenderRootStateManager::DiscardImagesInTransaction(wr::IpcResourceUpdateQueue& aResources)
|
wr::IpcResourceUpdateQueue& aResources) {
|
||||||
{
|
|
||||||
for (const auto& key : mImageKeysToDelete) {
|
for (const auto& key : mImageKeysToDelete) {
|
||||||
aResources.DeleteImage(key);
|
aResources.DeleteImage(key);
|
||||||
}
|
}
|
||||||
|
@ -131,9 +103,7 @@ RenderRootStateManager::DiscardImagesInTransaction(wr::IpcResourceUpdateQueue& a
|
||||||
mBlobImageKeysToDelete.Clear();
|
mBlobImageKeysToDelete.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::DiscardLocalImages() {
|
||||||
RenderRootStateManager::DiscardLocalImages()
|
|
||||||
{
|
|
||||||
// Removes images but doesn't tell the parent side about them
|
// Removes images but doesn't tell the parent side about them
|
||||||
// This is useful in empty / failed transactions where we created
|
// This is useful in empty / failed transactions where we created
|
||||||
// image keys but didn't tell the parent about them yet.
|
// image keys but didn't tell the parent about them yet.
|
||||||
|
@ -141,16 +111,12 @@ RenderRootStateManager::DiscardLocalImages()
|
||||||
mBlobImageKeysToDelete.Clear();
|
mBlobImageKeysToDelete.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::ClearCachedResources() {
|
||||||
RenderRootStateManager::ClearCachedResources()
|
|
||||||
{
|
|
||||||
mActiveCompositorAnimationIds.clear();
|
mActiveCompositorAnimationIds.clear();
|
||||||
mDiscardedCompositorAnimationsIds.Clear();
|
mDiscardedCompositorAnimationsIds.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::AddActiveCompositorAnimationId(uint64_t aId) {
|
||||||
RenderRootStateManager::AddActiveCompositorAnimationId(uint64_t aId)
|
|
||||||
{
|
|
||||||
// In layers-free mode we track the active compositor animation ids on the
|
// 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
|
// 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
|
// 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);
|
mActiveCompositorAnimationIds.insert(aId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::AddCompositorAnimationsIdForDiscard(uint64_t aId) {
|
||||||
RenderRootStateManager::AddCompositorAnimationsIdForDiscard(uint64_t aId)
|
|
||||||
{
|
|
||||||
if (mActiveCompositorAnimationIds.erase(aId)) {
|
if (mActiveCompositorAnimationIds.erase(aId)) {
|
||||||
// For layers-free ensure we don't try to discard an animation id that wasn't
|
// For layers-free ensure we don't try to discard an animation id that
|
||||||
// active. We also remove it from mActiveCompositorAnimationIds so we don't
|
// wasn't active. We also remove it from mActiveCompositorAnimationIds so we
|
||||||
// discard it again unless it gets re-activated.
|
// don't discard it again unless it gets re-activated.
|
||||||
mDiscardedCompositorAnimationsIds.AppendElement(aId);
|
mDiscardedCompositorAnimationsIds.AppendElement(aId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::DiscardCompositorAnimations() {
|
||||||
RenderRootStateManager::DiscardCompositorAnimations()
|
if (WrBridge()->IPCOpen() && !mDiscardedCompositorAnimationsIds.IsEmpty()) {
|
||||||
{
|
WrBridge()->SendDeleteCompositorAnimations(
|
||||||
if (WrBridge()->IPCOpen() &&
|
mDiscardedCompositorAnimationsIds);
|
||||||
!mDiscardedCompositorAnimationsIds.IsEmpty()) {
|
|
||||||
WrBridge()->
|
|
||||||
SendDeleteCompositorAnimations(mDiscardedCompositorAnimationsIds);
|
|
||||||
}
|
}
|
||||||
mDiscardedCompositorAnimationsIds.Clear();
|
mDiscardedCompositorAnimationsIds.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::RegisterAsyncAnimation(
|
||||||
RenderRootStateManager::RegisterAsyncAnimation(const wr::ImageKey& aKey,
|
const wr::ImageKey& aKey, SharedSurfacesAnimation* aAnimation) {
|
||||||
SharedSurfacesAnimation* aAnimation)
|
|
||||||
{
|
|
||||||
mAsyncAnimations.insert(std::make_pair(wr::AsUint64(aKey), aAnimation));
|
mAsyncAnimations.insert(std::make_pair(wr::AsUint64(aKey), aAnimation));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::DeregisterAsyncAnimation(
|
||||||
RenderRootStateManager::DeregisterAsyncAnimation(const wr::ImageKey& aKey)
|
const wr::ImageKey& aKey) {
|
||||||
{
|
|
||||||
mAsyncAnimations.erase(wr::AsUint64(aKey));
|
mAsyncAnimations.erase(wr::AsUint64(aKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::ClearAsyncAnimations() {
|
||||||
RenderRootStateManager::ClearAsyncAnimations()
|
|
||||||
{
|
|
||||||
for (const auto& i : mAsyncAnimations) {
|
for (const auto& i : mAsyncAnimations) {
|
||||||
i.second->Invalidate(this);
|
i.second->Invalidate(this);
|
||||||
}
|
}
|
||||||
mAsyncAnimations.clear();
|
mAsyncAnimations.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::WrReleasedImages(
|
||||||
RenderRootStateManager::WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair>& aPairs)
|
const nsTArray<wr::ExternalImageKeyPair>& aPairs) {
|
||||||
{
|
|
||||||
// A SharedSurfaceAnimation object's lifetime is tied to its owning
|
// A SharedSurfaceAnimation object's lifetime is tied to its owning
|
||||||
// ImageContainer. When the ImageContainer is released,
|
// ImageContainer. When the ImageContainer is released,
|
||||||
// SharedSurfaceAnimation::Destroy is called which should ensure it is removed
|
// SharedSurfaceAnimation::Destroy is called which should ensure it is removed
|
||||||
|
@ -223,54 +178,41 @@ RenderRootStateManager::WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void RenderRootStateManager::AddWebRenderParentCommand(
|
||||||
RenderRootStateManager::AddWebRenderParentCommand(const WebRenderParentCommand& aCmd)
|
const WebRenderParentCommand& aCmd) {
|
||||||
{
|
|
||||||
WrBridge()->AddWebRenderParentCommand(aCmd);
|
WrBridge()->AddWebRenderParentCommand(aCmd);
|
||||||
}
|
}
|
||||||
void
|
void RenderRootStateManager::UpdateResources(
|
||||||
RenderRootStateManager::UpdateResources(wr::IpcResourceUpdateQueue& aResources)
|
wr::IpcResourceUpdateQueue& aResources) {
|
||||||
{
|
|
||||||
WrBridge()->UpdateResources(aResources);
|
WrBridge()->UpdateResources(aResources);
|
||||||
}
|
}
|
||||||
void
|
void RenderRootStateManager::AddPipelineIdForAsyncCompositable(
|
||||||
RenderRootStateManager::AddPipelineIdForAsyncCompositable(const wr::PipelineId& aPipelineId,
|
const wr::PipelineId& aPipelineId, const CompositableHandle& aHandle) {
|
||||||
const CompositableHandle& aHandle)
|
|
||||||
{
|
|
||||||
WrBridge()->AddPipelineIdForAsyncCompositable(aPipelineId, aHandle);
|
WrBridge()->AddPipelineIdForAsyncCompositable(aPipelineId, aHandle);
|
||||||
}
|
}
|
||||||
void
|
void RenderRootStateManager::AddPipelineIdForCompositable(
|
||||||
RenderRootStateManager::AddPipelineIdForCompositable(const wr::PipelineId& aPipelineId,
|
const wr::PipelineId& aPipelineId, const CompositableHandle& aHandle) {
|
||||||
const CompositableHandle& aHandle)
|
|
||||||
{
|
|
||||||
WrBridge()->AddPipelineIdForCompositable(aPipelineId, aHandle);
|
WrBridge()->AddPipelineIdForCompositable(aPipelineId, aHandle);
|
||||||
}
|
}
|
||||||
void
|
void RenderRootStateManager::RemovePipelineIdForCompositable(
|
||||||
RenderRootStateManager::RemovePipelineIdForCompositable(const wr::PipelineId& aPipelineId)
|
const wr::PipelineId& aPipelineId) {
|
||||||
{
|
|
||||||
WrBridge()->RemovePipelineIdForCompositable(aPipelineId);
|
WrBridge()->RemovePipelineIdForCompositable(aPipelineId);
|
||||||
}
|
}
|
||||||
/// Release TextureClient that is bounded to ImageKey.
|
/// Release TextureClient that is bounded to ImageKey.
|
||||||
/// It is used for recycling TextureClient.
|
/// It is used for recycling TextureClient.
|
||||||
void
|
void RenderRootStateManager::ReleaseTextureOfImage(const wr::ImageKey& aKey) {
|
||||||
RenderRootStateManager::ReleaseTextureOfImage(const wr::ImageKey& aKey)
|
|
||||||
{
|
|
||||||
WrBridge()->ReleaseTextureOfImage(aKey);
|
WrBridge()->ReleaseTextureOfImage(aKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
wr::FontInstanceKey
|
wr::FontInstanceKey RenderRootStateManager::GetFontKeyForScaledFont(
|
||||||
RenderRootStateManager::GetFontKeyForScaledFont(gfx::ScaledFont* aScaledFont,
|
gfx::ScaledFont* aScaledFont, wr::IpcResourceUpdateQueue* aResources) {
|
||||||
wr::IpcResourceUpdateQueue* aResources)
|
|
||||||
{
|
|
||||||
return WrBridge()->GetFontKeyForScaledFont(aScaledFont, aResources);
|
return WrBridge()->GetFontKeyForScaledFont(aScaledFont, aResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
wr::FontKey
|
wr::FontKey RenderRootStateManager::GetFontKeyForUnscaledFont(
|
||||||
RenderRootStateManager::GetFontKeyForUnscaledFont(gfx::UnscaledFont* aUnscaledFont,
|
gfx::UnscaledFont* aUnscaledFont, wr::IpcResourceUpdateQueue* aResources) {
|
||||||
wr::IpcResourceUpdateQueue* aResources)
|
|
||||||
{
|
|
||||||
return WrBridge()->GetFontKeyForUnscaledFont(aUnscaledFont, aResources);
|
return WrBridge()->GetFontKeyForUnscaledFont(aUnscaledFont, aResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
|
@ -16,11 +16,11 @@ namespace mozilla {
|
||||||
|
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
class RenderRootStateManager
|
class RenderRootStateManager {
|
||||||
{
|
typedef nsTHashtable<nsRefPtrHashKey<WebRenderUserData>>
|
||||||
typedef nsTHashtable<nsRefPtrHashKey<WebRenderUserData>> WebRenderUserDataRefTable;
|
WebRenderUserDataRefTable;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void AddRef();
|
void AddRef();
|
||||||
void Release();
|
void Release();
|
||||||
|
|
||||||
|
@ -32,10 +32,7 @@ public:
|
||||||
WebRenderBridgeChild* WrBridge() const;
|
WebRenderBridgeChild* WrBridge() const;
|
||||||
WebRenderCommandBuilder& CommandBuilder();
|
WebRenderCommandBuilder& CommandBuilder();
|
||||||
WebRenderUserDataRefTable* GetWebRenderUserDataTable();
|
WebRenderUserDataRefTable* GetWebRenderUserDataTable();
|
||||||
WebRenderLayerManager* LayerManager()
|
WebRenderLayerManager* LayerManager() { return mLayerManager; }
|
||||||
{
|
|
||||||
return mLayerManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddImageKeyForDiscard(wr::ImageKey key);
|
void AddImageKeyForDiscard(wr::ImageKey key);
|
||||||
void AddBlobImageKeyForDiscard(wr::BlobImageKey key);
|
void AddBlobImageKeyForDiscard(wr::BlobImageKey key);
|
||||||
|
@ -51,7 +48,8 @@ public:
|
||||||
void AddCompositorAnimationsIdForDiscard(uint64_t aId);
|
void AddCompositorAnimationsIdForDiscard(uint64_t aId);
|
||||||
void DiscardCompositorAnimations();
|
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 DeregisterAsyncAnimation(const wr::ImageKey& aKey);
|
||||||
void ClearAsyncAnimations();
|
void ClearAsyncAnimations();
|
||||||
void WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair>& aPairs);
|
void WrReleasedImages(const nsTArray<wr::ExternalImageKeyPair>& aPairs);
|
||||||
|
@ -66,19 +64,23 @@ public:
|
||||||
/// Release TextureClient that is bounded to ImageKey.
|
/// Release TextureClient that is bounded to ImageKey.
|
||||||
/// It is used for recycling TextureClient.
|
/// It is used for recycling TextureClient.
|
||||||
void ReleaseTextureOfImage(const wr::ImageKey& aKey);
|
void ReleaseTextureOfImage(const wr::ImageKey& aKey);
|
||||||
wr::FontInstanceKey GetFontKeyForScaledFont(gfx::ScaledFont* aScaledFont,
|
wr::FontInstanceKey GetFontKeyForScaledFont(
|
||||||
wr::IpcResourceUpdateQueue* aResources = nullptr);
|
gfx::ScaledFont* aScaledFont,
|
||||||
wr::FontKey GetFontKeyForUnscaledFont(gfx::UnscaledFont* aUnscaledFont,
|
wr::IpcResourceUpdateQueue* aResources = nullptr);
|
||||||
wr::IpcResourceUpdateQueue* aResources = nullptr);
|
wr::FontKey GetFontKeyForUnscaledFont(
|
||||||
|
gfx::UnscaledFont* aUnscaledFont,
|
||||||
|
wr::IpcResourceUpdateQueue* aResources = nullptr);
|
||||||
|
|
||||||
void FlushAsyncResourceUpdates();
|
void FlushAsyncResourceUpdates();
|
||||||
private:
|
|
||||||
|
private:
|
||||||
~RenderRootStateManager();
|
~RenderRootStateManager();
|
||||||
WebRenderLayerManager* mLayerManager;
|
WebRenderLayerManager* mLayerManager;
|
||||||
Maybe<wr::IpcResourceUpdateQueue> mAsyncResourceUpdates;
|
Maybe<wr::IpcResourceUpdateQueue> mAsyncResourceUpdates;
|
||||||
nsTArray<wr::ImageKey> mImageKeysToDelete;
|
nsTArray<wr::ImageKey> mImageKeysToDelete;
|
||||||
nsTArray<wr::BlobImageKey> mBlobImageKeysToDelete;
|
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
|
// Set of compositor animation ids for which there are active animations (as
|
||||||
// of the last transaction) on the compositor side.
|
// of the last transaction) on the compositor side.
|
||||||
|
@ -92,7 +94,7 @@ private:
|
||||||
friend class WebRenderLayerManager;
|
friend class WebRenderLayerManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif /* GFX_RENDERROOTSTATEMANAGER_H */
|
#endif /* GFX_RENDERROOTSTATEMANAGER_H */
|
||||||
|
|
|
@ -1067,8 +1067,9 @@ static bool IsItemProbablyActive(nsDisplayItem* aItem,
|
||||||
bool is2D = t.Is2D(&t2d);
|
bool is2D = t.Is2D(&t2d);
|
||||||
GP("active: %d\n", transformItem->MayBeAnimated(aDisplayListBuilder));
|
GP("active: %d\n", transformItem->MayBeAnimated(aDisplayListBuilder));
|
||||||
return transformItem->MayBeAnimated(aDisplayListBuilder, false) ||
|
return transformItem->MayBeAnimated(aDisplayListBuilder, false) ||
|
||||||
!is2D || HasActiveChildren(*transformItem->GetChildren(),
|
!is2D ||
|
||||||
aDisplayListBuilder);
|
HasActiveChildren(*transformItem->GetChildren(),
|
||||||
|
aDisplayListBuilder);
|
||||||
}
|
}
|
||||||
case DisplayItemType::TYPE_OPACITY: {
|
case DisplayItemType::TYPE_OPACITY: {
|
||||||
nsDisplayOpacity* opacityItem = static_cast<nsDisplayOpacity*>(aItem);
|
nsDisplayOpacity* opacityItem = static_cast<nsDisplayOpacity*>(aItem);
|
||||||
|
@ -2303,8 +2304,7 @@ Maybe<wr::WrImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
|
||||||
|
|
||||||
recorder->FlushItem(IntRect(0, 0, size.width, size.height));
|
recorder->FlushItem(IntRect(0, 0, size.width, size.height));
|
||||||
TakeExternalSurfaces(recorder, maskData->mExternalSurfaces,
|
TakeExternalSurfaces(recorder, maskData->mExternalSurfaces,
|
||||||
mManager->GetRenderRootStateManager(),
|
mManager->GetRenderRootStateManager(), aResources);
|
||||||
aResources);
|
|
||||||
recorder->Finish();
|
recorder->Finish();
|
||||||
|
|
||||||
Range<uint8_t> bytes((uint8_t*)recorder->mOutputStream.mData,
|
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
|
// The return value is interpreted as a horizontal advance in 16.16 fixed
|
||||||
// point format.
|
// point format.
|
||||||
virtual int32_t GetGlyphWidth(uint16_t aGID) {
|
virtual int32_t GetGlyphWidth(uint16_t aGID) { return -1; }
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsSpaceGlyphInvisible(DrawTarget* aRefDrawTarget,
|
bool IsSpaceGlyphInvisible(DrawTarget* aRefDrawTarget,
|
||||||
const gfxTextRun* aTextRun);
|
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);
|
uint32_t profileSpace = qcms_profile_get_color_space(mInProfile);
|
||||||
if (profileSpace == icSigGrayData) {
|
if (profileSpace == icSigGrayData) {
|
||||||
// WebP doesn't produce grayscale data, this must be corrupt.
|
// WebP doesn't produce grayscale data, this must be corrupt.
|
||||||
MOZ_LOG(
|
MOZ_LOG(sWebPLog, LogLevel::Error,
|
||||||
sWebPLog, LogLevel::Error,
|
("[this=%p] nsWebPDecoder::ApplyColorProfile -- ignoring grayscale "
|
||||||
("[this=%p] nsWebPDecoder::ApplyColorProfile -- ignoring grayscale color profile\n",
|
"color profile\n",
|
||||||
this));
|
this));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,13 @@ namespace base {
|
||||||
// thread-safe access, since it will only be modified in testing.
|
// thread-safe access, since it will only be modified in testing.
|
||||||
static AtExitManager* g_top_manager = NULL;
|
static AtExitManager* g_top_manager = NULL;
|
||||||
|
|
||||||
AtExitManager::AtExitManager() : lock_("AtExitManager"),
|
AtExitManager::AtExitManager() : lock_("AtExitManager"), next_manager_(NULL) {
|
||||||
next_manager_(NULL) {
|
|
||||||
DCHECK(!g_top_manager);
|
DCHECK(!g_top_manager);
|
||||||
g_top_manager = this;
|
g_top_manager = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
AtExitManager::AtExitManager(bool shadow) : lock_("AtExitManager"),
|
AtExitManager::AtExitManager(bool shadow)
|
||||||
next_manager_(g_top_manager)
|
: lock_("AtExitManager"), next_manager_(g_top_manager) {
|
||||||
{
|
|
||||||
DCHECK(shadow || !g_top_manager);
|
DCHECK(shadow || !g_top_manager);
|
||||||
g_top_manager = this;
|
g_top_manager = this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,15 +243,13 @@ class NowSingleton {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit NowSingleton(mozilla::StaticMutex& aMutex)
|
explicit NowSingleton(mozilla::StaticMutex& aMutex)
|
||||||
: lock_(aMutex)
|
: lock_(aMutex),
|
||||||
, rollover_(TimeDelta::FromMilliseconds(0))
|
rollover_(TimeDelta::FromMilliseconds(0)),
|
||||||
, last_seen_(0)
|
last_seen_(0) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
~NowSingleton() = default;
|
~NowSingleton() = default;
|
||||||
|
|
||||||
mozilla::StaticMutex& lock_; // To protected last_seen_ and rollover_.
|
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.
|
DWORD last_seen_; // The last timeGetTime value we saw, to detect rollover.
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NowSingleton);
|
DISALLOW_COPY_AND_ASSIGN(NowSingleton);
|
||||||
|
|
|
@ -150,9 +150,7 @@ class PipeMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit PipeMap(mozilla::StaticMutex& aMutex)
|
explicit PipeMap(mozilla::StaticMutex& aMutex) : lock_(aMutex) {}
|
||||||
: lock_(aMutex)
|
|
||||||
{}
|
|
||||||
~PipeMap() = default;
|
~PipeMap() = default;
|
||||||
|
|
||||||
mozilla::StaticMutex& lock_;
|
mozilla::StaticMutex& lock_;
|
||||||
|
|
|
@ -20,15 +20,20 @@
|
||||||
// in the code below. Making them equal also ensures that if new process
|
// 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
|
// types are added, people will know they may need to add crash reporting
|
||||||
// support in various places because compilation errors will be triggered here.
|
// 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!");
|
"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!");
|
"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!");
|
"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!");
|
"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!");
|
"GeckoProcessType enum is out of sync with nsICrashService!");
|
||||||
static_assert(nsICrashService::PROCESS_TYPE_GPU == (int)GeckoProcessType_GPU,
|
static_assert(nsICrashService::PROCESS_TYPE_GPU == (int)GeckoProcessType_GPU,
|
||||||
"GeckoProcessType enum is out of sync with nsICrashService!");
|
"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!");
|
"GeckoProcessType enum is out of sync with nsICrashService!");
|
||||||
static_assert(nsICrashService::PROCESS_TYPE_RDD == (int)GeckoProcessType_RDD,
|
static_assert(nsICrashService::PROCESS_TYPE_RDD == (int)GeckoProcessType_RDD,
|
||||||
"GeckoProcessType enum is out of sync with nsICrashService!");
|
"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!");
|
"GeckoProcessType enum is out of sync with nsICrashService!");
|
||||||
// Add new static asserts here if you add more process types.
|
// Add new static asserts here if you add more process types.
|
||||||
// Update this static assert as well.
|
// 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!");
|
"GeckoProcessType enum is out of sync with nsICrashService!");
|
||||||
|
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
|
@ -116,14 +122,14 @@ bool CrashReporterHost::FinalizeCrashReport() {
|
||||||
// unit tests), but that's OK.
|
// unit tests), but that's OK.
|
||||||
switch (mProcessType) {
|
switch (mProcessType) {
|
||||||
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
|
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
|
||||||
case GeckoProcessType_##enum_name: \
|
case GeckoProcessType_##enum_name: \
|
||||||
type.AssignLiteral(string_name); \
|
type.AssignLiteral(string_name); \
|
||||||
break;
|
break;
|
||||||
#include "mozilla/GeckoProcessTypes.h"
|
#include "mozilla/GeckoProcessTypes.h"
|
||||||
#undef GECKO_PROCESS_TYPE
|
#undef GECKO_PROCESS_TYPE
|
||||||
default:
|
default:
|
||||||
NS_ERROR("unknown process type");
|
NS_ERROR("unknown process type");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
annotations[CrashReporter::Annotation::ProcessType] = type;
|
annotations[CrashReporter::Annotation::ProcessType] = type;
|
||||||
|
@ -188,13 +194,13 @@ bool CrashReporterHost::FinalizeCrashReport() {
|
||||||
} else {
|
} else {
|
||||||
switch (aProcessType) {
|
switch (aProcessType) {
|
||||||
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
|
#define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name) \
|
||||||
case GeckoProcessType_##enum_name: \
|
case GeckoProcessType_##enum_name: \
|
||||||
telemetryKey.AssignLiteral(string_name); \
|
telemetryKey.AssignLiteral(string_name); \
|
||||||
break;
|
break;
|
||||||
#include "mozilla/GeckoProcessTypes.h"
|
#include "mozilla/GeckoProcessTypes.h"
|
||||||
#undef GECKO_PROCESS_TYPE
|
#undef GECKO_PROCESS_TYPE
|
||||||
// We can't really hit this, thanks to the above switch, but having it here
|
// We can't really hit this, thanks to the above switch, but having it
|
||||||
// will placate the compiler.
|
// here will placate the compiler.
|
||||||
default:
|
default:
|
||||||
NS_ERROR("unknown process type");
|
NS_ERROR("unknown process type");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -381,7 +381,8 @@ bool IndirectBindingMap::lookup(jsid name, ModuleEnvironmentObject** envOut,
|
||||||
}
|
}
|
||||||
|
|
||||||
SetProxyReservedSlot(object, ExportsSlot, ObjectValue(*exports));
|
SetProxyReservedSlot(object, ExportsSlot, ObjectValue(*exports));
|
||||||
SetProxyReservedSlot(object, BindingsSlot, PrivateValue(rootedBindings.release()));
|
SetProxyReservedSlot(object, BindingsSlot,
|
||||||
|
PrivateValue(rootedBindings.release()));
|
||||||
|
|
||||||
return &object->as<ModuleNamespaceObject>();
|
return &object->as<ModuleNamespaceObject>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -985,8 +985,8 @@ class NameResolver {
|
||||||
MOZ_ASSERT(parents[initialParents] == cur,
|
MOZ_ASSERT(parents[initialParents] == cur,
|
||||||
"pushed child shouldn't change underneath us");
|
"pushed child shouldn't change underneath us");
|
||||||
|
|
||||||
AlwaysPoison(&parents[initialParents], 0xFF, sizeof(parents[initialParents]),
|
AlwaysPoison(&parents[initialParents], 0xFF,
|
||||||
MemCheckKind::MakeUndefined);
|
sizeof(parents[initialParents]), MemCheckKind::MakeUndefined);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -592,7 +592,7 @@ inline size_t Arena::finalize(FreeOp* fop, AllocKind thingKind,
|
||||||
} else {
|
} else {
|
||||||
t->finalize(fop);
|
t->finalize(fop);
|
||||||
AlwaysPoison(t, JS_SWEPT_TENURED_PATTERN, thingSize,
|
AlwaysPoison(t, JS_SWEPT_TENURED_PATTERN, thingSize,
|
||||||
MemCheckKind::MakeUndefined);
|
MemCheckKind::MakeUndefined);
|
||||||
gcTracer.traceTenuredFinalize(t);
|
gcTracer.traceTenuredFinalize(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3587,8 +3587,8 @@ void GCRuntime::sweepFromBackgroundThread(AutoLockHelperThreadState& lock) {
|
||||||
AutoUnlockHelperThreadState unlock(lock);
|
AutoUnlockHelperThreadState unlock(lock);
|
||||||
sweepBackgroundThings(zones, freeLifoAlloc);
|
sweepBackgroundThings(zones, freeLifoAlloc);
|
||||||
|
|
||||||
// The main thread may call queueZonesAndStartBackgroundSweep() while this is
|
// The main thread may call queueZonesAndStartBackgroundSweep() while this
|
||||||
// running so we must check there is no more work after releasing the
|
// is running so we must check there is no more work after releasing the
|
||||||
// lock.
|
// lock.
|
||||||
} while (!backgroundSweepZones.ref().isEmpty());
|
} while (!backgroundSweepZones.ref().isEmpty());
|
||||||
}
|
}
|
||||||
|
@ -3642,8 +3642,7 @@ void GCRuntime::startBackgroundFree() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BackgroundFreeTask::run() {
|
void BackgroundFreeTask::run() {
|
||||||
AutoTraceLog logFreeing(TraceLoggerForCurrentThread(),
|
AutoTraceLog logFreeing(TraceLoggerForCurrentThread(), TraceLogger_GCFree);
|
||||||
TraceLogger_GCFree);
|
|
||||||
|
|
||||||
AutoLockHelperThreadState lock;
|
AutoLockHelperThreadState lock;
|
||||||
|
|
||||||
|
@ -3666,16 +3665,15 @@ void GCRuntime::freeFromBackgroundThread(AutoLockHelperThreadState& lock) {
|
||||||
|
|
||||||
lifoBlocks.freeAll();
|
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());
|
rt->defaultFreeOp()->free_(r.front());
|
||||||
}
|
}
|
||||||
} while (!lifoBlocksToFree.ref().isEmpty() ||
|
} while (!lifoBlocksToFree.ref().isEmpty() ||
|
||||||
!buffersToFreeAfterMinorGC.ref().empty());
|
!buffersToFreeAfterMinorGC.ref().empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCRuntime::waitBackgroundFreeEnd() {
|
void GCRuntime::waitBackgroundFreeEnd() { freeTask.join(); }
|
||||||
freeTask.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
struct IsAboutToBeFinalizedFunctor {
|
struct IsAboutToBeFinalizedFunctor {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -6935,8 +6933,8 @@ static bool ShouldCleanUpEverything(JS::gcreason::Reason reason,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ShouldSweepOnBackgroundThread(JS::gcreason::Reason reason) {
|
static bool ShouldSweepOnBackgroundThread(JS::gcreason::Reason reason) {
|
||||||
return reason != JS::gcreason::DESTROY_RUNTIME &&
|
return reason != JS::gcreason::DESTROY_RUNTIME && !gcTracer.traceEnabled() &&
|
||||||
!gcTracer.traceEnabled() && CanUseExtraThreads();
|
CanUseExtraThreads();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GCRuntime::incrementalSlice(SliceBudget& budget,
|
void GCRuntime::incrementalSlice(SliceBudget& budget,
|
||||||
|
|
|
@ -166,8 +166,9 @@ class FreeSpan {
|
||||||
return nullptr; // The span is empty.
|
return nullptr; // The span is empty.
|
||||||
}
|
}
|
||||||
checkSpan(arena);
|
checkSpan(arena);
|
||||||
DebugOnlyPoison(reinterpret_cast<void*>(thing), JS_ALLOCATED_TENURED_PATTERN,
|
DebugOnlyPoison(reinterpret_cast<void*>(thing),
|
||||||
thingSize, MemCheckKind::MakeUndefined);
|
JS_ALLOCATED_TENURED_PATTERN, thingSize,
|
||||||
|
MemCheckKind::MakeUndefined);
|
||||||
return reinterpret_cast<TenuredCell*>(thing);
|
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_FLAG_BITS = 3;
|
||||||
static const size_t DELAYED_MARKING_ARENA_BITS =
|
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 onDelayedMarkingList_ : 1;
|
||||||
size_t hasDelayedBlackMarking_ : 1;
|
size_t hasDelayedBlackMarking_ : 1;
|
||||||
size_t hasDelayedGrayMarking_ : 1;
|
size_t hasDelayedGrayMarking_ : 1;
|
||||||
|
|
|
@ -974,7 +974,7 @@ static bool TraceKindParticipatesInCC(JS::TraceKind kind) {
|
||||||
return DispatchTraceKindTyped(ParticipatesInCCFunctor(), kind);
|
return DispatchTraceKindTyped(ParticipatesInCCFunctor(), kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool js::GCMarker::mark(T* thing) {
|
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_ASSERT(extent <= ChunkSize);
|
||||||
MOZ_MAKE_MEM_UNDEFINED(this, extent);
|
MOZ_MAKE_MEM_UNDEFINED(this, extent);
|
||||||
|
|
||||||
Poison(this, JS_FRESH_NURSERY_PATTERN, extent,
|
Poison(this, JS_FRESH_NURSERY_PATTERN, extent, MemCheckKind::MakeUndefined);
|
||||||
MemCheckKind::MakeUndefined);
|
|
||||||
|
|
||||||
new (&trailer) gc::ChunkTrailer(rt, &rt->gc.storeBuffer());
|
new (&trailer) gc::ChunkTrailer(rt, &rt->gc.storeBuffer());
|
||||||
}
|
}
|
||||||
|
@ -182,9 +181,7 @@ bool js::Nursery::init(uint32_t maxNurseryBytes, AutoLockGCBgAlloc& lock) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
js::Nursery::~Nursery() {
|
js::Nursery::~Nursery() { disable(); }
|
||||||
disable();
|
|
||||||
}
|
|
||||||
|
|
||||||
void js::Nursery::enable() {
|
void js::Nursery::enable() {
|
||||||
MOZ_ASSERT(isEmpty());
|
MOZ_ASSERT(isEmpty());
|
||||||
|
|
|
@ -312,8 +312,7 @@ class Nursery {
|
||||||
}
|
}
|
||||||
size_t sizeOfMallocedBuffers(mozilla::MallocSizeOf mallocSizeOf) const {
|
size_t sizeOfMallocedBuffers(mozilla::MallocSizeOf mallocSizeOf) const {
|
||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
for (BufferSet::Range r = mallocedBuffers.all(); !r.empty();
|
for (BufferSet::Range r = mallocedBuffers.all(); !r.empty(); r.popFront()) {
|
||||||
r.popFront()) {
|
|
||||||
total += mallocSizeOf(r.front());
|
total += mallocSizeOf(r.front());
|
||||||
}
|
}
|
||||||
total += mallocedBuffers.shallowSizeOfExcludingThis(mallocSizeOf);
|
total += mallocedBuffers.shallowSizeOfExcludingThis(mallocSizeOf);
|
||||||
|
|
|
@ -181,8 +181,9 @@ Phase Statistics::lookupChildPhase(PhaseKind phaseKind) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phase == Phase::NONE) {
|
if (phase == Phase::NONE) {
|
||||||
MOZ_CRASH_UNSAFE_PRINTF("Child phase kind %u not found under current phase kind %u",
|
MOZ_CRASH_UNSAFE_PRINTF(
|
||||||
unsigned(phaseKind), unsigned(currentPhaseKind()));
|
"Child phase kind %u not found under current phase kind %u",
|
||||||
|
unsigned(phaseKind), unsigned(currentPhaseKind()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return phase;
|
return phase;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// |jit-test| --more-compartments
|
||||||
const dbg = new Debugger();
|
const dbg = new Debugger();
|
||||||
const g = evalcx("lazy");
|
const g = evalcx("lazy");
|
||||||
dbg.addDebuggee(g);
|
dbg.addDebuggee(g);
|
||||||
|
|
|
@ -78,3 +78,10 @@ function testTypedArrayLazyBuffer(global) {
|
||||||
}
|
}
|
||||||
testTypedArrayLazyBuffer(newGlobal());
|
testTypedArrayLazyBuffer(newGlobal());
|
||||||
testTypedArrayLazyBuffer(newGlobal({sameCompartmentAs: this}));
|
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();
|
frame.pushThis();
|
||||||
|
|
||||||
// In strict mode code or self-hosted functions, |this| is left alone.
|
// In strict mode code, |this| is left alone.
|
||||||
if (script->strict() || (function() && function()->isSelfHostedBuiltin())) {
|
if (script->strict()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5413,9 +5413,9 @@ void CodeGenerator::visitDefVar(LDefVar* lir) {
|
||||||
JSScript* script = current->mir()->info().script();
|
JSScript* script = current->mir()->info().script();
|
||||||
jsbytecode* pc = lir->mir()->resumePoint()->pc();
|
jsbytecode* pc = lir->mir()->resumePoint()->pc();
|
||||||
|
|
||||||
pushArg(ImmPtr(pc)); // jsbytecode*
|
pushArg(ImmPtr(pc)); // jsbytecode*
|
||||||
pushArg(ImmGCPtr(script)); // JSScript*
|
pushArg(ImmGCPtr(script)); // JSScript*
|
||||||
pushArg(envChain); // JSObject*
|
pushArg(envChain); // JSObject*
|
||||||
|
|
||||||
callVM(DefVarInfo, lir);
|
callVM(DefVarInfo, lir);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12852,8 +12852,8 @@ AbortReasonOr<Ok> IonBuilder::jsop_functionthis() {
|
||||||
MOZ_ASSERT(info().funMaybeLazy());
|
MOZ_ASSERT(info().funMaybeLazy());
|
||||||
MOZ_ASSERT(!info().funMaybeLazy()->isArrow());
|
MOZ_ASSERT(!info().funMaybeLazy()->isArrow());
|
||||||
|
|
||||||
if (script()->strict() || info().funMaybeLazy()->isSelfHostedBuiltin()) {
|
if (script()->strict()) {
|
||||||
// No need to wrap primitive |this| in strict mode or self-hosted code.
|
// No need to wrap primitive |this| in strict mode.
|
||||||
current->pushSlot(info().thisSlot());
|
current->pushSlot(info().thisSlot());
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,7 @@ class IonTryNoteFilter {
|
||||||
class TryNoteIterIon : public TryNoteIter<IonTryNoteFilter> {
|
class TryNoteIterIon : public TryNoteIter<IonTryNoteFilter> {
|
||||||
public:
|
public:
|
||||||
TryNoteIterIon(JSContext* cx, const InlineFrameIterator& frame)
|
TryNoteIterIon(JSContext* cx, const InlineFrameIterator& frame)
|
||||||
: TryNoteIter(cx, frame.script(), frame.pc(),
|
: TryNoteIter(cx, frame.script(), frame.pc(), IonTryNoteFilter(frame)) {}
|
||||||
IonTryNoteFilter(frame)) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void HandleExceptionIon(JSContext* cx, const InlineFrameIterator& frame,
|
static void HandleExceptionIon(JSContext* cx, const InlineFrameIterator& frame,
|
||||||
|
@ -323,8 +322,7 @@ class BaselineTryNoteFilter {
|
||||||
class TryNoteIterBaseline : public TryNoteIter<BaselineTryNoteFilter> {
|
class TryNoteIterBaseline : public TryNoteIter<BaselineTryNoteFilter> {
|
||||||
public:
|
public:
|
||||||
TryNoteIterBaseline(JSContext* cx, BaselineFrame* frame, jsbytecode* pc)
|
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
|
// Close all live iterators on a BaselineFrame due to exception unwinding. The
|
||||||
|
|
|
@ -43,7 +43,7 @@ static constexpr FloatRegister ScratchDoubleReg = {FloatRegisters::d31,
|
||||||
FloatRegisters::Double};
|
FloatRegisters::Double};
|
||||||
struct ScratchDoubleScope : public AutoFloatRegisterScope {
|
struct ScratchDoubleScope : public AutoFloatRegisterScope {
|
||||||
explicit ScratchDoubleScope(MacroAssembler& masm)
|
explicit ScratchDoubleScope(MacroAssembler& masm)
|
||||||
: AutoFloatRegisterScope(masm, ScratchDoubleReg) {}
|
: AutoFloatRegisterScope(masm, ScratchDoubleReg) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr FloatRegister ReturnFloat32Reg = {FloatRegisters::s0,
|
static constexpr FloatRegister ReturnFloat32Reg = {FloatRegisters::s0,
|
||||||
|
@ -52,7 +52,7 @@ static constexpr FloatRegister ScratchFloat32Reg = {FloatRegisters::s31,
|
||||||
FloatRegisters::Single};
|
FloatRegisters::Single};
|
||||||
struct ScratchFloat32Scope : public AutoFloatRegisterScope {
|
struct ScratchFloat32Scope : public AutoFloatRegisterScope {
|
||||||
explicit ScratchFloat32Scope(MacroAssembler& masm)
|
explicit ScratchFloat32Scope(MacroAssembler& masm)
|
||||||
: AutoFloatRegisterScope(masm, ScratchFloat32Reg) {}
|
: AutoFloatRegisterScope(masm, ScratchFloat32Reg) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static constexpr Register InvalidReg{Registers::invalid_reg};
|
static constexpr Register InvalidReg{Registers::invalid_reg};
|
||||||
|
|
|
@ -493,10 +493,10 @@ void MacroAssembler::storeRegsInMask(LiveRegisterSet set, Address dest,
|
||||||
} else {
|
} else {
|
||||||
MOZ_CRASH("Unknown register type.");
|
MOZ_CRASH("Unknown register type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(numFpu == 0);
|
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);
|
diffF -= diffF % sizeof(uintptr_t);
|
||||||
MOZ_ASSERT(diffF == 0);
|
MOZ_ASSERT(diffF == 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3557,8 +3557,8 @@ CompileOptions& CompileOptions::setIntroductionInfoToCaller(
|
||||||
DescribeScriptedCallerForCompilation(cx, &maybeScript, &filename, &lineno,
|
DescribeScriptedCallerForCompilation(cx, &maybeScript, &filename, &lineno,
|
||||||
&pcOffset, &mutedErrors);
|
&pcOffset, &mutedErrors);
|
||||||
if (filename) {
|
if (filename) {
|
||||||
return setIntroductionInfo(filename, introductionType, lineno,
|
return setIntroductionInfo(filename, introductionType, lineno, maybeScript,
|
||||||
maybeScript, pcOffset);
|
pcOffset);
|
||||||
} else {
|
} else {
|
||||||
return setIntroductionType(introductionType);
|
return setIntroductionType(introductionType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1328,9 +1328,11 @@ JS_FRIEND_API void js::SetWindowProxy(JSContext* cx, HandleObject global,
|
||||||
CHECK_THREAD(cx);
|
CHECK_THREAD(cx);
|
||||||
|
|
||||||
cx->check(global, windowProxy);
|
cx->check(global, windowProxy);
|
||||||
|
|
||||||
MOZ_ASSERT(IsWindowProxy(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) {
|
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) {
|
static JSObject* NewSandbox(JSContext* cx, bool lazy) {
|
||||||
JS::RealmOptions options;
|
JS::RealmOptions options;
|
||||||
SetStandardRealmOptions(options);
|
SetStandardRealmOptions(options);
|
||||||
|
|
||||||
|
if (defaultToSameCompartment) {
|
||||||
|
options.creationOptions().setExistingCompartment(cx->global());
|
||||||
|
} else {
|
||||||
|
options.creationOptions().setNewCompartmentAndZone();
|
||||||
|
}
|
||||||
|
|
||||||
RootedObject obj(cx,
|
RootedObject obj(cx,
|
||||||
JS_NewGlobalObject(cx, &sandbox_class, nullptr,
|
JS_NewGlobalObject(cx, &sandbox_class, nullptr,
|
||||||
JS::DontFireOnNewGlobalHook, options));
|
JS::DontFireOnNewGlobalHook, options));
|
||||||
|
@ -3848,17 +3855,13 @@ static bool EvalInContext(JSContext* cx, unsigned argc, Value* vp) {
|
||||||
|
|
||||||
DescribeScriptedCaller(cx, &filename, &lineno);
|
DescribeScriptedCaller(cx, &filename, &lineno);
|
||||||
{
|
{
|
||||||
Maybe<JSAutoRealm> ar;
|
sobj = UncheckedUnwrap(sobj, true);
|
||||||
unsigned flags;
|
|
||||||
JSObject* unwrapped = UncheckedUnwrap(sobj, true, &flags);
|
JSAutoRealm ar(cx, sobj);
|
||||||
if (flags & Wrapper::CROSS_COMPARTMENT) {
|
|
||||||
sobj = unwrapped;
|
|
||||||
ar.emplace(cx, sobj);
|
|
||||||
}
|
|
||||||
|
|
||||||
sobj = ToWindowIfWindowProxy(sobj);
|
sobj = ToWindowIfWindowProxy(sobj);
|
||||||
|
|
||||||
if (!(sobj->getClass()->flags & JSCLASS_IS_GLOBAL)) {
|
if (!JS_IsGlobalObject(sobj)) {
|
||||||
JS_ReportErrorASCII(cx, "Invalid scope argument to evalcx");
|
JS_ReportErrorASCII(cx, "Invalid scope argument to evalcx");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4213,9 +4213,9 @@ static T* findDebuggerInVector(Debugger* dbg,
|
||||||
|
|
||||||
// a ReadBarriered version for findDebuggerInVector
|
// a ReadBarriered version for findDebuggerInVector
|
||||||
// TODO: Bug 1515934 - findDebuggerInVector<T> triggers read barriers.
|
// TODO: Bug 1515934 - findDebuggerInVector<T> triggers read barriers.
|
||||||
static ReadBarriered<Debugger*>*
|
static ReadBarriered<Debugger*>* findDebuggerInVector(
|
||||||
findDebuggerInVector(Debugger* dbg,
|
Debugger* dbg,
|
||||||
Vector<ReadBarriered<Debugger*>, 0, js::SystemAllocPolicy>* vec) {
|
Vector<ReadBarriered<Debugger*>, 0, js::SystemAllocPolicy>* vec) {
|
||||||
ReadBarriered<Debugger*>* p;
|
ReadBarriered<Debugger*>* p;
|
||||||
for (p = vec->begin(); p != vec->end(); p++) {
|
for (p = vec->begin(); p != vec->end(); p++) {
|
||||||
if (p->unbarrieredGet() == dbg) {
|
if (p->unbarrieredGet() == dbg) {
|
||||||
|
|
|
@ -1133,17 +1133,20 @@ bool LexicalEnvironmentObject::isExtensible() const {
|
||||||
Value LexicalEnvironmentObject::thisValue() const {
|
Value LexicalEnvironmentObject::thisValue() const {
|
||||||
MOZ_ASSERT(isExtensible());
|
MOZ_ASSERT(isExtensible());
|
||||||
Value v = getReservedSlot(THIS_VALUE_OR_SCOPE_SLOT);
|
Value v = getReservedSlot(THIS_VALUE_OR_SCOPE_SLOT);
|
||||||
if (v.isObject()) {
|
|
||||||
// A WindowProxy may have been attached after this environment was
|
// Windows must never be exposed to script. setWindowProxyThisValue should
|
||||||
// created so check ToWindowProxyIfWindow again. For example,
|
// have set this to the WindowProxy.
|
||||||
// GlobalObject::createInternal will construct its lexical environment
|
MOZ_ASSERT_IF(v.isObject(), !IsWindow(&v.toObject()));
|
||||||
// before SetWindowProxy can be called.
|
|
||||||
// See also: js::GetThisValue / js::GetThisValueOfLexical
|
|
||||||
return ObjectValue(*ToWindowProxyIfWindow(&v.toObject()));
|
|
||||||
}
|
|
||||||
return v;
|
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_ = {
|
const Class LexicalEnvironmentObject::class_ = {
|
||||||
"LexicalEnvironment",
|
"LexicalEnvironment",
|
||||||
JSCLASS_HAS_RESERVED_SLOTS(LexicalEnvironmentObject::RESERVED_SLOTS) |
|
JSCLASS_HAS_RESERVED_SLOTS(LexicalEnvironmentObject::RESERVED_SLOTS) |
|
||||||
|
|
|
@ -567,6 +567,8 @@ class LexicalEnvironmentObject : public EnvironmentObject {
|
||||||
return enclosingEnvironment().as<GlobalObject>();
|
return enclosingEnvironment().as<GlobalObject>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setWindowProxyThisValue(JSObject* obj);
|
||||||
|
|
||||||
// Global and non-syntactic lexical scopes are extensible. All other
|
// Global and non-syntactic lexical scopes are extensible. All other
|
||||||
// lexical scopes are not.
|
// lexical scopes are not.
|
||||||
bool isExtensible() const;
|
bool isExtensible() const;
|
||||||
|
|
|
@ -119,12 +119,14 @@ bool js::GetFunctionThis(JSContext* cx, AbstractFramePtr frame,
|
||||||
MOZ_ASSERT(frame.isFunctionFrame());
|
MOZ_ASSERT(frame.isFunctionFrame());
|
||||||
MOZ_ASSERT(!frame.callee()->isArrow());
|
MOZ_ASSERT(!frame.callee()->isArrow());
|
||||||
|
|
||||||
if (frame.thisArgument().isObject() || frame.callee()->strict() ||
|
if (frame.thisArgument().isObject() || frame.callee()->strict()) {
|
||||||
frame.callee()->isSelfHostedBuiltin()) {
|
|
||||||
res.set(frame.thisArgument());
|
res.set(frame.thisArgument());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MOZ_ASSERT(!frame.callee()->isSelfHostedBuiltin(),
|
||||||
|
"Self-hosted builtins must be strict");
|
||||||
|
|
||||||
RootedValue thisv(cx, frame.thisArgument());
|
RootedValue thisv(cx, frame.thisArgument());
|
||||||
|
|
||||||
// If there is a NSVO on environment chain, use it as basis for fallback
|
// If there is a NSVO on environment chain, use it as basis for fallback
|
||||||
|
@ -1105,8 +1107,7 @@ class InterpreterTryNoteFilter {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class TryNoteIterInterpreter
|
class TryNoteIterInterpreter : public TryNoteIter<InterpreterTryNoteFilter> {
|
||||||
: public TryNoteIter<InterpreterTryNoteFilter> {
|
|
||||||
public:
|
public:
|
||||||
TryNoteIterInterpreter(JSContext* cx, const InterpreterRegs& regs)
|
TryNoteIterInterpreter(JSContext* cx, const InterpreterRegs& regs)
|
||||||
: TryNoteIter(cx, regs.fp()->script(), regs.pc,
|
: TryNoteIter(cx, regs.fp()->script(), regs.pc,
|
||||||
|
|
|
@ -415,7 +415,6 @@ class MOZ_STACK_CLASS TryNoteIter {
|
||||||
uint32_t start = tn_->start;
|
uint32_t start = tn_->start;
|
||||||
uint32_t length = tn_->length;
|
uint32_t length = tn_->length;
|
||||||
return offset - start < length;
|
return offset - start < length;
|
||||||
|
|
||||||
}
|
}
|
||||||
bool done() const { return tn_ == tnEnd_; }
|
bool done() const { return tn_ == tnEnd_; }
|
||||||
const JSTryNote* operator*() const { return tn_; }
|
const JSTryNote* operator*() const { return tn_; }
|
||||||
|
|
|
@ -119,7 +119,7 @@ inline js::GlobalObject& JSScript::global() const {
|
||||||
return *realm()->maybeGlobal();
|
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();
|
return global == realm()->unsafeUnbarrieredMaybeGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1382,7 +1382,8 @@ ScriptSourceObject* ScriptSourceObject::createInternal(JSContext* cx,
|
||||||
obj->initReservedSlot(ELEMENT_SLOT, MagicValue(JS_GENERIC_MAGIC));
|
obj->initReservedSlot(ELEMENT_SLOT, MagicValue(JS_GENERIC_MAGIC));
|
||||||
obj->initReservedSlot(ELEMENT_PROPERTY_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_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;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1677,8 +1677,8 @@ bool SavedStacks::getLocation(JSContext* cx, const FrameIter& iter,
|
||||||
}
|
}
|
||||||
|
|
||||||
void SavedStacks::chooseSamplingProbability(Realm* realm) {
|
void SavedStacks::chooseSamplingProbability(Realm* realm) {
|
||||||
// Use unbarriered version to prevent triggering read barrier while collecting,
|
// Use unbarriered version to prevent triggering read barrier while
|
||||||
// this is safe as long as global does not escape.
|
// collecting, this is safe as long as global does not escape.
|
||||||
GlobalObject* global = realm->unsafeUnbarrieredMaybeGlobal();
|
GlobalObject* global = realm->unsafeUnbarrieredMaybeGlobal();
|
||||||
if (!global) {
|
if (!global) {
|
||||||
return;
|
return;
|
||||||
|
@ -1703,8 +1703,7 @@ void SavedStacks::chooseSamplingProbability(Realm* realm) {
|
||||||
|
|
||||||
if (dbgp->trackingAllocationSites && dbgp->enabled) {
|
if (dbgp->trackingAllocationSites && dbgp->enabled) {
|
||||||
foundAnyDebuggers = true;
|
foundAnyDebuggers = true;
|
||||||
probability =
|
probability = std::max(dbgp->allocationSamplingProbability, probability);
|
||||||
std::max(dbgp->allocationSamplingProbability, probability);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(foundAnyDebuggers);
|
MOZ_ASSERT(foundAnyDebuggers);
|
||||||
|
|
|
@ -3347,6 +3347,7 @@ bool JSRuntime::cloneSelfHostedFunctionScript(JSContext* cx,
|
||||||
|
|
||||||
MOZ_ASSERT(sourceFun->nargs() == targetFun->nargs());
|
MOZ_ASSERT(sourceFun->nargs() == targetFun->nargs());
|
||||||
MOZ_ASSERT(sourceScript->hasRest() == targetFun->nonLazyScript()->hasRest());
|
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.
|
// The target function might have been relazified after its flags changed.
|
||||||
targetFun->setFlags(targetFun->flags() | sourceFun->flags());
|
targetFun->setFlags(targetFun->flags() | sourceFun->flags());
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidatorShared {
|
||||||
using MathNameMap = HashMap<PropertyName*, MathBuiltin>;
|
using MathNameMap = HashMap<PropertyName*, MathBuiltin>;
|
||||||
using ArrayViewVector = Vector<ArrayView>;
|
using ArrayViewVector = Vector<ArrayView>;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
JSContext* cx_;
|
JSContext* cx_;
|
||||||
CodeNode* moduleFunctionNode_;
|
CodeNode* moduleFunctionNode_;
|
||||||
PropertyName* moduleFunctionName_;
|
PropertyName* moduleFunctionName_;
|
||||||
|
|
|
@ -259,8 +259,10 @@ static const double arm64IonBytecodesPerMs = 750; // Estimate
|
||||||
static const double x64DesktopTierCutoff = x64IonBytecodesPerMs * tierCutoffMs;
|
static const double x64DesktopTierCutoff = x64IonBytecodesPerMs * tierCutoffMs;
|
||||||
static const double x86DesktopTierCutoff = x86IonBytecodesPerMs * tierCutoffMs;
|
static const double x86DesktopTierCutoff = x86IonBytecodesPerMs * tierCutoffMs;
|
||||||
static const double x86MobileTierCutoff = x86DesktopTierCutoff / 2; // Guess
|
static const double x86MobileTierCutoff = x86DesktopTierCutoff / 2; // Guess
|
||||||
static const double arm32MobileTierCutoff = arm32IonBytecodesPerMs * tierCutoffMs;
|
static const double arm32MobileTierCutoff =
|
||||||
static const double arm64MobileTierCutoff = arm64IonBytecodesPerMs * tierCutoffMs;
|
arm32IonBytecodesPerMs * tierCutoffMs;
|
||||||
|
static const double arm64MobileTierCutoff =
|
||||||
|
arm64IonBytecodesPerMs * tierCutoffMs;
|
||||||
|
|
||||||
static double CodesizeCutoff(SystemClass cls) {
|
static double CodesizeCutoff(SystemClass cls) {
|
||||||
switch (cls) {
|
switch (cls) {
|
||||||
|
|
|
@ -701,12 +701,9 @@ static void LayoutModuleDtor() {
|
||||||
xpcModuleDtor();
|
xpcModuleDtor();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const mozilla::Module kLayoutModule = {mozilla::Module::kVersion,
|
static const mozilla::Module kLayoutModule = {
|
||||||
kLayoutCIDs,
|
mozilla::Module::kVersion, kLayoutCIDs, kLayoutContracts,
|
||||||
kLayoutContracts,
|
kLayoutCategories, nullptr, Initialize,
|
||||||
kLayoutCategories,
|
LayoutModuleDtor};
|
||||||
nullptr,
|
|
||||||
Initialize,
|
|
||||||
LayoutModuleDtor};
|
|
||||||
|
|
||||||
NSMODULE_DEFN(nsLayoutModule) = &kLayoutModule;
|
NSMODULE_DEFN(nsLayoutModule) = &kLayoutModule;
|
||||||
|
|
|
@ -14,29 +14,30 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(XP_WIN) && !defined(HAVE_64BIT_BUILD)) || defined(ANDROID)
|
#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
|
// Blink's magic depth limit from its HTML parser (513) plus as much as fits in
|
||||||
// default run-time stack on armv7 Android on Dalvik when using display: block minus
|
// the default run-time stack on armv7 Android on Dalvik when using display:
|
||||||
// a bit just to be sure. The Dalvik default stack crashes at 588. ART can do a few
|
// block minus a bit just to be sure. The Dalvik default stack crashes at 588.
|
||||||
// frames more. Using the same number for 32-bit Windows for consistency. Over there,
|
// ART can do a few frames more. Using the same number for 32-bit Windows for
|
||||||
// Blink's magic depth of 513 doesn't fit in the default stack of 1 MB, but this magic
|
// consistency. Over there, Blink's magic depth of 513 doesn't fit in the
|
||||||
// depth fits when the default is grown by mere 192 KB (tested in 64 KB increments).
|
// 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
|
// 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
|
// default stack size affects all threads and consumes address space. Fixing
|
||||||
// is bug 1257522.
|
// that is bug 1257522.
|
||||||
//
|
//
|
||||||
// 32-bit Android on ARM already happens to have defaults that are close enough to
|
// 32-bit Android on ARM already happens to have defaults that are close enough
|
||||||
// what makes sense as a temporary measure on Windows, so adjusting the Android
|
// to what makes sense as a temporary measure on Windows, so adjusting the
|
||||||
// stack can be a follow-up. The stack on 64-bit ARM needs adjusting in any case
|
// Android stack can be a follow-up. The stack on 64-bit ARM needs adjusting in
|
||||||
// before 64-bit ARM can become tier-1. See bug 1400811.
|
// 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
|
// Ideally, we'd get rid of this smaller limit and make 32-bit Windows and
|
||||||
// capable of working with the Linux/Mac/Win64 number below.
|
// Android capable of working with the Linux/Mac/Win64 number below.
|
||||||
#define MAX_REFLOW_DEPTH 585
|
#define MAX_REFLOW_DEPTH 585
|
||||||
#else
|
#else
|
||||||
// Blink's magic depth limit from its HTML parser times two. Also just about fits
|
// Blink's magic depth limit from its HTML parser times two. Also just about
|
||||||
// within the system default runtime stack limit of 8 MB on 64-bit Mac and Linux with
|
// fits within the system default runtime stack limit of 8 MB on 64-bit Mac and
|
||||||
// display: table-cell.
|
// Linux with display: table-cell.
|
||||||
#define MAX_REFLOW_DEPTH 1026
|
#define MAX_REFLOW_DEPTH 1026
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1898,7 +1898,7 @@ bool BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1,
|
||||||
};
|
};
|
||||||
|
|
||||||
const nsIFrame* ancestor =
|
const nsIFrame* ancestor =
|
||||||
nsLayoutUtils::FindNearestCommonAncestorFrame(aFrame1, aFrame2);
|
nsLayoutUtils::FindNearestCommonAncestorFrame(aFrame1, aFrame2);
|
||||||
MOZ_ASSERT(ancestor);
|
MOZ_ASSERT(ancestor);
|
||||||
|
|
||||||
// Map inline-end and inline-start to physical sides for checking presence
|
// Map inline-end and inline-start to physical sides for checking presence
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Rule;
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Document;
|
class Document;
|
||||||
class Element;
|
class Element;
|
||||||
}
|
} // namespace dom
|
||||||
|
|
||||||
struct MutationClosureData {
|
struct MutationClosureData {
|
||||||
MutationClosureData() : mClosure(nullptr), mElement(nullptr), mModType(0) {}
|
MutationClosureData() : mClosure(nullptr), mElement(nullptr), mModType(0) {}
|
||||||
|
|
|
@ -21,10 +21,7 @@ CFLAGS += [
|
||||||
'-I%s/dist/include/dav1d/' % TOPOBJDIR,
|
'-I%s/dist/include/dav1d/' % TOPOBJDIR,
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['CC_TYPE'] == 'clang':
|
# This is Linux only for now
|
||||||
CFLAGS += ['-mstack-alignment=32']
|
|
||||||
elif CONFIG['CC_TYPE'] == 'gcc':
|
|
||||||
CFLAGS += ['-mpreferred-stack-boundary=5']
|
|
||||||
|
|
||||||
# Attaching config.asm file
|
# Attaching config.asm file
|
||||||
if CONFIG['CPU_ARCH'] == 'x86':
|
if CONFIG['CPU_ARCH'] == 'x86':
|
||||||
|
@ -32,6 +29,12 @@ if CONFIG['CPU_ARCH'] == 'x86':
|
||||||
SOURCES += ['x86_32/config.asm']
|
SOURCES += ['x86_32/config.asm']
|
||||||
|
|
||||||
if CONFIG['CPU_ARCH'] == 'x86_64':
|
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':
|
if CONFIG['OS_TARGET'] == 'Darwin':
|
||||||
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR]
|
ASFLAGS += ['-I%s/media/libdav1d/asm/x86_64/osx/' % TOPSRCDIR]
|
||||||
SOURCES += ['x86_64/osx/config.asm']
|
SOURCES += ['x86_64/osx/config.asm']
|
||||||
|
|
|
@ -5,5 +5,7 @@
|
||||||
|
|
||||||
%define ARCH_X86_64 0
|
%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 ARCH_X86_64 1
|
||||||
|
|
||||||
%define PIC 1
|
|
||||||
|
|
||||||
%define STACK_ALIGNMENT 32
|
%define STACK_ALIGNMENT 32
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
#define CONFIG_8BPC 1
|
#define CONFIG_8BPC 1
|
||||||
|
|
||||||
// Enable asm
|
// 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
|
#define HAVE_ASM 1
|
||||||
#else
|
#else
|
||||||
#define HAVE_ASM 0
|
#define HAVE_ASM 0
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// unistd.h is used by tools, which we do not
|
// 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
|
#define HAVE_UNISTD_H 1
|
||||||
|
|
||||||
// Important when asm is enabled
|
// Important when asm is enabled
|
||||||
|
@ -61,5 +62,8 @@
|
||||||
#define PREFIX 1
|
#define PREFIX 1
|
||||||
#endif
|
#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
|
#define STACK_ALIGNMENT 32
|
||||||
|
#endif
|
||||||
|
|
|
@ -25,16 +25,19 @@ SOURCES += [
|
||||||
]
|
]
|
||||||
|
|
||||||
# Enable ASM on Linux for now.
|
# 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']
|
DIRS += ['asm']
|
||||||
if CONFIG['CC_TYPE'] == 'clang':
|
if CONFIG['CPU_ARCH'] == 'x86_64':
|
||||||
CFLAGS += ['-mstack-alignment=32']
|
# Update stack aligment to 32 bytes
|
||||||
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mstackrealign']
|
if CONFIG['CC_TYPE'] == 'clang':
|
||||||
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mstackrealign']
|
CFLAGS += ['-mstack-alignment=32']
|
||||||
elif CONFIG['CC_TYPE'] == 'gcc':
|
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mstackrealign']
|
||||||
CFLAGS += ['-mpreferred-stack-boundary=5']
|
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mstackrealign']
|
||||||
SOURCES['../../third_party/dav1d/src/lib.c'].flags += ['-mincoming-stack-boundary=4']
|
elif CONFIG['CC_TYPE'] == 'gcc':
|
||||||
SOURCES['../../third_party/dav1d/src/thread_task.c'].flags += ['-mincoming-stack-boundary=4']
|
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
|
# common sources
|
||||||
SOURCES += [
|
SOURCES += [
|
||||||
|
|
|
@ -20,7 +20,7 @@ origin:
|
||||||
|
|
||||||
# Human-readable identifier for this version/release
|
# Human-readable identifier for this version/release
|
||||||
# Generally "version NNN", "tag SSS", "bookmark SSS"
|
# 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
|
# The package's license, where possible using the mnemonic from
|
||||||
# https://spdx.org/licenses/
|
# https://spdx.org/licenses/
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
class Document;
|
class Document;
|
||||||
}
|
}
|
||||||
}
|
} // namespace mozilla
|
||||||
|
|
||||||
struct VisitedURI {
|
struct VisitedURI {
|
||||||
nsCOMPtr<nsIURI> mURI;
|
nsCOMPtr<nsIURI> mURI;
|
||||||
|
|
|
@ -1905,11 +1905,10 @@ pref("network.http.rcwn.max_wait_before_racing_ms", 500);
|
||||||
// all available active connections.
|
// all available active connections.
|
||||||
pref("network.http.focused_window_transaction_ratio", "0.9");
|
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
|
// 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
|
// that the parent can send to the child before getting an ack). 0 for disable
|
||||||
// the flow control.
|
// 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.
|
// Whether or not we give more priority to active tab.
|
||||||
// Note that this requires restart for changes to take effect.
|
// 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());
|
dom::Pref pref(nsCString(aName), /* isLocked */ false, null_t(), null_t());
|
||||||
Preferences::GetPreference(&pref);
|
Preferences::GetPreference(&pref);
|
||||||
auto sendPrefUpdate = [pref]() {
|
auto sendPrefUpdate = [pref]() {
|
||||||
Unused << gIOService->mSocketProcess->GetActor()->SendPreferenceUpdate(pref);
|
Unused << gIOService->mSocketProcess->GetActor()->SendPreferenceUpdate(
|
||||||
|
pref);
|
||||||
};
|
};
|
||||||
CallOrWaitForSocketProcess(sendPrefUpdate);
|
CallOrWaitForSocketProcess(sendPrefUpdate);
|
||||||
}
|
}
|
||||||
|
@ -469,13 +470,14 @@ void nsIOService::OnProcessLaunchComplete(SocketProcessHost *aHost,
|
||||||
if (!mPendingEvents.IsEmpty()) {
|
if (!mPendingEvents.IsEmpty()) {
|
||||||
nsTArray<std::function<void()>> pendingEvents;
|
nsTArray<std::function<void()>> pendingEvents;
|
||||||
mPendingEvents.SwapElements(pendingEvents);
|
mPendingEvents.SwapElements(pendingEvents);
|
||||||
for (auto& func : pendingEvents) {
|
for (auto &func : pendingEvents) {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsIOService::CallOrWaitForSocketProcess(const std::function<void()>& aFunc) {
|
void nsIOService::CallOrWaitForSocketProcess(
|
||||||
|
const std::function<void()> &aFunc) {
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
if (IsSocketProcessLaunchComplete() && SocketProcessReady()) {
|
if (IsSocketProcessLaunchComplete() && SocketProcessReady()) {
|
||||||
aFunc();
|
aFunc();
|
||||||
|
@ -499,9 +501,9 @@ void nsIOService::OnProcessUnexpectedShutdown(SocketProcessHost *aHost) {
|
||||||
RefPtr<MemoryReportingProcess> nsIOService::GetSocketProcessMemoryReporter() {
|
RefPtr<MemoryReportingProcess> nsIOService::GetSocketProcessMemoryReporter() {
|
||||||
// Check the prefs here again, since we don't want to create
|
// Check the prefs here again, since we don't want to create
|
||||||
// SocketProcessMemoryReporter for some tests.
|
// SocketProcessMemoryReporter for some tests.
|
||||||
if (!Preferences::GetBool("network.process.enabled") || !SocketProcessReady()) {
|
if (!Preferences::GetBool("network.process.enabled") ||
|
||||||
|
!SocketProcessReady()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SocketProcessMemoryReporter();
|
return new SocketProcessMemoryReporter();
|
||||||
|
|
|
@ -62,8 +62,8 @@ class OfflineObserver final : public nsIObserver {
|
||||||
} else if (!strcmp(aTopic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID)) {
|
} else if (!strcmp(aTopic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID)) {
|
||||||
nsCOMPtr<nsIObserverService> obs =
|
nsCOMPtr<nsIObserverService> obs =
|
||||||
mozilla::services::GetObserverService();
|
mozilla::services::GetObserverService();
|
||||||
obs->RemoveObserver(this, NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC);
|
obs->RemoveObserver(this, NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC);
|
||||||
obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
|
obs->RemoveObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -880,7 +880,11 @@ void HttpChannelChild::OnTransportAndData(const nsresult& channelStatus,
|
||||||
|
|
||||||
bool HttpChannelChild::NeedToReportBytesRead() {
|
bool HttpChannelChild::NeedToReportBytesRead() {
|
||||||
if (mCacheNeedToReportBytesReadInitialized) {
|
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
|
// 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
|
// We're going to run out of sending window size
|
||||||
if (mSendWindowSize > 0 && mSendWindowSize <= count) {
|
if (mSendWindowSize > 0 && mSendWindowSize <= count) {
|
||||||
MOZ_ASSERT(!mSuspendedForFlowControl);
|
MOZ_ASSERT(!mSuspendedForFlowControl);
|
||||||
|
LOG((" suspend the channel due to e10s backpressure"));
|
||||||
Unused << mChannel->Suspend();
|
Unused << mChannel->Suspend();
|
||||||
mSuspendedForFlowControl = true;
|
mSuspendedForFlowControl = true;
|
||||||
mHasSuspendedByBackPressure = true;
|
mHasSuspendedByBackPressure = true;
|
||||||
|
@ -1652,7 +1653,8 @@ bool HttpChannelParent::NeedFlowControl() {
|
||||||
|
|
||||||
mozilla::ipc::IPCResult HttpChannelParent::RecvBytesRead(
|
mozilla::ipc::IPCResult HttpChannelParent::RecvBytesRead(
|
||||||
const int32_t& aCount) {
|
const int32_t& aCount) {
|
||||||
if (!NeedFlowControl()) {
|
// no more flow control after diviersion starts
|
||||||
|
if (!NeedFlowControl() || mDivertingFromChild) {
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1661,6 +1663,7 @@ mozilla::ipc::IPCResult HttpChannelParent::RecvBytesRead(
|
||||||
|
|
||||||
if (mSendWindowSize <= 0 && mSendWindowSize + aCount > 0) {
|
if (mSendWindowSize <= 0 && mSendWindowSize + aCount > 0) {
|
||||||
MOZ_ASSERT(mSuspendedForFlowControl);
|
MOZ_ASSERT(mSuspendedForFlowControl);
|
||||||
|
LOG((" resume the channel due to e10s backpressure relief"));
|
||||||
Unused << mChannel->Resume();
|
Unused << mChannel->Resume();
|
||||||
mSuspendedForFlowControl = false;
|
mSuspendedForFlowControl = false;
|
||||||
|
|
||||||
|
@ -2076,6 +2079,14 @@ nsresult HttpChannelParent::SuspendForDiversion() {
|
||||||
rv = mParentListener->SuspendForDiversion();
|
rv = mParentListener->SuspendForDiversion();
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
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
|
// Once this is set, no more OnStart/OnData/OnStop callbacks should be sent
|
||||||
// to the child.
|
// to the child.
|
||||||
mDivertingFromChild = true;
|
mDivertingFromChild = true;
|
||||||
|
|
|
@ -15,8 +15,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
|
||||||
NS_DEFINE_NAMED_CID(NS_PARSER_CID);
|
NS_DEFINE_NAMED_CID(NS_PARSER_CID);
|
||||||
|
|
||||||
static const mozilla::Module::CIDEntry kParserCIDs[] = {
|
static const mozilla::Module::CIDEntry kParserCIDs[] = {
|
||||||
{&kNS_PARSER_CID, false, nullptr, nsParserConstructor},
|
{&kNS_PARSER_CID, false, nullptr, nsParserConstructor}, {nullptr}};
|
||||||
{nullptr}};
|
|
||||||
|
|
||||||
static nsresult Initialize() {
|
static nsresult Initialize() {
|
||||||
nsresult rv = nsHTMLTags::AddRefTable();
|
nsresult rv = nsHTMLTags::AddRefTable();
|
||||||
|
|
|
@ -150,6 +150,27 @@ And once done:
|
||||||
#. Wait for Firefox to pick-up the changes for your settings key
|
#. 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
|
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, "");
|
const lastEtag = gPrefs.getCharPref(PREF_SETTINGS_LAST_ETAG, "");
|
||||||
|
|
||||||
let pollResult;
|
let pollResult;
|
||||||
|
@ -226,6 +228,7 @@ function remoteSettingsFunction() {
|
||||||
// the one in the local database.
|
// the one in the local database.
|
||||||
try {
|
try {
|
||||||
await client.maybeSync(last_modified, { loadDump });
|
await client.maybeSync(last_modified, { loadDump });
|
||||||
|
|
||||||
// Save last time this client was successfully synced.
|
// Save last time this client was successfully synced.
|
||||||
Services.prefs.setIntPref(client.lastCheckTimePref, checkedServerTimeInSeconds);
|
Services.prefs.setIntPref(client.lastCheckTimePref, checkedServerTimeInSeconds);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -245,7 +248,7 @@ function remoteSettingsFunction() {
|
||||||
gPrefs.setCharPref(PREF_SETTINGS_LAST_ETAG, currentEtag);
|
gPrefs.setCharPref(PREF_SETTINGS_LAST_ETAG, currentEtag);
|
||||||
}
|
}
|
||||||
|
|
||||||
Services.obs.notifyObservers(null, "remote-settings-changes-polled");
|
Services.obs.notifyObservers(null, "remote-settings:changes-poll-end");
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче