зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to autoland
This commit is contained in:
Коммит
6239412998
|
@ -14,7 +14,6 @@ chrome/**
|
|||
config/**
|
||||
db/**
|
||||
docshell/**
|
||||
dom/**
|
||||
editor/**
|
||||
embedding/**
|
||||
extensions/**
|
||||
|
@ -153,6 +152,77 @@ devtools/client/framework/test/code_ugly*
|
|||
devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
|
||||
devtools/server/tests/unit/setBreakpoint*
|
||||
|
||||
# dom/ exclusions
|
||||
dom/animation/**
|
||||
dom/archivereader/**
|
||||
dom/asmjscache/**
|
||||
dom/audiochannel/**
|
||||
dom/base/**
|
||||
dom/battery/**
|
||||
dom/bindings/**
|
||||
dom/broadcastchannel/**
|
||||
dom/browser-element/**
|
||||
dom/cache/**
|
||||
dom/canvas/**
|
||||
dom/commandhandler/**
|
||||
dom/console/**
|
||||
dom/crypto/**
|
||||
dom/devicestorage/**
|
||||
dom/encoding/**
|
||||
dom/events/**
|
||||
dom/fetch/**
|
||||
dom/file/**
|
||||
dom/filehandle/**
|
||||
dom/filesystem/**
|
||||
dom/flyweb/**
|
||||
dom/gamepad/**
|
||||
dom/geolocation/**
|
||||
dom/grid/**
|
||||
dom/html/**
|
||||
dom/imptests/**
|
||||
dom/interfaces/**
|
||||
dom/ipc/**
|
||||
dom/json/**
|
||||
dom/jsurl/**
|
||||
dom/locales/**
|
||||
dom/manifest/**
|
||||
dom/mathml/**
|
||||
dom/media/**
|
||||
dom/messagechannel/**
|
||||
dom/network/**
|
||||
dom/notification/**
|
||||
dom/offline/**
|
||||
dom/performance/**
|
||||
dom/permission/**
|
||||
dom/plugins/**
|
||||
dom/power/**
|
||||
dom/presentation/**
|
||||
dom/promise/**
|
||||
dom/push/**
|
||||
dom/quota/**
|
||||
dom/res/**
|
||||
dom/secureelement/**
|
||||
dom/security/**
|
||||
dom/smil/**
|
||||
dom/storage/**
|
||||
dom/svg/**
|
||||
dom/system/**
|
||||
dom/tests/**
|
||||
dom/time/**
|
||||
dom/u2f/**
|
||||
dom/url/**
|
||||
dom/vr/**
|
||||
dom/webauthn/**
|
||||
dom/webbrowserpersist/**
|
||||
dom/webidl/**
|
||||
dom/workers/**
|
||||
dom/worklet/**
|
||||
dom/xbl/**
|
||||
dom/xhr/**
|
||||
dom/xml/**
|
||||
dom/xslt/**
|
||||
dom/xul/**
|
||||
|
||||
# Exclude everything but self-hosted JS
|
||||
js/ductwork/**
|
||||
js/examples/**
|
||||
|
|
|
@ -534,7 +534,6 @@ DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
|
|||
}
|
||||
|
||||
Accessible* outerDoc = OuterDocOfRemoteBrowser();
|
||||
MOZ_ASSERT(outerDoc);
|
||||
|
||||
IAccessible* rawNative = nullptr;
|
||||
if (outerDoc) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "Accessible2.h"
|
||||
#include "ProxyAccessible.h"
|
||||
#include "ia2AccessibleRelation.h"
|
||||
#include "ia2AccessibleValue.h"
|
||||
#include "IGeckoCustom.h"
|
||||
#include "mozilla/a11y/DocAccessibleParent.h"
|
||||
|
@ -80,6 +81,12 @@ struct InterfaceIID<IGeckoCustom>
|
|||
static REFIID Value() { return IID_IGeckoCustom; }
|
||||
};
|
||||
|
||||
template<>
|
||||
struct InterfaceIID<IAccessible2_2>
|
||||
{
|
||||
static REFIID Value() { return IID_IAccessible2_2; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the COM proxy for this proxy accessible and QueryInterface it with the
|
||||
* correct IID
|
||||
|
@ -363,6 +370,44 @@ ProxyAccessible::Attributes(nsTArray<Attribute>* aAttrs) const
|
|||
aAttrs);
|
||||
}
|
||||
|
||||
nsTArray<ProxyAccessible*>
|
||||
ProxyAccessible::RelationByType(RelationType aType) const
|
||||
{
|
||||
RefPtr<IAccessible2_2> acc = QueryInterface<IAccessible2_2>(this);
|
||||
if (!acc) {
|
||||
nsTArray<ProxyAccessible*>();
|
||||
}
|
||||
|
||||
_bstr_t relationType;
|
||||
for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
|
||||
if (aType == sRelationTypePairs[idx].first) {
|
||||
relationType = sRelationTypePairs[idx].second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!relationType) {
|
||||
nsTArray<ProxyAccessible*>();
|
||||
}
|
||||
|
||||
IUnknown** targets;
|
||||
long nTargets = 0;
|
||||
HRESULT hr = acc->get_relationTargetsOfType(relationType, 0, &targets, &nTargets);
|
||||
if (FAILED(hr)) {
|
||||
nsTArray<ProxyAccessible*>();
|
||||
}
|
||||
|
||||
nsTArray<ProxyAccessible*> proxies;
|
||||
for (long idx = 0; idx < nTargets; idx++) {
|
||||
IUnknown* target = targets[idx];
|
||||
proxies.AppendElement(GetProxyFor(Document(), target));
|
||||
target->Release();
|
||||
}
|
||||
CoTaskMemFree(targets);
|
||||
|
||||
return Move(proxies);
|
||||
}
|
||||
|
||||
double
|
||||
ProxyAccessible::CurValue()
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ skip-if = e10s && os == 'win' && os_version == '5.1'
|
|||
[browser_caching_name.js]
|
||||
skip-if = e10s && os == 'win' && os_version == '5.1'
|
||||
[browser_caching_relations.js]
|
||||
skip-if = e10s && os == 'win' # Bug 1288839
|
||||
skip-if = e10s && os == 'win' && os_version == '5.1'
|
||||
[browser_caching_states.js]
|
||||
skip-if = e10s && os == 'win' && os_version == '5.1'
|
||||
[browser_caching_value.js]
|
||||
|
|
|
@ -504,16 +504,12 @@ xpcAccessible::GetRelationByType(uint32_t aType,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
ProxyAccessible* proxy = IntlGeneric().AsProxy();
|
||||
nsTArray<ProxyAccessible*> targets =
|
||||
proxy->RelationByType(static_cast<RelationType>(aType));
|
||||
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &targets));
|
||||
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1579,6 +1579,7 @@ pref("services.sync.validation.enabled", true);
|
|||
|
||||
// Preferences for the form autofill system extension
|
||||
pref("browser.formautofill.experimental", false);
|
||||
pref("browser.formautofill.enabled", false);
|
||||
|
||||
// Enable safebrowsing v4 tables (suffixed by "-proto") update.
|
||||
#ifdef NIGHTLY_BUILD
|
||||
|
|
|
@ -12,5 +12,10 @@
|
|||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"namespace": "devtools",
|
||||
"allowedContexts": ["devtools", "devtools_only"],
|
||||
"defaultContexts": ["devtools", "devtools_only"]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -141,8 +141,8 @@ add_task(function* testCaptureVisibleTabPermissions() {
|
|||
},
|
||||
|
||||
background() {
|
||||
browser.test.assertFalse("captureVisibleTab" in browser.tabs,
|
||||
'Extension without "<all_tabs>" permission should not have access to captureVisibleTab');
|
||||
browser.test.assertEq(undefined, browser.tabs.captureVisibleTab,
|
||||
'Extension without "<all_urls>" permission should not have access to captureVisibleTab');
|
||||
browser.test.notifyPass("captureVisibleTabPermissions");
|
||||
},
|
||||
});
|
||||
|
|
|
@ -13,12 +13,12 @@ do_get_profile(); // fxa needs a profile directory for storage.
|
|||
|
||||
// Create a window polyfill so sinon can load
|
||||
let window = {
|
||||
document: {},
|
||||
location: {},
|
||||
setTimeout,
|
||||
setInterval,
|
||||
clearTimeout,
|
||||
clearinterval: clearInterval
|
||||
document: {},
|
||||
location: {},
|
||||
setTimeout,
|
||||
setInterval,
|
||||
clearTimeout,
|
||||
clearInterval,
|
||||
};
|
||||
let self = window;
|
||||
|
||||
|
|
|
@ -31,32 +31,105 @@
|
|||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
"resource://gre/modules/osfile.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ProfileStorage",
|
||||
"resource://formautofill/ProfileStorage.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FormAutofillPreferences",
|
||||
"resource://formautofill/FormAutofillPreferences.jsm");
|
||||
|
||||
const PROFILE_JSON_FILE_NAME = "autofill-profiles.json";
|
||||
const ENABLED_PREF = "browser.formautofill.enabled";
|
||||
|
||||
function FormAutofillParent() {
|
||||
}
|
||||
|
||||
FormAutofillParent.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
|
||||
|
||||
let FormAutofillParent = {
|
||||
_profileStore: null,
|
||||
|
||||
/**
|
||||
* Whether Form Autofill is enabled in preferences.
|
||||
* Caches the latest value of this._getStatus().
|
||||
*/
|
||||
_enabled: false,
|
||||
|
||||
/**
|
||||
* Initializes ProfileStorage and registers the message handler.
|
||||
*/
|
||||
init() {
|
||||
let storePath =
|
||||
OS.Path.join(OS.Constants.Path.profileDir, PROFILE_JSON_FILE_NAME);
|
||||
|
||||
let storePath = OS.Path.join(OS.Constants.Path.profileDir, PROFILE_JSON_FILE_NAME);
|
||||
this._profileStore = new ProfileStorage(storePath);
|
||||
this._profileStore.initialize();
|
||||
|
||||
let mm = Cc["@mozilla.org/globalmessagemanager;1"]
|
||||
.getService(Ci.nsIMessageListenerManager);
|
||||
mm.addMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
mm.addMessageListener("FormAutofill:GetProfiles", this);
|
||||
Services.obs.addObserver(this, "advanced-pane-loaded", false);
|
||||
|
||||
// Observing the pref (and storage) changes
|
||||
Services.prefs.addObserver(ENABLED_PREF, this, false);
|
||||
this._enabled = this._getStatus();
|
||||
// Force to trigger the onStatusChanged function for setting listeners properly
|
||||
// while initizlization
|
||||
this._onStatusChanged();
|
||||
Services.mm.addMessageListener("FormAutofill:getEnabledStatus", this);
|
||||
},
|
||||
|
||||
observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "advanced-pane-loaded": {
|
||||
let formAutofillPreferences = new FormAutofillPreferences();
|
||||
let document = subject.document;
|
||||
let prefGroup = formAutofillPreferences.init(document);
|
||||
let parentNode = document.getElementById("mainPrefPane");
|
||||
let insertBeforeNode = document.getElementById("locationBarGroup");
|
||||
parentNode.insertBefore(prefGroup, insertBeforeNode);
|
||||
break;
|
||||
}
|
||||
|
||||
case "nsPref:changed": {
|
||||
// Observe pref changes and update _enabled cache if status is changed.
|
||||
let currentStatus = this._getStatus();
|
||||
if (currentStatus !== this._enabled) {
|
||||
this._enabled = currentStatus;
|
||||
this._onStatusChanged();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
throw new Error(`FormAutofillParent: Unexpected topic observed: ${topic}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Add/remove message listener and broadcast the status to frames while the
|
||||
* form autofill status changed.
|
||||
*/
|
||||
_onStatusChanged() {
|
||||
if (this._enabled) {
|
||||
Services.mm.addMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
Services.mm.addMessageListener("FormAutofill:GetProfiles", this);
|
||||
} else {
|
||||
Services.mm.removeMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
Services.mm.removeMessageListener("FormAutofill:GetProfiles", this);
|
||||
}
|
||||
|
||||
Services.mm.broadcastAsyncMessage("FormAutofill:enabledStatus", this._enabled);
|
||||
},
|
||||
|
||||
/**
|
||||
* Query pref (and storage) status to determine the overall status for
|
||||
* form autofill feature.
|
||||
*
|
||||
* @returns {boolean} status of form autofill feature
|
||||
*/
|
||||
_getStatus() {
|
||||
return Services.prefs.getBoolPref(ENABLED_PREF);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -74,6 +147,10 @@ let FormAutofillParent = {
|
|||
case "FormAutofill:GetProfiles":
|
||||
this._getProfiles(data, target);
|
||||
break;
|
||||
case "FormAutofill:getEnabledStatus":
|
||||
target.messageManager.sendAsyncMessage("FormAutofill:enabledStatus",
|
||||
this._enabled);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -99,10 +176,10 @@ let FormAutofillParent = {
|
|||
this._profileStore = null;
|
||||
}
|
||||
|
||||
let mm = Cc["@mozilla.org/globalmessagemanager;1"]
|
||||
.getService(Ci.nsIMessageListenerManager);
|
||||
mm.removeMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
mm.removeMessageListener("FormAutofill:GetProfiles", this);
|
||||
Services.mm.removeMessageListener("FormAutofill:PopulateFieldValues", this);
|
||||
Services.mm.removeMessageListener("FormAutofill:GetProfiles", this);
|
||||
Services.obs.removeObserver(this, "advanced-pane-loaded");
|
||||
Services.prefs.removeObserver(ENABLED_PREF, this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Injects the form autofill section into about:preferences.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["FormAutofillPreferences"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
const PREF_AUTOFILL_ENABLED = "browser.formautofill.enabled";
|
||||
const BUNDLE_URI = "chrome://formautofill/locale/formautofill.properties";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function FormAutofillPreferences() {
|
||||
this.bundle = Services.strings.createBundle(BUNDLE_URI);
|
||||
}
|
||||
|
||||
FormAutofillPreferences.prototype = {
|
||||
/**
|
||||
* Check if Form Autofill feature is enabled.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isAutofillEnabled() {
|
||||
return Services.prefs.getBoolPref(PREF_AUTOFILL_ENABLED);
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the current page is Preferences/Privacy.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isPrivacyPane() {
|
||||
return this.refs.document.location.href == "about:preferences#privacy";
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the Form Autofill preference group.
|
||||
*
|
||||
* @param {XULDocument} document
|
||||
* @returns {XULElement}
|
||||
*/
|
||||
init(document) {
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
let formAutofillGroup = document.createElementNS(XUL_NS, "groupbox");
|
||||
let caption = document.createElementNS(XUL_NS, "caption");
|
||||
let captionLabel = document.createElementNS(XUL_NS, "label");
|
||||
let hbox = document.createElementNS(XUL_NS, "hbox");
|
||||
let enabledCheckbox = document.createElementNS(XUL_NS, "checkbox");
|
||||
let spacer = document.createElementNS(XUL_NS, "spacer");
|
||||
let savedProfilesBtn = document.createElementNS(XUL_NS, "button");
|
||||
|
||||
this.refs = {
|
||||
document,
|
||||
formAutofillGroup,
|
||||
enabledCheckbox,
|
||||
savedProfilesBtn,
|
||||
};
|
||||
|
||||
formAutofillGroup.id = "formAutofillGroup";
|
||||
formAutofillGroup.hidden = !this.isPrivacyPane;
|
||||
// Use .setAttribute because HTMLElement.dataset is not available on XUL elements
|
||||
formAutofillGroup.setAttribute("data-category", "panePrivacy");
|
||||
|
||||
captionLabel.textContent = this.bundle.GetStringFromName("preferenceGroupTitle");
|
||||
savedProfilesBtn.setAttribute("label", this.bundle.GetStringFromName("savedProfiles"));
|
||||
enabledCheckbox.setAttribute("label", this.bundle.GetStringFromName("enableProfileAutofill"));
|
||||
|
||||
// Manually set the checked state
|
||||
if (this.isAutofillEnabled) {
|
||||
enabledCheckbox.setAttribute("checked", true);
|
||||
}
|
||||
|
||||
spacer.flex = 1;
|
||||
|
||||
formAutofillGroup.appendChild(caption);
|
||||
caption.appendChild(captionLabel);
|
||||
formAutofillGroup.appendChild(hbox);
|
||||
hbox.appendChild(enabledCheckbox);
|
||||
hbox.appendChild(spacer);
|
||||
hbox.appendChild(savedProfilesBtn);
|
||||
|
||||
this.attachEventListeners();
|
||||
|
||||
return formAutofillGroup;
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove event listeners and the preference group.
|
||||
*/
|
||||
uninit() {
|
||||
this.detachEventListeners();
|
||||
this.refs.formAutofillGroup.remove();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle events
|
||||
*
|
||||
* @param {DOMEvent} event
|
||||
*/
|
||||
handleEvent(event) {
|
||||
switch (event.type) {
|
||||
case "command": {
|
||||
let target = event.target;
|
||||
|
||||
if (target == this.refs.enabledCheckbox) {
|
||||
// Set preference directly instead of relying on <Preference>
|
||||
Services.prefs.setBoolPref(PREF_AUTOFILL_ENABLED, target.checked);
|
||||
} else if (target == this.refs.savedProfilesBtn) {
|
||||
// TODO: Open Saved Profiles dialog
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Attach event listener
|
||||
*/
|
||||
attachEventListeners() {
|
||||
this.refs.formAutofillGroup.addEventListener("command", this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove event listener
|
||||
*/
|
||||
detachEventListeners() {
|
||||
this.refs.formAutofillGroup.removeEventListener("command", this);
|
||||
},
|
||||
};
|
|
@ -21,7 +21,8 @@ function startup() {
|
|||
return;
|
||||
}
|
||||
|
||||
FormAutofillParent.init();
|
||||
let parent = new FormAutofillParent();
|
||||
parent.init();
|
||||
Services.mm.loadFrameScript("chrome://formautofill/content/FormAutofillContent.js", true);
|
||||
}
|
||||
|
||||
|
|
|
@ -340,9 +340,16 @@ let ProfileAutocomplete = {
|
|||
*/
|
||||
var FormAutofillContent = {
|
||||
init() {
|
||||
ProfileAutocomplete.ensureRegistered();
|
||||
|
||||
addEventListener("DOMContentLoaded", this);
|
||||
|
||||
addMessageListener("FormAutofill:enabledStatus", (result) => {
|
||||
if (result.data) {
|
||||
ProfileAutocomplete.ensureRegistered();
|
||||
} else {
|
||||
ProfileAutocomplete.ensureUnregistered();
|
||||
}
|
||||
});
|
||||
sendAsyncMessage("FormAutofill:getEnabledStatus");
|
||||
},
|
||||
|
||||
handleEvent(evt) {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
preferenceGroupTitle = Form Autofill
|
||||
enableProfileAutofill = Enable Profile Autofill
|
||||
savedProfiles = Saved Profiles…
|
|
@ -0,0 +1,8 @@
|
|||
#filter substitution
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
@AB_CD@.jar:
|
||||
% locale formautofill @AB_CD@ %locale/@AB_CD@/
|
||||
locale/@AB_CD@/ (en-US/*)
|
|
@ -0,0 +1,7 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
JAR_MANIFESTS += ['jar.mn']
|
|
@ -7,6 +7,8 @@
|
|||
DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
|
||||
DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
|
||||
|
||||
DIRS += ['locale']
|
||||
|
||||
FINAL_TARGET_FILES.features['formautofill@mozilla.org'] += [
|
||||
'bootstrap.js'
|
||||
]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
[DEFAULT]
|
||||
|
||||
[browser_check_installed.js]
|
||||
[browser_privacyPreferences.js]
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
"use strict";
|
||||
|
||||
const PAGE_PREFS = "about:preferences";
|
||||
const PAGE_PRIVACY = PAGE_PREFS + "#privacy";
|
||||
const GROUP_AUTOFILL = "#formAutofillGroup";
|
||||
const CHECKBOX_AUTOFILL = GROUP_AUTOFILL + " checkbox";
|
||||
const PREF_AUTOFILL_ENABLED = "browser.formautofill.enabled";
|
||||
const TEST_SELECTORS = {
|
||||
group: GROUP_AUTOFILL,
|
||||
checkbox: CHECKBOX_AUTOFILL,
|
||||
};
|
||||
|
||||
// Visibility of form autofill group should be hidden when opening
|
||||
// preferences page.
|
||||
add_task(function* test_aboutPreferences() {
|
||||
yield BrowserTestUtils.withNewTab({gBrowser, url: PAGE_PREFS}, function* (browser) {
|
||||
yield ContentTask.spawn(browser, TEST_SELECTORS, (args) => {
|
||||
is(content.document.querySelector(args.group).hidden, true,
|
||||
"Form Autofill group should be hidden");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Visibility of form autofill group should be visible when opening
|
||||
// directly to privacy page. Checkbox is not checked by default.
|
||||
add_task(function* test_aboutPreferencesPrivacy() {
|
||||
yield BrowserTestUtils.withNewTab({gBrowser, url: PAGE_PRIVACY}, function* (browser) {
|
||||
yield ContentTask.spawn(browser, TEST_SELECTORS, (args) => {
|
||||
is(content.document.querySelector(args.group).hidden, false,
|
||||
"Form Autofill group should be visible");
|
||||
is(content.document.querySelector(args.checkbox).checked, false,
|
||||
"Checkbox should be unchecked");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Checkbox should be checked when form autofill is enabled.
|
||||
add_task(function* test_autofillEnabledCheckbox() {
|
||||
SpecialPowers.pushPrefEnv({set: [[PREF_AUTOFILL_ENABLED, true]]});
|
||||
|
||||
yield BrowserTestUtils.withNewTab({gBrowser, url: PAGE_PRIVACY}, function* (browser) {
|
||||
yield ContentTask.spawn(browser, TEST_SELECTORS, (args) => {
|
||||
is(content.document.querySelector(args.group).hidden, false,
|
||||
"Form Autofill group should be visible");
|
||||
is(content.document.querySelector(args.checkbox).checked, true,
|
||||
"Checkbox should be checked when Form Autofill is enabled");
|
||||
});
|
||||
});
|
||||
});
|
|
@ -2,7 +2,7 @@
|
|||
* Provides infrastructure for automated formautofill components tests.
|
||||
*/
|
||||
|
||||
/* exported loadFormAutofillContent, getTempFile */
|
||||
/* exported loadFormAutofillContent, getTempFile, sinon */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -18,6 +18,14 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
do_get_profile();
|
||||
|
||||
// Setup the environment for sinon.
|
||||
Cu.import("resource://gre/modules/Timer.jsm");
|
||||
let self = {}; // eslint-disable-line no-unused-vars
|
||||
var sinon;
|
||||
Services.scriptloader.loadSubScript("resource://testing-common/sinon-1.16.1.js");
|
||||
|
||||
// Load our bootstrap extension manifest so we can access our chrome/resource URIs.
|
||||
const EXTENSION_ID = "formautofill@mozilla.org";
|
||||
let extensionDir = Services.dirsvc.get("GreD", Ci.nsIFile);
|
||||
|
@ -40,6 +48,8 @@ let gFileCounter = Math.floor(Math.random() * 1000000);
|
|||
function loadFormAutofillContent() {
|
||||
let facGlobal = {
|
||||
addEventListener() {},
|
||||
addMessageListener() {},
|
||||
sendAsyncMessage() {},
|
||||
};
|
||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader);
|
||||
|
@ -83,12 +93,12 @@ function getTempFile(leafName) {
|
|||
return file;
|
||||
}
|
||||
|
||||
add_task(function* test_common_initialize() {
|
||||
add_task(function* head_initialize() {
|
||||
Services.prefs.setBoolPref("browser.formautofill.experimental", true);
|
||||
Services.prefs.setBoolPref("dom.forms.autocomplete.experimental", true);
|
||||
|
||||
// Clean up after every test.
|
||||
do_register_cleanup(() => {
|
||||
do_register_cleanup(function head_cleanup() {
|
||||
Services.prefs.clearUserPref("browser.formautofill.experimental");
|
||||
Services.prefs.clearUserPref("dom.forms.autocomplete.experimental");
|
||||
});
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Test for status handling in Form Autofill Parent.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://formautofill/FormAutofillParent.jsm");
|
||||
|
||||
add_task(function* test_enabledStatus_init() {
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
sinon.spy(formAutofillParent, "_onStatusChanged");
|
||||
|
||||
// Default status is false before initialization
|
||||
do_check_eq(formAutofillParent._enabled, false);
|
||||
|
||||
formAutofillParent.init();
|
||||
do_check_eq(formAutofillParent._onStatusChanged.called, true);
|
||||
|
||||
formAutofillParent._uninit();
|
||||
});
|
||||
|
||||
add_task(function* test_enabledStatus_observe() {
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
sinon.stub(formAutofillParent, "_getStatus");
|
||||
sinon.spy(formAutofillParent, "_onStatusChanged");
|
||||
|
||||
// _enabled = _getStatus() => No need to trigger onStatusChanged
|
||||
formAutofillParent._enabled = true;
|
||||
formAutofillParent._getStatus.returns(true);
|
||||
formAutofillParent.observe(null, "nsPref:changed", "browser.formautofill.enabled");
|
||||
do_check_eq(formAutofillParent._onStatusChanged.called, false);
|
||||
|
||||
// _enabled != _getStatus() => Need to trigger onStatusChanged
|
||||
formAutofillParent._getStatus.returns(false);
|
||||
formAutofillParent.observe(null, "nsPref:changed", "browser.formautofill.enabled");
|
||||
do_check_eq(formAutofillParent._onStatusChanged.called, true);
|
||||
});
|
||||
|
||||
add_task(function* test_enabledStatus_getStatus() {
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
do_register_cleanup(function cleanup() {
|
||||
Services.prefs.clearUserPref("browser.formautofill.enabled");
|
||||
});
|
||||
|
||||
Services.prefs.setBoolPref("browser.formautofill.enabled", true);
|
||||
do_check_eq(formAutofillParent._getStatus(), true);
|
||||
|
||||
Services.prefs.setBoolPref("browser.formautofill.enabled", false);
|
||||
do_check_eq(formAutofillParent._getStatus(), false);
|
||||
});
|
|
@ -34,9 +34,10 @@ const TEST_PROFILE = {
|
|||
};
|
||||
|
||||
add_task(function* test_populateFieldValues() {
|
||||
FormAutofillParent.init();
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
formAutofillParent.init();
|
||||
|
||||
let store = FormAutofillParent.getProfileStore();
|
||||
let store = formAutofillParent.getProfileStore();
|
||||
do_check_neq(store, null);
|
||||
|
||||
store.get = function(guid) {
|
||||
|
@ -51,7 +52,7 @@ add_task(function* test_populateFieldValues() {
|
|||
};
|
||||
|
||||
yield new Promise((resolve) => {
|
||||
FormAutofillParent.receiveMessage({
|
||||
formAutofillParent.receiveMessage({
|
||||
name: "FormAutofill:PopulateFieldValues",
|
||||
data: {
|
||||
guid: TEST_GUID,
|
||||
|
@ -78,15 +79,16 @@ add_task(function* test_populateFieldValues() {
|
|||
|
||||
do_check_eq(notifyUsedCalledCount, 1);
|
||||
|
||||
FormAutofillParent._uninit();
|
||||
do_check_null(FormAutofillParent.getProfileStore());
|
||||
formAutofillParent._uninit();
|
||||
do_check_null(formAutofillParent.getProfileStore());
|
||||
});
|
||||
|
||||
add_task(function* test_populateFieldValues_with_invalid_guid() {
|
||||
FormAutofillParent.init();
|
||||
let formAutofillParent = new FormAutofillParent();
|
||||
formAutofillParent.init();
|
||||
|
||||
Assert.throws(() => {
|
||||
FormAutofillParent.receiveMessage({
|
||||
formAutofillParent.receiveMessage({
|
||||
name: "FormAutofill:PopulateFieldValues",
|
||||
data: {
|
||||
guid: "invalid-guid",
|
||||
|
@ -96,5 +98,5 @@ add_task(function* test_populateFieldValues_with_invalid_guid() {
|
|||
});
|
||||
}, /No matching profile\./);
|
||||
|
||||
FormAutofillParent._uninit();
|
||||
formAutofillParent._uninit();
|
||||
});
|
||||
|
|
|
@ -5,6 +5,7 @@ support-files =
|
|||
|
||||
[test_autofillFormFields.js]
|
||||
[test_collectFormFields.js]
|
||||
[test_enabledStatus.js]
|
||||
[test_getFormInputDetails.js]
|
||||
[test_markAsAutofillField.js]
|
||||
[test_populateFieldValues.js]
|
||||
|
|
|
@ -97,6 +97,9 @@ libs-%:
|
|||
@$(MAKE) -C ../../toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
|
||||
@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
|
||||
@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
|
||||
ifndef RELEASE_OR_BETA
|
||||
@$(MAKE) -C ../extensions/formautofill/locale AB_CD=$* XPI_NAME=locale-$*
|
||||
endif
|
||||
@$(MAKE) -C ../extensions/pocket/locale AB_CD=$* XPI_NAME=locale-$*
|
||||
ifndef RELEASE_OR_BETA
|
||||
@$(MAKE) -C ../extensions/presentation/locale AB_CD=$* XPI_NAME=locale-$*
|
||||
|
|
|
@ -104,12 +104,14 @@ DevToolsStartup.prototype = {
|
|||
return Services.prefs.getBoolPref(pref);
|
||||
});
|
||||
} catch (ex) {
|
||||
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
console.error(ex);
|
||||
return false;
|
||||
}
|
||||
if (!remoteDebuggingEnabled) {
|
||||
let errorMsg = "Could not run chrome debugger! You need the following " +
|
||||
"prefs to be set to true: " + kDebuggerPrefs.join(", ");
|
||||
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
console.error(new Error(errorMsg));
|
||||
// Dump as well, as we're doing this from a commandline, make sure people
|
||||
// don't miss it:
|
||||
|
|
|
@ -34,6 +34,8 @@ const {CommandUtils} = require("devtools/client/shared/developer-toolbar");
|
|||
const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
|
||||
const clipboardHelper = require("devtools/shared/platform/clipboard");
|
||||
|
||||
const Store = require("devtools/client/inspector/store");
|
||||
|
||||
const {LocalizationHelper, localizeMarkup} = require("devtools/shared/l10n");
|
||||
const INSPECTOR_L10N =
|
||||
new LocalizationHelper("devtools/client/locales/inspector.properties");
|
||||
|
@ -92,6 +94,7 @@ function Inspector(toolbox) {
|
|||
this.panelWin.inspector = this;
|
||||
|
||||
this.highlighters = new HighlightersOverlay(this);
|
||||
this.store = Store();
|
||||
this.telemetry = new Telemetry();
|
||||
|
||||
this.nodeMenuTriggerInfo = null;
|
||||
|
@ -910,7 +913,6 @@ Inspector.prototype = {
|
|||
this.cancelUpdate();
|
||||
|
||||
this.target.off("will-navigate", this._onBeforeNavigate);
|
||||
|
||||
this.target.off("thread-paused", this.updateDebuggerPausedWarning);
|
||||
this.target.off("thread-resumed", this.updateDebuggerPausedWarning);
|
||||
this._toolbox.off("select", this.updateDebuggerPausedWarning);
|
||||
|
@ -942,8 +944,6 @@ Inspector.prototype = {
|
|||
|
||||
this.teardownSplitter();
|
||||
|
||||
this.sidebar = null;
|
||||
|
||||
this.teardownToolbar();
|
||||
this.breadcrumbs.destroy();
|
||||
this.selection.off("new-node-front", this.onNewSelection);
|
||||
|
@ -951,12 +951,14 @@ Inspector.prototype = {
|
|||
|
||||
let markupDestroyer = this._destroyMarkup();
|
||||
|
||||
this.panelWin.inspector = null;
|
||||
this.target = null;
|
||||
this.panelDoc = null;
|
||||
this.panelWin = null;
|
||||
this.breadcrumbs = null;
|
||||
this._toolbox = null;
|
||||
this.breadcrumbs = null;
|
||||
this.panelDoc = null;
|
||||
this.panelWin.inspector = null;
|
||||
this.panelWin = null;
|
||||
this.sidebar = null;
|
||||
this.store = null;
|
||||
this.target = null;
|
||||
|
||||
this.highlighters.destroy();
|
||||
this.highlighters = null;
|
||||
|
|
|
@ -26,7 +26,6 @@ const {
|
|||
} = require("./actions/highlighter-settings");
|
||||
|
||||
const App = createFactory(require("./components/App"));
|
||||
const Store = require("./store");
|
||||
|
||||
const EditingSession = require("./utils/editing-session");
|
||||
|
||||
|
@ -42,7 +41,7 @@ function LayoutView(inspector, window) {
|
|||
this.document = window.document;
|
||||
this.highlighters = inspector.highlighters;
|
||||
this.inspector = inspector;
|
||||
this.store = null;
|
||||
this.store = inspector.store;
|
||||
this.walker = this.inspector.walker;
|
||||
|
||||
this.updateBoxModel = this.updateBoxModel.bind(this);
|
||||
|
@ -72,7 +71,6 @@ LayoutView.prototype = {
|
|||
}
|
||||
|
||||
this.layoutInspector = yield this.inspector.walker.getLayoutInspector();
|
||||
let store = this.store = Store();
|
||||
|
||||
this.loadHighlighterSettings();
|
||||
|
||||
|
@ -232,7 +230,7 @@ LayoutView.prototype = {
|
|||
});
|
||||
|
||||
let provider = createElement(Provider, {
|
||||
store,
|
||||
store: this.store,
|
||||
id: "layoutview",
|
||||
title: INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2"),
|
||||
key: "layoutview",
|
||||
|
|
|
@ -13,6 +13,5 @@ DIRS += [
|
|||
|
||||
DevToolsModules(
|
||||
'layout.js',
|
||||
'store.js',
|
||||
'types.js',
|
||||
)
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
exports.boxModel = require("./box-model");
|
||||
exports.grids = require("./grids");
|
||||
exports.highlighterSettings = require("./highlighter-settings");
|
|
@ -8,5 +8,4 @@ DevToolsModules(
|
|||
'box-model.js',
|
||||
'grids.js',
|
||||
'highlighter-settings.js',
|
||||
'index.js',
|
||||
)
|
||||
|
|
|
@ -17,10 +17,12 @@ DevToolsModules(
|
|||
'inspector-commands.js',
|
||||
'inspector-search.js',
|
||||
'panel.js',
|
||||
'reducers.js',
|
||||
'store.js',
|
||||
'toolsidebar.js',
|
||||
)
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
|
||||
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Firefox', 'Developer Tools: Inspector')
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
// This file exposes the Redux reducers of the box model, grid and grid highlighter
|
||||
// settings.
|
||||
|
||||
exports.boxModel = require("devtools/client/inspector/layout/reducers/box-model");
|
||||
exports.grids = require("devtools/client/inspector/layout/reducers/grids");
|
||||
exports.highlighterSettings = require("devtools/client/inspector/layout/reducers/highlighter-settings");
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const { combineReducers } = require("devtools/client/shared/vendor/redux");
|
||||
const createStore = require("devtools/client/shared/redux/create-store");
|
||||
const reducers = require("./reducers/index");
|
||||
const reducers = require("devtools/client/inspector/reducers");
|
||||
const flags = require("devtools/shared/flags");
|
||||
|
||||
module.exports = function () {
|
|
@ -39,7 +39,7 @@ PendingGlobalHistoryEntry::ApplyChanges(IHistory* aHistory)
|
|||
mVisits.Clear();
|
||||
|
||||
for (const URITitle& title : mTitles) {
|
||||
aHistory->SetURITitle(title.mURI, title.mTitle);
|
||||
rv = aHistory->SetURITitle(title.mURI, title.mTitle);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
mTitles.Clear();
|
||||
|
|
|
@ -1655,7 +1655,7 @@ nsMessageManagerScriptExecutor::InitChildGlobalInternal(
|
|||
const uint32_t flags = nsIXPConnect::INIT_JS_STANDARD_CLASSES;
|
||||
|
||||
JS::CompartmentOptions options;
|
||||
options.creationOptions().setZone(JS::SystemZone);
|
||||
options.creationOptions().setSystemZone();
|
||||
options.behaviors().setVersion(JSVERSION_LATEST);
|
||||
|
||||
if (xpc::SharedMemoryEnabled()) {
|
||||
|
|
|
@ -2736,7 +2736,7 @@ CreateNativeGlobalForInner(JSContext* aCx,
|
|||
}
|
||||
|
||||
if (top && top->GetGlobalJSObject()) {
|
||||
options.creationOptions().setSameZoneAs(top->GetGlobalJSObject());
|
||||
options.creationOptions().setExistingZone(top->GetGlobalJSObject());
|
||||
}
|
||||
|
||||
options.creationOptions().setSecureContext(aIsSecureContext);
|
||||
|
|
|
@ -111,7 +111,8 @@ const size_t gStackSize = 8192;
|
|||
// Maximum amount of time that should elapse between incremental GC slices
|
||||
#define NS_INTERSLICE_GC_DELAY 100 // ms
|
||||
|
||||
// If we haven't painted in 100ms, we allow for a longer GC budget
|
||||
// If we haven't painted in 100ms, or we're in e10s parent process and
|
||||
// user isn't active, we allow for a longer GC budget.
|
||||
#define NS_INTERSLICE_GC_BUDGET 40 // ms
|
||||
|
||||
// The amount of time we wait between a request to CC (after GC ran)
|
||||
|
@ -188,7 +189,8 @@ static bool sNeedsFullGC = false;
|
|||
static bool sNeedsGCAfterCC = false;
|
||||
static bool sIncrementalCC = false;
|
||||
static bool sDidPaintAfterPreviousICCSlice = false;
|
||||
|
||||
static bool sUserActive = false;
|
||||
static int32_t sActiveIntersliceGCBudget = 0; // ms;
|
||||
static nsScriptNameSpaceManager *gNameSpaceManager;
|
||||
|
||||
static PRTime sFirstCollectionTime;
|
||||
|
@ -348,10 +350,12 @@ nsJSEnvironmentObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
}
|
||||
}
|
||||
} else if (!nsCRT::strcmp(aTopic, "user-interaction-inactive")) {
|
||||
sUserActive = false;
|
||||
if (sCompactOnUserInactive) {
|
||||
nsJSContext::PokeShrinkingGC();
|
||||
}
|
||||
} else if (!nsCRT::strcmp(aTopic, "user-interaction-active")) {
|
||||
sUserActive = true;
|
||||
nsJSContext::KillShrinkingGCTimer();
|
||||
if (sIsCompactingOnUserInactive) {
|
||||
JS::AbortIncrementalGC(sContext);
|
||||
|
@ -1726,10 +1730,13 @@ void
|
|||
InterSliceGCTimerFired(nsITimer *aTimer, void *aClosure)
|
||||
{
|
||||
nsJSContext::KillInterSliceGCTimer();
|
||||
bool e10sParent = XRE_IsParentProcess() && BrowserTabsRemoteAutostart();
|
||||
int64_t budget = e10sParent && sUserActive && sActiveIntersliceGCBudget ?
|
||||
sActiveIntersliceGCBudget : NS_INTERSLICE_GC_BUDGET;
|
||||
nsJSContext::GarbageCollectNow(JS::gcreason::INTER_SLICE_GC,
|
||||
nsJSContext::IncrementalGC,
|
||||
nsJSContext::NonShrinkingGC,
|
||||
NS_INTERSLICE_GC_BUDGET);
|
||||
budget);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -2320,6 +2327,7 @@ SetMemoryGCSliceTimePrefChangedCallback(const char* aPrefName, void* aClosure)
|
|||
int32_t pref = Preferences::GetInt(aPrefName, -1);
|
||||
// handle overflow and negative pref values
|
||||
if (pref > 0 && pref < 100000)
|
||||
sActiveIntersliceGCBudget = pref;
|
||||
JS_SetGCParameter(sContext, JSGC_SLICE_TIME_BUDGET, pref);
|
||||
}
|
||||
|
||||
|
|
|
@ -2389,7 +2389,7 @@ class MethodDefiner(PropertyDefiner):
|
|||
"methodInfo": False,
|
||||
"selfHostedName": "ArrayValues",
|
||||
"length": 0,
|
||||
"flags": "JSPROP_ENUMERATE",
|
||||
"flags": "0", # Not enumerable, per spec.
|
||||
"condition": MemberCondition()
|
||||
})
|
||||
|
||||
|
@ -3073,25 +3073,28 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
|||
symbolJSID=symbolJSID))
|
||||
defineFn = "JS_DefinePropertyById"
|
||||
prop = "iteratorId"
|
||||
enumFlags = "0" # Not enumerable, per spec.
|
||||
elif alias.startswith("@@"):
|
||||
raise TypeError("Can't handle any well-known Symbol other than @@iterator")
|
||||
else:
|
||||
getSymbolJSID = None
|
||||
defineFn = "JS_DefineProperty"
|
||||
prop = '"%s"' % alias
|
||||
return CGList([
|
||||
getSymbolJSID,
|
||||
# XXX If we ever create non-enumerable properties that can
|
||||
# be aliased, we should consider making the aliases
|
||||
# match the enumerability of the property being aliased.
|
||||
enumFlags = "JSPROP_ENUMERATE"
|
||||
return CGList([
|
||||
getSymbolJSID,
|
||||
CGGeneric(fill(
|
||||
"""
|
||||
if (!${defineFn}(aCx, proto, ${prop}, aliasedVal, JSPROP_ENUMERATE)) {
|
||||
if (!${defineFn}(aCx, proto, ${prop}, aliasedVal, ${enumFlags})) {
|
||||
$*{failureCode}
|
||||
}
|
||||
""",
|
||||
defineFn=defineFn,
|
||||
prop=prop,
|
||||
enumFlags=enumFlags,
|
||||
failureCode=failureCode))
|
||||
], "\n")
|
||||
|
||||
|
|
|
@ -186,6 +186,17 @@ public:
|
|||
nsresult StealNSResult() {
|
||||
nsresult rv = ErrorCode();
|
||||
SuppressException();
|
||||
// Don't propagate out our internal error codes that have special meaning.
|
||||
if (rv == NS_ERROR_TYPE_ERR ||
|
||||
rv == NS_ERROR_RANGE_ERR ||
|
||||
rv == NS_ERROR_DOM_JS_EXCEPTION ||
|
||||
rv == NS_ERROR_DOM_DOMEXCEPTION) {
|
||||
// What about NS_ERROR_DOM_EXCEPTION_ON_JSCONTEXT? I guess that can be
|
||||
// legitimately passed on through....
|
||||
// What to pick here?
|
||||
return NS_ERROR_DOM_INVALID_STATE_ERR;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -395,7 +406,15 @@ private:
|
|||
MOZ_ASSERT(aRv != NS_ERROR_XPC_NOT_ENOUGH_ARGS, "May need to bring back ThrowNotEnoughArgsError");
|
||||
MOZ_ASSERT(aRv != NS_ERROR_DOM_EXCEPTION_ON_JSCONTEXT,
|
||||
"Use NoteJSContextException");
|
||||
mResult = aRv;
|
||||
// Don't trust people anyway, though.
|
||||
if (aRv == NS_ERROR_TYPE_ERR ||
|
||||
aRv == NS_ERROR_RANGE_ERR ||
|
||||
aRv == NS_ERROR_DOM_JS_EXCEPTION ||
|
||||
aRv == NS_ERROR_DOM_DOMEXCEPTION) {
|
||||
mResult = NS_ERROR_UNEXPECTED;
|
||||
} else {
|
||||
mResult = aRv;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearMessage();
|
||||
|
|
|
@ -110,7 +110,7 @@ SimpleGlobalObject::Create(GlobalType globalType, JS::Handle<JS::Value> proto)
|
|||
// lots of zones for what are probably very short-lived
|
||||
// compartments. This should help them be GCed quicker and take up
|
||||
// less memory before they're GCed.
|
||||
.setZone(JS::SystemZone);
|
||||
.setSystemZone();
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
nsCOMPtr<nsIPrincipal> principal = nsNullPrincipal::Create();
|
||||
|
|
|
@ -314,15 +314,16 @@ TexUnpackBlob::ConvertIfNeeded(WebGLContext* webgl, const char* funcName,
|
|||
const auto dstOrigin = gl::OriginPos::BottomLeft;
|
||||
|
||||
if (srcFormat != dstFormat) {
|
||||
webgl->GenerateWarning("%s: Conversion requires pixel reformatting.", funcName);
|
||||
webgl->GeneratePerfWarning("%s: Conversion requires pixel reformatting.",
|
||||
funcName);
|
||||
} else if (mSrcIsPremult != dstIsPremult) {
|
||||
webgl->GenerateWarning("%s: Conversion requires change in"
|
||||
"alpha-premultiplication.",
|
||||
funcName);
|
||||
webgl->GeneratePerfWarning("%s: Conversion requires change in"
|
||||
"alpha-premultiplication.",
|
||||
funcName);
|
||||
} else if (srcOrigin != dstOrigin) {
|
||||
webgl->GenerateWarning("%s: Conversion requires y-flip.", funcName);
|
||||
webgl->GeneratePerfWarning("%s: Conversion requires y-flip.", funcName);
|
||||
} else if (srcStride != dstStride) {
|
||||
webgl->GenerateWarning("%s: Conversion requires change in stride.", funcName);
|
||||
webgl->GeneratePerfWarning("%s: Conversion requires change in stride.", funcName);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
@ -642,9 +643,9 @@ TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* fun
|
|||
return true;
|
||||
} while (false);
|
||||
|
||||
webgl->GenerateWarning("%s: Failed to hit GPU-copy fast-path. Falling back to CPU"
|
||||
" upload.",
|
||||
funcName);
|
||||
webgl->GeneratePerfWarning("%s: Failed to hit GPU-copy fast-path. Falling back to CPU"
|
||||
" upload.",
|
||||
funcName);
|
||||
|
||||
const RefPtr<gfx::SourceSurface> surf = mImage->GetAsSourceSurface();
|
||||
|
||||
|
|
|
@ -681,9 +681,7 @@ function setDisabled(list, state) {
|
|||
var gen;
|
||||
function onFilesSet() {
|
||||
gen = runTest();
|
||||
addLoadEvent(function() {
|
||||
gen.next();
|
||||
});
|
||||
gen.next();
|
||||
}
|
||||
|
||||
function* runTest() {
|
||||
|
|
|
@ -44,7 +44,7 @@ function clearAllDatabases(callback) {
|
|||
var testHarnessGenerator = testHarnessSteps();
|
||||
testHarnessGenerator.next();
|
||||
|
||||
function testHarnessSteps() {
|
||||
function* testHarnessSteps() {
|
||||
function nextTestHarnessStep(val) {
|
||||
testHarnessGenerator.next(val);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const url = "ftp://ftp.example.com";
|
||||
const name = "test_bad_origin_directory.js";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const dbName1 = "upgrade_test";
|
||||
const dbName2 = "testing.foobar";
|
||||
|
|
|
@ -7,7 +7,7 @@ var disableWorkerTest = "Need a way to set temporary prefs from a worker";
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const spec = "http://foo.com";
|
||||
const name =
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const Bob = { ss: "237-23-7732", name: "Bob" };
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = this.window ? window.location.pathname :
|
||||
"test_database_close_without_onclose.js";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/default/http+++localhost
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = "test_file_copy_failure.js";
|
||||
const objectStoreName = "Blobs";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
// Test for IDBKeyRange and indexedDB availability in ipcshell.
|
||||
run_test_in_child("./GlobalObjectsChild.js", function() {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
let ioService =
|
||||
Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = "Splendid Test";
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/default/http+++www.mozilla.org
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
let uri = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService).
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const databaseName =
|
||||
("window" in this) ? window.location.pathname : "Test";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/permanent/chrome
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/permanent/chrome
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const dbNames = [
|
||||
"No files",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
// This lives in storage/default/http+++www.mozilla.org
|
||||
const url = "http://www.mozilla.org";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = this.window ? window.location.pathname : "Splendid Test";
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = "Splendid Test";
|
||||
const version = 1;
|
||||
|
|
|
@ -7,7 +7,7 @@ var disableWorkerTest = "Need a way to set temporary prefs from a worker";
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const spec = "http://foo.com";
|
||||
const name =
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const testName = "schema18upgrade";
|
||||
const testKeys = [
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const testName = "schema21upgrade";
|
||||
const testKeys = [
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/default/http+++www.mozilla.org
|
||||
|
|
|
@ -20,8 +20,12 @@ function* testSteps()
|
|||
try {
|
||||
request.result;
|
||||
ok(false, "Getter should have thrown!");
|
||||
} catch (e if e.result == 0x8053000b /* NS_ERROR_DOM_INVALID_STATE_ERR */) {
|
||||
ok(true, "Getter threw the right exception");
|
||||
} catch (e) {
|
||||
if (e.result == 0x8053000b /* NS_ERROR_DOM_INVALID_STATE_ERR */) {
|
||||
ok(true, "Getter threw the right exception");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
request.onerror = errorHandler;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = "test_snappyUpgrade.js";
|
||||
const objectStoreName = "test";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const openParams = [
|
||||
// This one lives in storage/default/http+++www.mozilla.org
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = this.window ?
|
||||
window.location.pathname :
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = "test_wasm_recompile.js";
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ if (!this.window) {
|
|||
|
||||
var testGenerator = testSteps();
|
||||
|
||||
function testSteps()
|
||||
function* testSteps()
|
||||
{
|
||||
const name = this.window ? window.location.pathname : "Splendid Test";
|
||||
|
||||
|
|
|
@ -1343,7 +1343,7 @@ ContentParent::ShutDownMessageManager()
|
|||
}
|
||||
|
||||
void
|
||||
ContentParent::MarkAsDead()
|
||||
ContentParent::MarkAsTroubled()
|
||||
{
|
||||
if (sBrowserContentParents) {
|
||||
nsTArray<ContentParent*>* contentParents =
|
||||
|
@ -1367,7 +1367,13 @@ ContentParent::MarkAsDead()
|
|||
sPrivateContent = nullptr;
|
||||
}
|
||||
}
|
||||
mIsAvailable = false;
|
||||
}
|
||||
|
||||
void
|
||||
ContentParent::MarkAsDead()
|
||||
{
|
||||
MarkAsTroubled();
|
||||
mIsAlive = false;
|
||||
}
|
||||
|
||||
|
@ -1667,8 +1673,8 @@ ContentParent::ShouldKeepProcessAlive() const
|
|||
return false;
|
||||
}
|
||||
|
||||
// If we have already been marked as dead, don't prevent shutdown.
|
||||
if (!IsAlive()) {
|
||||
// If we have already been marked as troubled/dead, don't prevent shutdown.
|
||||
if (!IsAvailable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1812,6 +1818,7 @@ ContentParent::InitializeMembers()
|
|||
mChildID = gContentChildID++;
|
||||
mGeolocationWatchID = -1;
|
||||
mNumDestroyingTabs = 0;
|
||||
mIsAvailable = true;
|
||||
mIsAlive = true;
|
||||
mSendPermissionUpdates = false;
|
||||
mCalledClose = false;
|
||||
|
@ -4705,9 +4712,14 @@ ContentParent::RecvNotifyPushSubscriptionModifiedObservers(const nsCString& aSco
|
|||
mozilla::ipc::IPCResult
|
||||
ContentParent::RecvNotifyLowMemory()
|
||||
{
|
||||
MarkAsTroubled();
|
||||
|
||||
Telemetry::ScalarAdd(Telemetry::ScalarID::DOM_CONTENTPROCESS_TROUBLED_DUE_TO_MEMORY, 1);
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
nsThread::SaveMemoryReportNearOOM(nsThread::ShouldSaveMemoryReport::kForceReport);
|
||||
#endif
|
||||
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
|
|
|
@ -354,6 +354,10 @@ public:
|
|||
|
||||
bool RequestRunToCompletion();
|
||||
|
||||
bool IsAvailable() const
|
||||
{
|
||||
return mIsAvailable;
|
||||
}
|
||||
bool IsAlive() const override;
|
||||
|
||||
virtual bool IsForBrowser() const override
|
||||
|
@ -615,6 +619,14 @@ protected:
|
|||
void OnCompositorUnexpectedShutdown() override;
|
||||
|
||||
private:
|
||||
/**
|
||||
* A map of the remote content process type to a list of content parents
|
||||
* currently available to host *new* tabs/frames of that type.
|
||||
*
|
||||
* If a content process is identified as troubled or dead, it will be
|
||||
* removed from this list, but will still be in the sContentParents list for
|
||||
* the GetAll/GetAllEvenIfDead APIs.
|
||||
*/
|
||||
static nsClassHashtable<nsStringHashKey, nsTArray<ContentParent*>>* sBrowserContentParents;
|
||||
static nsTArray<ContentParent*>* sPrivateContent;
|
||||
static StaticAutoPtr<LinkedList<ContentParent> > sContentParents;
|
||||
|
@ -694,6 +706,12 @@ private:
|
|||
*/
|
||||
bool ShouldKeepProcessAlive() const;
|
||||
|
||||
/**
|
||||
* Mark this ContentParent as "troubled". This means that it is still alive,
|
||||
* but it won't be returned for new tabs in GetNewOrUsedBrowserProcess.
|
||||
*/
|
||||
void MarkAsTroubled();
|
||||
|
||||
/**
|
||||
* Mark this ContentParent as dead for the purposes of Get*().
|
||||
* This method is idempotent.
|
||||
|
@ -1138,10 +1156,12 @@ private:
|
|||
// sequence. Precisely, how many TabParents have called
|
||||
// NotifyTabDestroying() but not called NotifyTabDestroyed().
|
||||
int32_t mNumDestroyingTabs;
|
||||
// True only while this is ready to be used to host remote tabs.
|
||||
// This must not be used for new purposes after mIsAlive goes to
|
||||
// false, but some previously scheduled IPC traffic may still pass
|
||||
// through.
|
||||
// True only while this process is in "good health" and may be used for
|
||||
// new remote tabs.
|
||||
bool mIsAvailable;
|
||||
// True only while remote content is being actively used from this process.
|
||||
// After mIsAlive goes to false, some previously scheduled IPC traffic may
|
||||
// still pass through.
|
||||
bool mIsAlive;
|
||||
|
||||
bool mSendPermissionUpdates;
|
||||
|
|
|
@ -1075,10 +1075,10 @@ public:
|
|||
mWorkerPrivate = nullptr;
|
||||
}
|
||||
|
||||
nsresult Initialize(JSContext* aParentContext)
|
||||
nsresult Initialize(JSRuntime* aParentRuntime)
|
||||
{
|
||||
nsresult rv =
|
||||
CycleCollectedJSContext::Initialize(aParentContext,
|
||||
CycleCollectedJSContext::Initialize(aParentRuntime,
|
||||
WORKER_DEFAULT_RUNTIME_HEAPSIZE,
|
||||
WORKER_DEFAULT_NURSERY_SIZE);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
@ -1187,7 +1187,7 @@ class WorkerThreadPrimaryRunnable final : public Runnable
|
|||
{
|
||||
WorkerPrivate* mWorkerPrivate;
|
||||
RefPtr<WorkerThread> mThread;
|
||||
JSContext* mParentContext;
|
||||
JSRuntime* mParentRuntime;
|
||||
|
||||
class FinishedRunnable final : public Runnable
|
||||
{
|
||||
|
@ -1213,8 +1213,8 @@ class WorkerThreadPrimaryRunnable final : public Runnable
|
|||
public:
|
||||
WorkerThreadPrimaryRunnable(WorkerPrivate* aWorkerPrivate,
|
||||
WorkerThread* aThread,
|
||||
JSContext* aParentContext)
|
||||
: mWorkerPrivate(aWorkerPrivate), mThread(aThread), mParentContext(aParentContext)
|
||||
JSRuntime* aParentRuntime)
|
||||
: mWorkerPrivate(aWorkerPrivate), mThread(aThread), mParentRuntime(aParentRuntime)
|
||||
{
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
MOZ_ASSERT(aThread);
|
||||
|
@ -1893,7 +1893,7 @@ RuntimeService::ScheduleWorker(WorkerPrivate* aWorkerPrivate)
|
|||
JSContext* cx = CycleCollectedJSContext::Get()->Context();
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
new WorkerThreadPrimaryRunnable(aWorkerPrivate, thread,
|
||||
JS_GetParentContext(cx));
|
||||
JS_GetParentRuntime(cx));
|
||||
if (NS_FAILED(thread->DispatchPrimaryRunnable(friendKey, runnable.forget()))) {
|
||||
UnregisterWorker(aWorkerPrivate);
|
||||
return false;
|
||||
|
@ -2861,7 +2861,7 @@ WorkerThreadPrimaryRunnable::Run()
|
|||
nsCycleCollector_startup();
|
||||
|
||||
WorkerJSContext context(mWorkerPrivate);
|
||||
nsresult rv = context.Initialize(mParentContext);
|
||||
nsresult rv = context.Initialize(mParentRuntime);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -42,8 +42,7 @@ function do_run_generator(generator)
|
|||
try {
|
||||
generator.next();
|
||||
} catch (e) {
|
||||
if (e != StopIteration)
|
||||
do_throw("caught exception " + e, Components.stack.caller);
|
||||
do_throw("caught exception " + e, Components.stack.caller);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +50,7 @@ function do_run_generator(generator)
|
|||
function do_finish_generator_test(generator)
|
||||
{
|
||||
do_execute_soon(function() {
|
||||
generator.close();
|
||||
generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
this.profile = do_get_profile();
|
||||
|
||||
|
@ -118,7 +118,7 @@ function do_corrupt_db(file)
|
|||
return size;
|
||||
}
|
||||
|
||||
function run_test_1(generator)
|
||||
function* run_test_1(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
let uri = NetUtil.newURI("http://foo.com/");
|
||||
|
@ -207,7 +207,7 @@ function run_test_1(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_2(generator)
|
||||
function* run_test_2(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
do_load_profile();
|
||||
|
@ -273,7 +273,7 @@ function run_test_2(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_3(generator)
|
||||
function* run_test_3(generator)
|
||||
{
|
||||
// Set the maximum cookies per base domain limit to a large value, so that
|
||||
// corrupting the database is easier.
|
||||
|
@ -368,7 +368,7 @@ function run_test_3(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_4(generator)
|
||||
function* run_test_4(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
do_load_profile();
|
||||
|
@ -436,7 +436,7 @@ function run_test_4(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_4(generator)
|
||||
function* run_test_4(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
do_load_profile();
|
||||
|
@ -508,7 +508,7 @@ function run_test_4(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_5(generator)
|
||||
function* run_test_5(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
do_load_profile();
|
||||
|
|
|
@ -14,12 +14,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ function make_channel(url) {
|
|||
.QueryInterface(Ci.nsIHttpChannel);
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -14,12 +14,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
this.profile = do_get_profile();
|
||||
|
||||
|
@ -136,7 +136,7 @@ function check_garbage_file(file)
|
|||
do_check_false(file.exists());
|
||||
}
|
||||
|
||||
function run_test_1(generator)
|
||||
function* run_test_1(generator)
|
||||
{
|
||||
// Create a garbage database file.
|
||||
create_garbage_file(cookieFile);
|
||||
|
@ -165,7 +165,7 @@ function run_test_1(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_2(generator)
|
||||
function* run_test_2(generator)
|
||||
{
|
||||
// Load the profile and populate it.
|
||||
do_load_profile();
|
||||
|
@ -196,7 +196,7 @@ function run_test_2(generator)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_3(generator, schema)
|
||||
function* run_test_3(generator, schema)
|
||||
{
|
||||
// Manually create a schema 2 database, populate it, and set the schema
|
||||
// version to the desired number.
|
||||
|
@ -224,7 +224,7 @@ function run_test_3(generator, schema)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_4_exists(generator, schema, stmt)
|
||||
function* run_test_4_exists(generator, schema, stmt)
|
||||
{
|
||||
// Manually create a database, populate it, and add the desired column.
|
||||
let db = new CookieDatabaseConnection(do_get_cookie_file(profile), schema);
|
||||
|
@ -254,7 +254,7 @@ function run_test_4_exists(generator, schema, stmt)
|
|||
do_run_generator(generator);
|
||||
}
|
||||
|
||||
function run_test_4_baseDomain(generator)
|
||||
function* run_test_4_baseDomain(generator)
|
||||
{
|
||||
// Manually create a database and populate it with a bad host.
|
||||
let db = new CookieDatabaseConnection(do_get_cookie_file(profile), 2);
|
||||
|
|
|
@ -14,12 +14,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function continue_test()
|
|||
do_run_generator(test_generator);
|
||||
}
|
||||
|
||||
function do_run_test()
|
||||
function* do_run_test()
|
||||
{
|
||||
// Set the base domain limit to 50 so we have a known value.
|
||||
Services.prefs.setIntPref("network.cookie.maxPerHost", 50);
|
||||
|
|
|
@ -26,7 +26,7 @@ function repeat_test()
|
|||
gShortExpiry *= 2;
|
||||
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
test_generator = do_run_test();
|
||||
do_run_generator(test_generator);
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ function get_expiry_delay()
|
|||
return gShortExpiry * 1000 + 100;
|
||||
}
|
||||
|
||||
function do_run_test()
|
||||
function* do_run_test()
|
||||
{
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
|
|
@ -15,7 +15,7 @@ function continue_test()
|
|||
do_run_generator(test_generator);
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function run_test() {
|
|||
run_next_test();
|
||||
}
|
||||
|
||||
add_task(function test() {
|
||||
add_task(function* test() {
|
||||
/* Create and set up the permissions database */
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function run_test() {
|
|||
run_next_test();
|
||||
}
|
||||
|
||||
add_task(function test() {
|
||||
add_task(function* test() {
|
||||
/* Create and set up the permissions database */
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function run_test() {
|
|||
run_next_test();
|
||||
}
|
||||
|
||||
add_task(function test() {
|
||||
add_task(function* test() {
|
||||
/* Create and set up the permissions database */
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function run_test() {
|
|||
run_next_test();
|
||||
}
|
||||
|
||||
add_task(function test() {
|
||||
add_task(function* test() {
|
||||
/* Create and set up the permissions database */
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ function continue_test()
|
|||
do_run_generator(test_generator);
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ function continue_test()
|
|||
do_run_generator(test_generator);
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -13,12 +13,12 @@ function run_test() {
|
|||
|
||||
function finish_test() {
|
||||
do_execute_soon(function() {
|
||||
test_generator.close();
|
||||
test_generator.return();
|
||||
do_test_finished();
|
||||
});
|
||||
}
|
||||
|
||||
function do_run_test() {
|
||||
function* do_run_test() {
|
||||
// Set up a profile.
|
||||
let profile = do_get_profile();
|
||||
|
||||
|
|
|
@ -451,7 +451,7 @@ XPCShellEnvironment::Init()
|
|||
}
|
||||
|
||||
JS::CompartmentOptions options;
|
||||
options.creationOptions().setZone(JS::SystemZone);
|
||||
options.creationOptions().setSystemZone();
|
||||
options.behaviors().setVersion(JSVERSION_LATEST);
|
||||
if (xpc::SharedMemoryEnabled())
|
||||
options.creationOptions().setSharedMemoryAndAtomicsEnabled(true);
|
||||
|
|
|
@ -145,8 +145,11 @@ add_old_configure_assignment('MOZ_PROFILING', profiling)
|
|||
|
||||
@depends(profiling, target)
|
||||
def imply_vtune(value, target):
|
||||
if value and (target.kernel == 'WINNT' or (target.kernel == 'Linux' and
|
||||
target.os == 'GNU')):
|
||||
ok_cpu = target.cpu in ['x86', 'x86_64']
|
||||
ok_kernel = target.kernel == 'WINNT' or \
|
||||
(target.kernel == 'Linux' and target.os == 'GNU')
|
||||
|
||||
if value and ok_cpu and ok_kernel:
|
||||
return True
|
||||
|
||||
set_config('MOZ_PROFILING', profiling)
|
||||
|
@ -154,7 +157,7 @@ set_define('MOZ_PROFILING', profiling)
|
|||
imply_option('--enable-vtune', imply_vtune, reason='--enable-profiling')
|
||||
|
||||
|
||||
js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable vtune profiling')
|
||||
js_option('--enable-vtune', env='MOZ_VTUNE', help='Enable VTune profiling')
|
||||
|
||||
@depends('--enable-vtune')
|
||||
def vtune(value):
|
||||
|
|
|
@ -697,7 +697,7 @@ ExposeScriptToActiveJS(JSScript* script)
|
|||
static MOZ_ALWAYS_INLINE void
|
||||
MarkStringAsLive(Zone* zone, JSString* string)
|
||||
{
|
||||
JSRuntime* rt = JS::shadow::Zone::asShadowZone(zone)->runtimeFromMainThread();
|
||||
JSRuntime* rt = JS::shadow::Zone::asShadowZone(zone)->runtimeFromActiveCooperatingThread();
|
||||
js::gc::MarkGCThingAsLive(rt, GCCellPtr(string));
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ struct Zone
|
|||
return barrierTracer_;
|
||||
}
|
||||
|
||||
JSRuntime* runtimeFromMainThread() const {
|
||||
JSRuntime* runtimeFromActiveCooperatingThread() const {
|
||||
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
|
||||
return runtime_;
|
||||
}
|
||||
|
|
|
@ -55,11 +55,11 @@ namespace oom {
|
|||
* To make testing OOM in certain helper threads more effective,
|
||||
* allow restricting the OOM testing to a certain helper thread
|
||||
* type. This allows us to fail e.g. in off-thread script parsing
|
||||
* without causing an OOM in the main thread first.
|
||||
* without causing an OOM in the active thread first.
|
||||
*/
|
||||
enum ThreadType {
|
||||
THREAD_TYPE_NONE = 0, // 0
|
||||
THREAD_TYPE_MAIN, // 1
|
||||
THREAD_TYPE_COOPERATING, // 1
|
||||
THREAD_TYPE_WASM, // 2
|
||||
THREAD_TYPE_ION, // 3
|
||||
THREAD_TYPE_PARSE, // 4
|
||||
|
|
|
@ -1045,7 +1045,7 @@ js::intl_Collator(JSContext* cx, unsigned argc, Value* vp)
|
|||
void
|
||||
CollatorObject::finalize(FreeOp* fop, JSObject* obj)
|
||||
{
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(fop->onActiveCooperatingThread());
|
||||
|
||||
const Value& slot = obj->as<CollatorObject>().getReservedSlot(CollatorObject::UCOLLATOR_SLOT);
|
||||
if (UCollator* coll = static_cast<UCollator*>(slot.toPrivate()))
|
||||
|
@ -1478,7 +1478,7 @@ js::intl_NumberFormat(JSContext* cx, unsigned argc, Value* vp)
|
|||
void
|
||||
NumberFormatObject::finalize(FreeOp* fop, JSObject* obj)
|
||||
{
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(fop->onActiveCooperatingThread());
|
||||
|
||||
const Value& slot =
|
||||
obj->as<NumberFormatObject>().getReservedSlot(NumberFormatObject::UNUMBER_FORMAT_SLOT);
|
||||
|
@ -2417,7 +2417,7 @@ js::intl_DateTimeFormat(JSContext* cx, unsigned argc, Value* vp)
|
|||
void
|
||||
DateTimeFormatObject::finalize(FreeOp* fop, JSObject* obj)
|
||||
{
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(fop->onActiveCooperatingThread());
|
||||
|
||||
const Value& slot =
|
||||
obj->as<DateTimeFormatObject>().getReservedSlot(DateTimeFormatObject::UDATE_FORMAT_SLOT);
|
||||
|
@ -3458,7 +3458,7 @@ PluralRules(JSContext* cx, unsigned argc, Value* vp)
|
|||
void
|
||||
PluralRulesObject::finalize(FreeOp* fop, JSObject* obj)
|
||||
{
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(fop->onActiveCooperatingThread());
|
||||
|
||||
const Value& slot =
|
||||
obj->as<PluralRulesObject>().getReservedSlot(PluralRulesObject::UPLURAL_RULES_SLOT);
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче