mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D27245 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4f3f6120d8
commit
7f60810d86
@ -310,14 +310,15 @@ dbus_done:
|
||||
|
||||
// check GSettings
|
||||
#define GSETINGS_A11Y_INTERFACE "org.gnome.desktop.interface"
|
||||
#define GSETINGS_A11Y_KEY "toolkit-accessibility"
|
||||
#define GSETINGS_A11Y_KEY "toolkit-accessibility"
|
||||
nsCOMPtr<nsIGSettingsService> gsettings =
|
||||
do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
|
||||
nsCOMPtr<nsIGSettingsCollection> a11y_settings;
|
||||
|
||||
if (gsettings) {
|
||||
gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(GSETINGS_A11Y_INTERFACE),
|
||||
getter_AddRefs(a11y_settings));
|
||||
gsettings->GetCollectionForSchema(
|
||||
NS_LITERAL_CSTRING(GSETINGS_A11Y_INTERFACE),
|
||||
getter_AddRefs(a11y_settings));
|
||||
if (a11y_settings) {
|
||||
a11y_settings->GetBoolean(NS_LITERAL_CSTRING(GSETINGS_A11Y_KEY),
|
||||
&sShouldEnable);
|
||||
|
@ -180,10 +180,10 @@ static mozilla::Maybe<bool> RunAsLauncherProcess(int& argc, wchar_t** argv) {
|
||||
#endif // defined(MOZ_LAUNCHER_PROCESS)
|
||||
|
||||
// We must check for force-launcher *after* we do LauncherRegistryInfo checks
|
||||
runAsLauncher |= mozilla::CheckArg(argc, argv, L"force-launcher",
|
||||
static_cast<const wchar_t**>(nullptr),
|
||||
mozilla::CheckArgFlag::RemoveArg) ==
|
||||
mozilla::ARG_FOUND;
|
||||
runAsLauncher |=
|
||||
mozilla::CheckArg(argc, argv, L"force-launcher",
|
||||
static_cast<const wchar_t**>(nullptr),
|
||||
mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND;
|
||||
|
||||
if (!runAsLauncher) {
|
||||
// In this case, we will be proceeding to run as the browser.
|
||||
|
@ -598,9 +598,7 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntry, bool aPersist) {
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(void)
|
||||
nsSHistory::ClearRootDocShell() {
|
||||
mRootDocShell = nullptr;
|
||||
}
|
||||
nsSHistory::ClearRootDocShell() { mRootDocShell = nullptr; }
|
||||
|
||||
/* Get size of the history list */
|
||||
NS_IMETHODIMP
|
||||
|
@ -287,9 +287,9 @@ nsresult ImageEncoder::GetInputStream(int32_t aWidth, int32_t aHeight,
|
||||
imgIEncoder* aEncoder,
|
||||
const nsAString& aEncoderOptions,
|
||||
nsIInputStream** aStream) {
|
||||
nsresult rv = aEncoder->InitFromData(aImageBuffer, aWidth * aHeight * 4,
|
||||
aWidth, aHeight, aWidth * 4, aFormat,
|
||||
aEncoderOptions);
|
||||
nsresult rv =
|
||||
aEncoder->InitFromData(aImageBuffer, aWidth * aHeight * 4, aWidth,
|
||||
aHeight, aWidth * 4, aFormat, aEncoderOptions);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<imgIEncoder> encoder(aEncoder);
|
||||
@ -317,9 +317,9 @@ nsresult ImageEncoder::ExtractDataInternal(
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
rv = ImageEncoder::GetInputStream(
|
||||
aSize.width, aSize.height, aImageBuffer, aFormat, aEncoder,
|
||||
aOptions, getter_AddRefs(imgStream));
|
||||
rv = ImageEncoder::GetInputStream(aSize.width, aSize.height, aImageBuffer,
|
||||
aFormat, aEncoder, aOptions,
|
||||
getter_AddRefs(imgStream));
|
||||
} else if (aContext && !aUsePlaceholder) {
|
||||
NS_ConvertUTF16toUTF8 encoderType(aType);
|
||||
rv = aContext->GetInputStream(encoderType.get(), aOptions,
|
||||
|
@ -435,9 +435,9 @@ bool MaybeCrossOriginObject<Base>::defineProperty(
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
bool MaybeCrossOriginObject<Base>::enumerate(JSContext* cx,
|
||||
JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const {
|
||||
bool MaybeCrossOriginObject<Base>::enumerate(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const {
|
||||
// Just get the property keys from ourselves, in whatever Realm we happen to
|
||||
// be in. It's important to not enter the Realm of "proxy" here, because that
|
||||
// would affect the list of keys we claim to have. We wrap the proxy in the
|
||||
|
@ -45,8 +45,9 @@ class RemoteOuterWindowProxy
|
||||
JS::MutableHandleVector<jsid> aProps) const final;
|
||||
|
||||
// SpiderMonkey extensions
|
||||
bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const final;
|
||||
bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const final;
|
||||
|
||||
void NoteChildren(JSObject* aProxy,
|
||||
nsCycleCollectionTraversalCallback& aCb) const override {
|
||||
@ -140,9 +141,9 @@ bool AppendIndexedPropertyNames(JSContext* aCx, BrowsingContext* aContext,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RemoteOuterWindowProxy::ownPropertyKeys(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const {
|
||||
bool RemoteOuterWindowProxy::ownPropertyKeys(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const {
|
||||
BrowsingContext* bc = GetBrowsingContext(aProxy);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-ownpropertykeys:crossoriginownpropertykeys-(-o-)
|
||||
|
@ -24,9 +24,9 @@ class WindowNamedPropertiesHandler : public BaseDOMProxyHandler {
|
||||
JS::Handle<jsid> aId,
|
||||
JS::Handle<JS::PropertyDescriptor> aDesc,
|
||||
JS::ObjectOpResult& result) const override;
|
||||
virtual bool ownPropNames(JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
unsigned flags,
|
||||
JS::MutableHandleVector<jsid> aProps) const override;
|
||||
virtual bool ownPropNames(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aProxy, unsigned flags,
|
||||
JS::MutableHandleVector<jsid> aProps) const override;
|
||||
virtual bool delete_(JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
JS::Handle<jsid> aId,
|
||||
JS::ObjectOpResult& aResult) const override;
|
||||
|
@ -499,8 +499,8 @@ void DispatchScriptErrorEvent(nsPIDOMWindowInner* win,
|
||||
xpc::ErrorReport* xpcReport,
|
||||
JS::Handle<JS::Value> exception,
|
||||
JS::Handle<JSObject*> exceptionStack) {
|
||||
nsContentUtils::AddScriptRunner(
|
||||
new ScriptErrorEvent(win, rootingCx, xpcReport, exception, exceptionStack));
|
||||
nsContentUtils::AddScriptRunner(new ScriptErrorEvent(
|
||||
win, rootingCx, xpcReport, exception, exceptionStack));
|
||||
}
|
||||
|
||||
} /* namespace xpc */
|
||||
|
@ -3508,10 +3508,9 @@ bool nsObjectLoadingContent::MayResolve(jsid aId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void nsObjectLoadingContent::GetOwnPropertyNames(JSContext* aCx,
|
||||
JS::MutableHandleVector<jsid> /* unused */,
|
||||
bool /* unused */,
|
||||
ErrorResult& aRv) {
|
||||
void nsObjectLoadingContent::GetOwnPropertyNames(
|
||||
JSContext* aCx, JS::MutableHandleVector<jsid> /* unused */,
|
||||
bool /* unused */, ErrorResult& aRv) {
|
||||
// Just like DoResolve, just make sure we're instantiated. That will do
|
||||
// the work our Enumerate hook needs to do. This purposefully does not fire
|
||||
// for xray resolves, see bug 967694
|
||||
|
@ -189,7 +189,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
|
||||
static bool MayResolve(jsid aId);
|
||||
|
||||
// Helper for WebIDL enumeration
|
||||
void GetOwnPropertyNames(JSContext* aCx, JS::MutableHandleVector<jsid> /* unused */,
|
||||
void GetOwnPropertyNames(JSContext* aCx,
|
||||
JS::MutableHandleVector<jsid> /* unused */,
|
||||
bool /* unused */, mozilla::ErrorResult& aRv);
|
||||
|
||||
// WebIDL API
|
||||
|
@ -1870,7 +1870,8 @@ bool XrayAppendPropertyKeys<ConstantSpec>(
|
||||
|
||||
bool XrayOwnPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::Handle<JSObject*> obj, unsigned flags,
|
||||
JS::MutableHandleVector<jsid> props, DOMObjectType type,
|
||||
JS::MutableHandleVector<jsid> props,
|
||||
DOMObjectType type,
|
||||
const NativeProperties* nativeProperties) {
|
||||
MOZ_ASSERT(type != eNamedPropertiesObject);
|
||||
|
||||
@ -1902,7 +1903,8 @@ bool XrayOwnPropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
bool XrayOwnNativePropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
const NativePropertyHooks* nativePropertyHooks,
|
||||
DOMObjectType type, JS::Handle<JSObject*> obj,
|
||||
unsigned flags, JS::MutableHandleVector<jsid> props) {
|
||||
unsigned flags,
|
||||
JS::MutableHandleVector<jsid> props) {
|
||||
MOZ_ASSERT(type != eNamedPropertiesObject);
|
||||
|
||||
if (type == eInterface &&
|
||||
@ -2739,7 +2741,8 @@ bool MayResolveGlobal(const JSAtomState& aNames, jsid aId,
|
||||
}
|
||||
|
||||
bool EnumerateGlobal(JSContext* aCx, JS::HandleObject aObj,
|
||||
JS::MutableHandleVector<jsid> aProperties, bool aEnumerableOnly) {
|
||||
JS::MutableHandleVector<jsid> aProperties,
|
||||
bool aEnumerableOnly) {
|
||||
MOZ_ASSERT(JS_IsGlobalObject(aObj),
|
||||
"Should have a global here, since we plan to enumerate standard "
|
||||
"classes!");
|
||||
|
@ -2192,7 +2192,8 @@ inline bool IdEquals(jsid id, const char* string) {
|
||||
JS_FlatStringEqualsAscii(JSID_TO_FLAT_STRING(id), string);
|
||||
}
|
||||
|
||||
inline bool AddStringToIDVector(JSContext* cx, JS::MutableHandleVector<jsid> vector,
|
||||
inline bool AddStringToIDVector(JSContext* cx,
|
||||
JS::MutableHandleVector<jsid> vector,
|
||||
const char* name) {
|
||||
return vector.growBy(1) &&
|
||||
AtomizeAndPinJSString(cx, *(vector[vector.length() - 1]).address(),
|
||||
@ -2778,7 +2779,8 @@ bool ResolveGlobal(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
bool MayResolveGlobal(const JSAtomState& aNames, jsid aId, JSObject* aMaybeObj);
|
||||
|
||||
bool EnumerateGlobal(JSContext* aCx, JS::HandleObject aObj,
|
||||
JS::MutableHandleVector<jsid> aProperties, bool aEnumerableOnly);
|
||||
JS::MutableHandleVector<jsid> aProperties,
|
||||
bool aEnumerableOnly);
|
||||
|
||||
struct CreateGlobalOptionsGeneric {
|
||||
static void TraceGlobal(JSTracer* aTrc, JSObject* aObj) {
|
||||
|
@ -253,9 +253,9 @@ bool DOMProxyHandler::delete_(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
return result.succeed();
|
||||
}
|
||||
|
||||
bool BaseDOMProxyHandler::ownPropertyKeys(JSContext* cx,
|
||||
JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const {
|
||||
bool BaseDOMProxyHandler::ownPropertyKeys(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const {
|
||||
return ownPropNames(cx, proxy,
|
||||
JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props);
|
||||
}
|
||||
@ -269,7 +269,8 @@ bool BaseDOMProxyHandler::getPrototypeIfOrdinary(
|
||||
}
|
||||
|
||||
bool BaseDOMProxyHandler::getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy, JS::MutableHandleVector<jsid> props) const {
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const {
|
||||
return ownPropNames(cx, proxy, JSITER_OWNONLY, props);
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,9 @@ class BaseDOMProxyHandler : public js::BaseProxyHandler {
|
||||
bool getOwnPropertyDescriptor(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
|
||||
virtual bool ownPropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const override;
|
||||
virtual bool ownPropertyKeys(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
JS::MutableHandleVector<jsid> props) const override;
|
||||
|
||||
virtual bool getPrototypeIfOrdinary(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy, bool* isOrdinary,
|
||||
@ -73,7 +74,8 @@ class BaseDOMProxyHandler : public js::BaseProxyHandler {
|
||||
// or JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS (for
|
||||
// ownPropertyKeys()).
|
||||
virtual bool ownPropNames(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
unsigned flags, JS::MutableHandleVector<jsid> props) const = 0;
|
||||
unsigned flags,
|
||||
JS::MutableHandleVector<jsid> props) const = 0;
|
||||
|
||||
// Hook for subclasses to allow set() to ignore named props while other things
|
||||
// that look at property descriptors see them. This is intentionally not
|
||||
|
@ -33,9 +33,9 @@ bool RemoteObjectProxyBase::defineProperty(
|
||||
return ReportCrossOriginDenial(aCx, aId, NS_LITERAL_CSTRING("define"));
|
||||
}
|
||||
|
||||
bool RemoteObjectProxyBase::ownPropertyKeys(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const {
|
||||
bool RemoteObjectProxyBase::ownPropertyKeys(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const {
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#crossoriginownpropertykeys-(-o-)
|
||||
// step 2 and
|
||||
// https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
|
||||
|
@ -67,9 +67,9 @@ class RemoteObjectProxyBase : public js::BaseProxyHandler,
|
||||
// SpiderMonkey extensions
|
||||
bool hasOwn(JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
JS::Handle<jsid> aId, bool* aBp) const override;
|
||||
bool getOwnEnumerablePropertyKeys(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const override;
|
||||
bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aProxy,
|
||||
JS::MutableHandleVector<jsid> aProps) const override;
|
||||
const char* className(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aProxy) const final;
|
||||
|
||||
|
@ -243,8 +243,8 @@ bool WebIDLGlobalNameHash::ResolveForSystemGlobal(JSContext* aCx,
|
||||
|
||||
/* static */
|
||||
bool WebIDLGlobalNameHash::NewEnumerateSystemGlobal(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aObj, JS::MutableHandleVector<jsid> aProperties,
|
||||
bool aEnumerableOnly) {
|
||||
JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
JS::MutableHandleVector<jsid> aProperties, bool aEnumerableOnly) {
|
||||
MOZ_ASSERT(JS_IsGlobalObject(aObj));
|
||||
|
||||
if (!JS_NewEnumerateStandardClasses(aCx, aObj, aProperties,
|
||||
|
@ -59,7 +59,8 @@ class WebIDLGlobalNameHash {
|
||||
};
|
||||
// Returns false if an exception has been thrown on aCx.
|
||||
static bool GetNames(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
NameType aNameType, JS::MutableHandleVector<jsid> aNames);
|
||||
NameType aNameType,
|
||||
JS::MutableHandleVector<jsid> aNames);
|
||||
|
||||
// Helpers for resolving & enumerating names on the system global.
|
||||
// NOTE: These are distinct as it currently lacks a ProtoAndIfaceCache, and is
|
||||
@ -67,10 +68,9 @@ class WebIDLGlobalNameHash {
|
||||
static bool ResolveForSystemGlobal(JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
JS::Handle<jsid> aId, bool* aResolvedp);
|
||||
|
||||
static bool NewEnumerateSystemGlobal(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aObj,
|
||||
JS::MutableHandleVector<jsid> aProperties,
|
||||
bool aEnumerableOnly);
|
||||
static bool NewEnumerateSystemGlobal(
|
||||
JSContext* aCx, JS::Handle<JSObject*> aObj,
|
||||
JS::MutableHandleVector<jsid> aProperties, bool aEnumerableOnly);
|
||||
|
||||
private:
|
||||
friend struct WebIDLNameTableEntry;
|
||||
|
@ -77,46 +77,42 @@ void FetchDpadFromAxis(uint32_t aIndex, double dir) {
|
||||
}
|
||||
|
||||
class DefaultRemapper final : public GamepadRemapper {
|
||||
public:
|
||||
virtual uint32_t GetAxisCount() const override {
|
||||
return numAxes;
|
||||
}
|
||||
public:
|
||||
virtual uint32_t GetAxisCount() const override { return numAxes; }
|
||||
|
||||
virtual uint32_t GetButtonCount() const override {
|
||||
return numButtons;
|
||||
}
|
||||
virtual uint32_t GetButtonCount() const override { return numButtons; }
|
||||
|
||||
virtual void SetAxisCount(uint32_t aAxisCount) override {
|
||||
numAxes = aAxisCount;
|
||||
}
|
||||
virtual void SetAxisCount(uint32_t aAxisCount) override {
|
||||
numAxes = aAxisCount;
|
||||
}
|
||||
|
||||
virtual void SetButtonCount(uint32_t aButtonCount) override {
|
||||
numButtons = aButtonCount;
|
||||
}
|
||||
virtual void SetButtonCount(uint32_t aButtonCount) override {
|
||||
numButtons = aButtonCount;
|
||||
}
|
||||
|
||||
virtual void RemapAxisMoveEvent(uint32_t aIndex, uint32_t aAxis,
|
||||
virtual void RemapAxisMoveEvent(uint32_t aIndex, uint32_t aAxis,
|
||||
double aValue) const override {
|
||||
RefPtr<GamepadPlatformService> service =
|
||||
GamepadPlatformService::GetParentService();
|
||||
if (!service) {
|
||||
return;
|
||||
}
|
||||
service->NewAxisMoveEvent(aIndex, aAxis, aValue);
|
||||
RefPtr<GamepadPlatformService> service =
|
||||
GamepadPlatformService::GetParentService();
|
||||
if (!service) {
|
||||
return;
|
||||
}
|
||||
service->NewAxisMoveEvent(aIndex, aAxis, aValue);
|
||||
}
|
||||
|
||||
virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton,
|
||||
bool aPressed) const override {
|
||||
RefPtr<GamepadPlatformService> service =
|
||||
GamepadPlatformService::GetParentService();
|
||||
if (!service) {
|
||||
return;
|
||||
}
|
||||
service->NewButtonEvent(aIndex, aButton, aPressed);
|
||||
virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton,
|
||||
bool aPressed) const override {
|
||||
RefPtr<GamepadPlatformService> service =
|
||||
GamepadPlatformService::GetParentService();
|
||||
if (!service) {
|
||||
return;
|
||||
}
|
||||
service->NewButtonEvent(aIndex, aButton, aPressed);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t numAxes;
|
||||
uint32_t numButtons;
|
||||
private:
|
||||
uint32_t numAxes;
|
||||
uint32_t numButtons;
|
||||
};
|
||||
|
||||
class Dualshock4Remapper final : public GamepadRemapper {
|
||||
@ -180,29 +176,26 @@ class Dualshock4Remapper final : public GamepadRemapper {
|
||||
return;
|
||||
}
|
||||
|
||||
const std::vector<uint32_t> buttonMapping = {
|
||||
BUTTON_INDEX_TERTIARY,
|
||||
BUTTON_INDEX_PRIMARY,
|
||||
BUTTON_INDEX_SECONDARY,
|
||||
BUTTON_INDEX_QUATERNARY,
|
||||
BUTTON_INDEX_LEFT_SHOULDER,
|
||||
BUTTON_INDEX_RIGHT_SHOULDER,
|
||||
BUTTON_INDEX_LEFT_TRIGGER,
|
||||
BUTTON_INDEX_RIGHT_TRIGGER,
|
||||
BUTTON_INDEX_BACK_SELECT,
|
||||
BUTTON_INDEX_START,
|
||||
BUTTON_INDEX_LEFT_THUMBSTICK,
|
||||
BUTTON_INDEX_RIGHT_THUMBSTICK,
|
||||
BUTTON_INDEX_META,
|
||||
DUALSHOCK_BUTTON_TOUCHPAD
|
||||
};
|
||||
const std::vector<uint32_t> buttonMapping = {BUTTON_INDEX_TERTIARY,
|
||||
BUTTON_INDEX_PRIMARY,
|
||||
BUTTON_INDEX_SECONDARY,
|
||||
BUTTON_INDEX_QUATERNARY,
|
||||
BUTTON_INDEX_LEFT_SHOULDER,
|
||||
BUTTON_INDEX_RIGHT_SHOULDER,
|
||||
BUTTON_INDEX_LEFT_TRIGGER,
|
||||
BUTTON_INDEX_RIGHT_TRIGGER,
|
||||
BUTTON_INDEX_BACK_SELECT,
|
||||
BUTTON_INDEX_START,
|
||||
BUTTON_INDEX_LEFT_THUMBSTICK,
|
||||
BUTTON_INDEX_RIGHT_THUMBSTICK,
|
||||
BUTTON_INDEX_META,
|
||||
DUALSHOCK_BUTTON_TOUCHPAD};
|
||||
|
||||
if (buttonMapping.size() <= aIndex) {
|
||||
NS_WARNING(
|
||||
nsPrintfCString(
|
||||
"Button idx '%d' doesn't support in Dualshock4Remapper().",
|
||||
aButton)
|
||||
.get());
|
||||
NS_WARNING(nsPrintfCString(
|
||||
"Button idx '%d' doesn't support in Dualshock4Remapper().",
|
||||
aButton)
|
||||
.get());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -216,13 +209,12 @@ class Dualshock4Remapper final : public GamepadRemapper {
|
||||
};
|
||||
};
|
||||
|
||||
already_AddRefed<GamepadRemapper> GetGamepadRemapper(const uint16_t aVendorId,
|
||||
const uint16_t aProductId) {
|
||||
already_AddRefed<GamepadRemapper> GetGamepadRemapper(
|
||||
const uint16_t aVendorId, const uint16_t aProductId) {
|
||||
const std::vector<GamepadRemappingData> remappingRules = {
|
||||
{GamepadId::kSonyDualshock4, new Dualshock4Remapper()},
|
||||
{GamepadId::kSonyDualshock4Slim, new Dualshock4Remapper()},
|
||||
{GamepadId::kSonyDualshock4USBReceiver, new Dualshock4Remapper()}
|
||||
};
|
||||
{GamepadId::kSonyDualshock4USBReceiver, new Dualshock4Remapper()}};
|
||||
const GamepadId id = static_cast<GamepadId>((aVendorId << 16) | aProductId);
|
||||
|
||||
for (uint32_t i = 0; i < remappingRules.size(); ++i) {
|
||||
|
@ -32,7 +32,7 @@ class GamepadRemapper {
|
||||
double aValue) const = 0;
|
||||
virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton,
|
||||
bool aPressed) const = 0;
|
||||
|
||||
|
||||
protected:
|
||||
GamepadRemapper() = default;
|
||||
virtual ~GamepadRemapper() = default;
|
||||
|
@ -135,10 +135,7 @@ class Gamepad {
|
||||
bool present;
|
||||
|
||||
Gamepad(uint32_t aNumAxes, uint32_t aNumButtons, GamepadType aType)
|
||||
: type(aType),
|
||||
numAxes(aNumAxes),
|
||||
numButtons(aNumButtons),
|
||||
present(true) {
|
||||
: type(aType), numAxes(aNumAxes), numButtons(aNumButtons), present(true) {
|
||||
buttons.SetLength(numButtons);
|
||||
axes.SetLength(numAxes);
|
||||
}
|
||||
@ -431,7 +428,8 @@ bool WindowsGamepadService::ScanForXInputDevices() {
|
||||
}
|
||||
|
||||
// Not already present, add it.
|
||||
Gamepad gamepad(kStandardGamepadAxes, kStandardGamepadButtons, kXInputGamepad);
|
||||
Gamepad gamepad(kStandardGamepadAxes, kStandardGamepadButtons,
|
||||
kXInputGamepad);
|
||||
gamepad.userIndex = i;
|
||||
gamepad.state = state;
|
||||
gamepad.id = service->AddGamepad(
|
||||
@ -688,7 +686,8 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) {
|
||||
|
||||
size_t numAxes = 0;
|
||||
nsTArray<Gamepad::axisValue> axes(kAxesLengthCap);
|
||||
// We store these value caps and handle the dpad info in GamepadRemapper later.
|
||||
// We store these value caps and handle the dpad info in GamepadRemapper
|
||||
// later.
|
||||
axes.SetLength(kAxesLengthCap);
|
||||
|
||||
// Looking for the exisiting ramapping rule.
|
||||
@ -697,7 +696,8 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) {
|
||||
MOZ_ASSERT(remapper);
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
const size_t axisIndex = axisCaps[i].Range.UsageMin - kAxisMinimumUsageNumber;
|
||||
const size_t axisIndex =
|
||||
axisCaps[i].Range.UsageMin - kAxisMinimumUsageNumber;
|
||||
if (axisIndex < kAxesLengthCap && !axes[axisIndex].active) {
|
||||
axes[axisIndex].caps = axisCaps[i];
|
||||
axes[axisIndex].active = true;
|
||||
@ -717,10 +717,9 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) {
|
||||
}
|
||||
|
||||
gamepad.remapper = remapper.forget();
|
||||
gamepad.id =
|
||||
service->AddGamepad(gamepad_id, gamepad.remapper->GetMappingType(),
|
||||
GamepadHand::_empty, gamepad.remapper->GetButtonCount(),
|
||||
gamepad.remapper->GetAxisCount(), 0);
|
||||
gamepad.id = service->AddGamepad(
|
||||
gamepad_id, gamepad.remapper->GetMappingType(), GamepadHand::_empty,
|
||||
gamepad.remapper->GetButtonCount(), gamepad.remapper->GetAxisCount(), 0);
|
||||
mGamepads.AppendElement(gamepad);
|
||||
return true;
|
||||
}
|
||||
|
@ -1622,8 +1622,7 @@ bool HTMLFormElement::IsLastActiveElement(
|
||||
|
||||
for (auto* element : Reversed(mControls->mElements)) {
|
||||
// XXX How about date/time control?
|
||||
if (element->IsTextOrNumberControl(false) &&
|
||||
!element->IsDisabled()) {
|
||||
if (element->IsTextOrNumberControl(false) && !element->IsDisabled()) {
|
||||
return element == aControl;
|
||||
}
|
||||
}
|
||||
|
@ -1463,7 +1463,8 @@ void TabChild::ProcessPendingCoalescedMouseDataAndDispatchEvents() {
|
||||
}
|
||||
}
|
||||
|
||||
LayoutDeviceToLayoutDeviceMatrix4x4 TabChild::GetChildToParentConversionMatrix() const {
|
||||
LayoutDeviceToLayoutDeviceMatrix4x4 TabChild::GetChildToParentConversionMatrix()
|
||||
const {
|
||||
if (mChildToParentConversionMatrix) {
|
||||
return *mChildToParentConversionMatrix;
|
||||
}
|
||||
|
@ -642,7 +642,8 @@ class TabChild final : public TabChildBase,
|
||||
|
||||
// The transform from the coordinate space of this TabChild to the coordinate
|
||||
// space of the native window its TabParent is in.
|
||||
mozilla::LayoutDeviceToLayoutDeviceMatrix4x4 GetChildToParentConversionMatrix() const;
|
||||
mozilla::LayoutDeviceToLayoutDeviceMatrix4x4
|
||||
GetChildToParentConversionMatrix() const;
|
||||
|
||||
// Prepare to dispatch all coalesced mousemove events. We'll move all data
|
||||
// in mCoalescedMouseData to a nsDeque; then we start processing them. We
|
||||
|
@ -1041,7 +1041,8 @@ IPCResult TabParent::RecvPBrowserBridgeConstructor(
|
||||
const nsString& aRemoteType, BrowsingContext* aBrowsingContext,
|
||||
const uint32_t& aChromeFlags) {
|
||||
static_cast<BrowserBridgeParent*>(aActor)->Init(
|
||||
aName, aRemoteType, CanonicalBrowsingContext::Cast(aBrowsingContext), aChromeFlags);
|
||||
aName, aRemoteType, CanonicalBrowsingContext::Cast(aBrowsingContext),
|
||||
aChromeFlags);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
@ -1360,9 +1361,10 @@ class SynthesizedEventObserver : public nsIObserver {
|
||||
|
||||
if (mTabParent->IsDestroyed()) {
|
||||
// If this happens it's probably a bug in the test that's triggering this.
|
||||
NS_WARNING("TabParent was unexpectedly destroyed during event synthesization!");
|
||||
NS_WARNING(
|
||||
"TabParent was unexpectedly destroyed during event synthesization!");
|
||||
} else if (!mTabParent->SendNativeSynthesisResponse(mObserverId,
|
||||
nsCString(aTopic))) {
|
||||
nsCString(aTopic))) {
|
||||
NS_WARNING("Unable to send native event synthesization response!");
|
||||
}
|
||||
// Null out tabparent to indicate we already sent the response
|
||||
|
@ -17,7 +17,7 @@ namespace mozilla {
|
||||
namespace ipc {
|
||||
class SharedPreferenceSerializer;
|
||||
}
|
||||
}
|
||||
} // namespace mozilla
|
||||
class nsITimer;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -249,8 +249,8 @@ class AudioContext final : public DOMEventTargetHelper,
|
||||
already_AddRefed<MediaStreamAudioSourceNode> CreateMediaStreamSource(
|
||||
DOMMediaStream& aMediaStream, ErrorResult& aRv);
|
||||
already_AddRefed<MediaStreamTrackAudioSourceNode>
|
||||
CreateMediaStreamTrackSource(MediaStreamTrack& aMediaStreamTrack,
|
||||
ErrorResult& aRv);
|
||||
CreateMediaStreamTrackSource(MediaStreamTrack& aMediaStreamTrack,
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<DelayNode> CreateDelay(double aMaxDelayTime,
|
||||
ErrorResult& aRv);
|
||||
|
@ -79,7 +79,7 @@ class SVGAnimatedIntegerPair {
|
||||
virtual ~DOMAnimatedInteger();
|
||||
|
||||
SVGAnimatedIntegerPair* 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 void SetBaseVal(int32_t aValue) override {
|
||||
|
@ -82,7 +82,7 @@ class SVGAnimatedNumberPair {
|
||||
virtual ~DOMAnimatedNumber();
|
||||
|
||||
SVGAnimatedNumberPair* 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 void SetBaseVal(float aValue) override {
|
||||
|
@ -624,8 +624,7 @@ nsresult HTMLEditor::GetTemporaryStyleForFocusedPositionedElement(
|
||||
const uint8_t kBlackBgTrigger = 0xd0;
|
||||
|
||||
const auto& color = style->StyleColor()->mColor;
|
||||
if (color.red >= kBlackBgTrigger &&
|
||||
color.green >= kBlackBgTrigger &&
|
||||
if (color.red >= kBlackBgTrigger && color.green >= kBlackBgTrigger &&
|
||||
color.blue >= kBlackBgTrigger) {
|
||||
aReturn.AssignLiteral("black");
|
||||
} else {
|
||||
|
@ -341,7 +341,8 @@ nsresult HTMLEditRules::BeforeEdit(EditSubAction aEditSubAction,
|
||||
if (HTMLEditorRef().GetCompositionStartPoint().IsSet()) {
|
||||
// If there is composition string, let's remember current composition
|
||||
// range.
|
||||
mRangeItem->StoreRange(HTMLEditorRef().GetCompositionStartPoint(), HTMLEditorRef().GetCompositionEndPoint());
|
||||
mRangeItem->StoreRange(HTMLEditorRef().GetCompositionStartPoint(),
|
||||
HTMLEditorRef().GetCompositionEndPoint());
|
||||
} else {
|
||||
// Get the selection location
|
||||
if (!SelectionRefPtr()->RangeCount()) {
|
||||
|
@ -34,7 +34,8 @@ struct RangeItem final {
|
||||
|
||||
public:
|
||||
void StoreRange(nsRange* aRange);
|
||||
void StoreRange(const EditorRawDOMPoint& aStartPoint, const EditorRawDOMPoint& aEndPoint) {
|
||||
void StoreRange(const EditorRawDOMPoint& aStartPoint,
|
||||
const EditorRawDOMPoint& aEndPoint) {
|
||||
MOZ_ASSERT(aStartPoint.IsSet());
|
||||
MOZ_ASSERT(aEndPoint.IsSet());
|
||||
mStartContainer = aStartPoint.GetContainer();
|
||||
|
@ -247,9 +247,9 @@ already_AddRefed<Element> WSRunObject::InsertBreak(
|
||||
return newBrElement.forget();
|
||||
}
|
||||
|
||||
nsresult WSRunObject::InsertText(
|
||||
Document& aDocument, const nsAString& aStringToInsert,
|
||||
EditorRawDOMPoint* aPointAfterInsertedString)
|
||||
nsresult WSRunObject::InsertText(Document& aDocument,
|
||||
const nsAString& aStringToInsert,
|
||||
EditorRawDOMPoint* aPointAfterInsertedString)
|
||||
MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION {
|
||||
// MOOSE: for now, we always assume non-PRE formatting. Fix this later.
|
||||
// meanwhile, the pre case is handled in WillInsertText in
|
||||
|
@ -45,7 +45,7 @@ void nsUniversalDetector::Reset() {
|
||||
}
|
||||
|
||||
if (mEscCharSetProber) {
|
||||
mEscCharSetProber->Reset();
|
||||
mEscCharSetProber->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,12 +136,12 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, uint32_t aLen) {
|
||||
}
|
||||
break;
|
||||
case eHighbyte:
|
||||
st = mMultibyteProber->HandleData(aBuf, aLen);
|
||||
if (st == eFoundIt) {
|
||||
mDone = true;
|
||||
mDetectedCharset = mMultibyteProber->GetCharSetName();
|
||||
return NS_OK;
|
||||
}
|
||||
st = mMultibyteProber->HandleData(aBuf, aLen);
|
||||
if (st == eFoundIt) {
|
||||
mDone = true;
|
||||
mDetectedCharset = mMultibyteProber->GetCharSetName();
|
||||
return NS_OK;
|
||||
}
|
||||
break;
|
||||
|
||||
default: // pure ascii
|
||||
|
@ -480,8 +480,7 @@ bool GLContextEGL::RenewSurface(CompositorWidget* aWidget) {
|
||||
const bool ok = MakeCurrent(true);
|
||||
MOZ_ASSERT(ok);
|
||||
#if defined(MOZ_WAYLAND)
|
||||
if (mSurface &&
|
||||
!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
if (mSurface && !GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
const auto* egl = gl::GLLibraryEGL::Get();
|
||||
// Make eglSwapBuffers() non-blocking on wayland
|
||||
egl->fSwapInterval(EGL_DISPLAY(), 0);
|
||||
|
@ -3144,7 +3144,7 @@ bool AsyncPanZoomController::AttemptScroll(
|
||||
#endif
|
||||
bool displacementIsUserVisible = true;
|
||||
|
||||
{ // Release the APZC lock before calling ToScreenCoordinates which
|
||||
{ // Release the APZC lock before calling ToScreenCoordinates which
|
||||
// acquires the APZ tree lock. Note that this just unlocks the mutex
|
||||
// once, so if we're locking it multiple times on the callstack then
|
||||
// this will be insufficient.
|
||||
@ -3359,7 +3359,7 @@ void AsyncPanZoomController::HandleFlingOverscroll(
|
||||
ParentLayerPoint residualVelocity =
|
||||
treeManagerLocal->DispatchFling(this, handoffState);
|
||||
FLING_LOG("APZC %p left with residual velocity %s\n", this,
|
||||
Stringify(residualVelocity).c_str());
|
||||
Stringify(residualVelocity).c_str());
|
||||
if (!IsZero(residualVelocity) && IsPannable() &&
|
||||
gfxPrefs::APZOverscrollEnabled()) {
|
||||
// Obey overscroll-behavior.
|
||||
@ -4820,8 +4820,8 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) {
|
||||
std::max(mZoomConstraints.mMinZoom.scale,
|
||||
std::max(compositionBounds.Width() / cssPageRect.Width(),
|
||||
compositionBounds.Height() / cssPageRect.Height())));
|
||||
CSSToParentLayerScale localMaxZoom
|
||||
= std::max(localMinZoom, mZoomConstraints.mMaxZoom);
|
||||
CSSToParentLayerScale localMaxZoom =
|
||||
std::max(localMinZoom, mZoomConstraints.mMaxZoom);
|
||||
|
||||
if (!aRect.IsEmpty()) {
|
||||
// Intersect the zoom-to-rect to the CSS rect to make sure it fits.
|
||||
|
@ -66,12 +66,12 @@ void Axis::UpdateWithTouchAtDevicePoint(ParentLayerCoord aPos,
|
||||
mPos = aPos;
|
||||
|
||||
AXIS_LOG("%p|%s got position %f\n", mAsyncPanZoomController, Name(),
|
||||
mPos.value);
|
||||
mPos.value);
|
||||
if (Maybe<float> newVelocity =
|
||||
mVelocityTracker->AddPosition(aPos, aTimestampMs)) {
|
||||
mVelocity = mAxisLocked ? 0 : *newVelocity;
|
||||
AXIS_LOG("%p|%s velocity from tracker is %f\n", mAsyncPanZoomController,
|
||||
Name(), mVelocity);
|
||||
Name(), mVelocity);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,14 +97,16 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation,
|
||||
(now - mApzc.mLastFlingTime).ToMilliseconds() <
|
||||
gfxPrefs::APZFlingAccelInterval() &&
|
||||
velocity.Length() >= gfxPrefs::APZFlingAccelMinVelocity()) {
|
||||
if (velocity.x != 0 && SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) {
|
||||
if (velocity.x != 0 &&
|
||||
SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) {
|
||||
velocity.x = Accelerate(velocity.x, mApzc.mLastFlingVelocity.x);
|
||||
FLING_LOG("%p Applying fling x-acceleration from %f to %f (delta %f)\n",
|
||||
&mApzc, mApzc.mX.GetVelocity(), velocity.x,
|
||||
mApzc.mLastFlingVelocity.x);
|
||||
mApzc.mX.SetVelocity(velocity.x);
|
||||
}
|
||||
if (velocity.y != 0 && SameDirection(velocity.y, mApzc.mLastFlingVelocity.y)) {
|
||||
if (velocity.y != 0 &&
|
||||
SameDirection(velocity.y, mApzc.mLastFlingVelocity.y)) {
|
||||
velocity.y = Accelerate(velocity.y, mApzc.mLastFlingVelocity.y);
|
||||
FLING_LOG("%p Applying fling y-acceleration from %f to %f (delta %f)\n",
|
||||
&mApzc, mApzc.mY.GetVelocity(), velocity.y,
|
||||
|
@ -69,7 +69,6 @@ static Maybe<LayerRect> ApplyParentLayerToLayerTransform(
|
||||
|
||||
static LayerToParentLayerMatrix4x4 GetTransformToAncestorsParentLayer(
|
||||
Layer* aStart, const LayerMetricsWrapper& aAncestor) {
|
||||
|
||||
// If the ancestor layer Combines3DTransformWithAncestors, then the
|
||||
// scroll offset is contained in the transform of the layer at the
|
||||
// root of the 3D context. So we must first find that layer, then
|
||||
|
@ -1134,8 +1134,8 @@ static bool IsItemProbablyActive(nsDisplayItem* aItem,
|
||||
/* BLEND_MODE needs to be active if it might have a previous sibling
|
||||
* that is active. We use the activeness of the parent as a rough
|
||||
* proxy for this situation. */
|
||||
return aParentActive || HasActiveChildren(*aItem->GetChildren(),
|
||||
aDisplayListBuilder);
|
||||
return aParentActive ||
|
||||
HasActiveChildren(*aItem->GetChildren(), aDisplayListBuilder);
|
||||
}
|
||||
case DisplayItemType::TYPE_WRAP_LIST:
|
||||
case DisplayItemType::TYPE_PERSPECTIVE: {
|
||||
|
@ -14,10 +14,10 @@
|
||||
#include "gfxFontFeatures.h"
|
||||
#include "gfxFontVariations.h"
|
||||
#include "mozilla/FontPropertyTypes.h"
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/StyleColorInlines.h" // for StyleRGBA
|
||||
#include "nsCoord.h" // for nscoord
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "mozilla/StyleColorInlines.h" // for StyleRGBA
|
||||
#include "nsCoord.h" // for nscoord
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
|
||||
struct gfxFontStyle;
|
||||
|
||||
|
@ -49,9 +49,7 @@ struct FontFamilyName final {
|
||||
|
||||
bool IsGeneric() const { return !IsNamed(); }
|
||||
|
||||
bool IsQuoted() const {
|
||||
return mSyntax == StyleFontFamilyNameSyntax::Quoted;
|
||||
}
|
||||
bool IsQuoted() const { return mSyntax == StyleFontFamilyNameSyntax::Quoted; }
|
||||
|
||||
void AppendToString(nsACString& aFamilyList, bool aQuotes = true) const {
|
||||
if (IsNamed()) {
|
||||
|
@ -329,9 +329,7 @@ uint32_t gfxPlatformGtk::MaxGenericSubstitions() {
|
||||
return uint32_t(mMaxGenericSubstitutions);
|
||||
}
|
||||
|
||||
bool gfxPlatformGtk::AccelerateLayersByDefault() {
|
||||
return true;
|
||||
}
|
||||
bool gfxPlatformGtk::AccelerateLayersByDefault() { return true; }
|
||||
|
||||
void gfxPlatformGtk::GetPlatformCMSOutputProfile(void*& mem, size_t& size) {
|
||||
mem = nullptr;
|
||||
|
@ -1756,9 +1756,8 @@ void gfxFontGroup::AddPlatformFont(const nsACString& aName, bool aQuotedName,
|
||||
// Not known in the user font set ==> check system fonts
|
||||
gfxPlatformFontList::PlatformFontList()->FindAndAddFamilies(
|
||||
aName, &aFamilyList,
|
||||
aQuotedName
|
||||
? gfxPlatformFontList::FindFamiliesFlags::eQuotedFamilyName
|
||||
: gfxPlatformFontList::FindFamiliesFlags(0),
|
||||
aQuotedName ? gfxPlatformFontList::FindFamiliesFlags::eQuotedFamilyName
|
||||
: gfxPlatformFontList::FindFamiliesFlags(0),
|
||||
&mStyle, mDevToCssSize);
|
||||
}
|
||||
|
||||
|
@ -1256,8 +1256,7 @@ class gfxFontGroup final : public gfxTextRunFactory {
|
||||
// helper methods for looking up fonts
|
||||
|
||||
// lookup and add a font with a given name (i.e. *not* a generic!)
|
||||
void AddPlatformFont(const nsACString& aName,
|
||||
bool aQuotedName,
|
||||
void AddPlatformFont(const nsACString& aName, bool aQuotedName,
|
||||
nsTArray<FamilyAndGeneric>& aFamilyList);
|
||||
|
||||
// do style selection and add entries to list
|
||||
|
@ -60,7 +60,6 @@ class VRDisplayHost {
|
||||
bool GetIsConnected();
|
||||
void ShutdownSubmitThread();
|
||||
|
||||
|
||||
class AutoRestoreRenderState {
|
||||
public:
|
||||
explicit AutoRestoreRenderState(VRDisplayHost* aDisplay);
|
||||
|
@ -53,9 +53,8 @@ void VRGPUChild::Shutdown() {
|
||||
|
||||
void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
VRManager* vm = VRManager::Get();
|
||||
CompositorThreadHolder::Loop()->PostTask(NewRunnableMethod(
|
||||
"VRGPUChild::ActorDestroy",
|
||||
vm, &VRManager::Shutdown));
|
||||
CompositorThreadHolder::Loop()->PostTask(
|
||||
NewRunnableMethod("VRGPUChild::ActorDestroy", vm, &VRManager::Shutdown));
|
||||
|
||||
mClosed = true;
|
||||
}
|
||||
|
@ -183,8 +183,8 @@ void GeckoChildProcessHost::Destroy() {
|
||||
}
|
||||
|
||||
// static
|
||||
mozilla::BinPathType GeckoChildProcessHost::GetPathToBinary(FilePath& exePath,
|
||||
GeckoProcessType processType) {
|
||||
mozilla::BinPathType GeckoChildProcessHost::GetPathToBinary(
|
||||
FilePath& exePath, GeckoProcessType processType) {
|
||||
BinPathType pathType = XRE_GetChildProcBinPathType(processType);
|
||||
|
||||
if (pathType == BinPathType::Self) {
|
||||
|
@ -70,8 +70,7 @@ void SharedPreferenceSerializer::AddSharedPrefCmdLineArgs(
|
||||
aExtraOpts.push_back("-prefsHandle");
|
||||
aExtraOpts.push_back(formatPtrArg(prefsHandle).get());
|
||||
aExtraOpts.push_back("-prefMapHandle");
|
||||
aExtraOpts.push_back(
|
||||
formatPtrArg(GetPrefMapHandle().get()).get());
|
||||
aExtraOpts.push_back(formatPtrArg(GetPrefMapHandle().get()).get());
|
||||
#else
|
||||
// In contrast, Unix fds are per-process. So remap the fd to a fixed one that
|
||||
// will be used in the child.
|
||||
@ -91,7 +90,6 @@ void SharedPreferenceSerializer::AddSharedPrefCmdLineArgs(
|
||||
aExtraOpts.push_back(formatPtrArg(GetPrefMapSize()).get());
|
||||
}
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
static int gPrefsFd = -1;
|
||||
static int gPrefMapFd = -1;
|
||||
|
@ -111,8 +111,9 @@ class CPOWProxyHandler : public BaseProxyHandler {
|
||||
|
||||
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id,
|
||||
bool* bp) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool hasInstance(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleValue v, bool* bp) const override;
|
||||
virtual bool getBuiltinClass(JSContext* cx, HandleObject obj,
|
||||
@ -516,9 +517,8 @@ bool WrapperOwner::set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
|
||||
return ok(cx, status, result);
|
||||
}
|
||||
|
||||
bool CPOWProxyHandler::getOwnEnumerablePropertyKeys(JSContext* cx,
|
||||
HandleObject proxy,
|
||||
MutableHandleIdVector props) const {
|
||||
bool CPOWProxyHandler::getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const {
|
||||
FORWARD(getOwnEnumerablePropertyKeys, (cx, proxy, props), false);
|
||||
}
|
||||
|
||||
@ -889,7 +889,8 @@ void WrapperOwner::updatePointer(JSObject* obj, const JSObject* old) {
|
||||
}
|
||||
|
||||
bool WrapperOwner::getPropertyKeys(JSContext* cx, HandleObject proxy,
|
||||
uint32_t flags, MutableHandleIdVector props) {
|
||||
uint32_t flags,
|
||||
MutableHandleIdVector props) {
|
||||
ObjectId objId = idOf(proxy);
|
||||
|
||||
ReturnStatus status;
|
||||
|
@ -86,8 +86,9 @@ class JS_FRIEND_API ForwardingProxyHandler : public BaseProxyHandler {
|
||||
/* SpiderMonkey extensions. */
|
||||
virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id,
|
||||
bool* bp) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool nativeCall(JSContext* cx, IsAcceptableThis test, NativeImpl impl,
|
||||
const CallArgs& args) const override;
|
||||
virtual bool hasInstance(JSContext* cx, HandleObject proxy,
|
||||
@ -226,8 +227,9 @@ class JS_FRIEND_API CrossCompartmentWrapper : public Wrapper {
|
||||
/* SpiderMonkey extensions. */
|
||||
virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id,
|
||||
bool* bp) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool nativeCall(JSContext* cx, IsAcceptableThis test, NativeImpl impl,
|
||||
const CallArgs& args) const override;
|
||||
virtual bool hasInstance(JSContext* cx, HandleObject wrapper,
|
||||
@ -296,8 +298,9 @@ class JS_FRIEND_API OpaqueCrossCompartmentWrapper
|
||||
/* SpiderMonkey extensions. */
|
||||
virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id,
|
||||
bool* bp) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleIdVector props) const override;
|
||||
virtual bool getBuiltinClass(JSContext* cx, HandleObject wrapper,
|
||||
ESClass* cls) const override;
|
||||
virtual bool isArray(JSContext* cx, HandleObject obj,
|
||||
|
@ -3058,7 +3058,8 @@ static MOZ_MUST_USE bool ReadableStreamDefaultControllerEnqueue(
|
||||
if (!success) {
|
||||
RootedValue exn(cx);
|
||||
RootedSavedFrame stack(cx);
|
||||
if (!cx->isExceptionPending() || !GetAndClearExceptionAndStack(cx, &exn, &stack)) {
|
||||
if (!cx->isExceptionPending() ||
|
||||
!GetAndClearExceptionAndStack(cx, &exn, &stack)) {
|
||||
// Uncatchable error. Die immediately without erroring the
|
||||
// stream.
|
||||
return false;
|
||||
@ -3882,7 +3883,8 @@ static MOZ_MUST_USE bool ReadableByteStreamControllerClose(
|
||||
JSMSG_READABLEBYTESTREAMCONTROLLER_CLOSE_PENDING_PULL);
|
||||
RootedValue e(cx);
|
||||
RootedSavedFrame stack(cx);
|
||||
if (!cx->isExceptionPending() || !GetAndClearExceptionAndStack(cx, &e, &stack)) {
|
||||
if (!cx->isExceptionPending() ||
|
||||
!GetAndClearExceptionAndStack(cx, &e, &stack)) {
|
||||
// Uncatchable error. Die immediately without erroring the
|
||||
// stream.
|
||||
return false;
|
||||
|
@ -838,8 +838,8 @@ JSObject* StructMetaTypeDescr::create(JSContext* cx, HandleObject metaTypeDescr,
|
||||
/* static */
|
||||
StructTypeDescr* StructMetaTypeDescr::createFromArrays(
|
||||
JSContext* cx, HandleObject structTypePrototype, bool opaque,
|
||||
bool allowConstruct, HandleIdVector ids, JS::HandleValueVector fieldTypeObjs,
|
||||
Vector<StructFieldProps>& fieldProps) {
|
||||
bool allowConstruct, HandleIdVector ids,
|
||||
JS::HandleValueVector fieldTypeObjs, Vector<StructFieldProps>& fieldProps) {
|
||||
StringBuffer stringBuffer(cx); // Canonical string repr
|
||||
RootedValueVector fieldNames(cx); // Name of each field.
|
||||
RootedValueVector fieldOffsets(cx); // Offset of each field field.
|
||||
|
@ -638,8 +638,8 @@ class TokenStreamAnyChars : public TokenStreamShared {
|
||||
//
|
||||
// The first program shows why orExpr() has use SlashIsDiv mode when peeking
|
||||
// ahead for the next operator after parsing `q`. The second program shows
|
||||
// why matchOrInsertSemicolon() must use SlashIsRegExp mode when scanning ahead
|
||||
// for a semicolon.
|
||||
// why matchOrInsertSemicolon() must use SlashIsRegExp mode when scanning
|
||||
// ahead for a semicolon.
|
||||
void allowGettingNextTokenWithSlashIsRegExp() {
|
||||
#ifdef DEBUG
|
||||
// Check the precondition: Caller already peeked ahead at the next token,
|
||||
|
@ -310,9 +310,7 @@ class GCRuntime {
|
||||
bool isForegroundSweeping() const { return state() == State::Sweep; }
|
||||
bool isBackgroundSweeping() { return sweepTask.isRunning(); }
|
||||
void waitBackgroundSweepEnd();
|
||||
void waitBackgroundAllocEnd() {
|
||||
allocTask.cancelAndWait();
|
||||
}
|
||||
void waitBackgroundAllocEnd() { allocTask.cancelAndWait(); }
|
||||
void waitBackgroundFreeEnd();
|
||||
|
||||
void lockGC() { lock.lock(); }
|
||||
|
@ -225,12 +225,12 @@ class ICEntry {
|
||||
uint32_t pcOffset_;
|
||||
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
#ifdef JS_64BIT
|
||||
# ifdef JS_64BIT
|
||||
// On 64-bit architectures, we have 32 bits of alignment padding.
|
||||
// We fill it with a magic value, and check that value when tracing.
|
||||
static const uint32_t EXPECTED_TRACE_MAGIC = 0xdeaddead;
|
||||
uint32_t traceMagic_ = EXPECTED_TRACE_MAGIC;
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
@ -4723,11 +4723,13 @@ AttachDecision CallIRGenerator::tryAttachStringSplit() {
|
||||
js::intrinsic_StringSplitString);
|
||||
|
||||
// Ensure arg0 is a string.
|
||||
ValOperandId arg0ValId = writer.loadArgumentFixedSlot(ArgumentKind::Arg0, argc_);
|
||||
ValOperandId arg0ValId =
|
||||
writer.loadArgumentFixedSlot(ArgumentKind::Arg0, argc_);
|
||||
StringOperandId arg0StrId = writer.guardIsString(arg0ValId);
|
||||
|
||||
// Ensure arg1 is a string.
|
||||
ValOperandId arg1ValId = writer.loadArgumentFixedSlot(ArgumentKind::Arg1, argc_);
|
||||
ValOperandId arg1ValId =
|
||||
writer.loadArgumentFixedSlot(ArgumentKind::Arg1, argc_);
|
||||
StringOperandId arg1StrId = writer.guardIsString(arg1ValId);
|
||||
|
||||
// Call custom string splitter VM-function.
|
||||
@ -4794,7 +4796,8 @@ AttachDecision CallIRGenerator::tryAttachArrayPush() {
|
||||
writer.guardSpecificNativeFunction(calleeObjId, js::array_push);
|
||||
|
||||
// Guard this is an array object.
|
||||
ValOperandId thisValId = writer.loadArgumentFixedSlot(ArgumentKind::This, argc_);
|
||||
ValOperandId thisValId =
|
||||
writer.loadArgumentFixedSlot(ArgumentKind::This, argc_);
|
||||
ObjOperandId thisObjId = writer.guardIsObject(thisValId);
|
||||
|
||||
// This is a soft assert, documenting the fact that we pass 'true'
|
||||
|
@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/ArrayUtils.h" // mozilla::ArrayLength
|
||||
#include "mozilla/Utf8.h" // mozilla::Utf8Unit
|
||||
#include "mozilla/Utf8.h" // mozilla::Utf8Unit
|
||||
|
||||
#include "js/CompilationAndEvaluation.h" // JS::Evaluate
|
||||
#include "js/SourceText.h" // JS::Source{Ownership,Text}
|
||||
|
@ -298,8 +298,7 @@ BEGIN_TEST(testSavedStacks_selfHostedFrames) {
|
||||
}
|
||||
END_TEST(testSavedStacks_selfHostedFrames)
|
||||
|
||||
BEGIN_TEST(test_JS_GetPendingExceptionStack)
|
||||
{
|
||||
BEGIN_TEST(test_JS_GetPendingExceptionStack) {
|
||||
CHECK(js::DefineTestingFunctions(cx, global, false, false));
|
||||
|
||||
JSPrincipals* principals = cx->realm()->principals();
|
||||
@ -343,21 +342,20 @@ BEGIN_TEST(test_JS_GetPendingExceptionStack)
|
||||
uint32_t column;
|
||||
const char* source;
|
||||
const char* functionDisplayName;
|
||||
} expected[] = {
|
||||
{ 4, 7, "filename.js", "three" },
|
||||
{ 5, 6, "filename.js", "two" },
|
||||
{ 6, 4, "filename.js", "one" },
|
||||
{ 7, 2, "filename.js", nullptr }
|
||||
};
|
||||
} expected[] = {{4, 7, "filename.js", "three"},
|
||||
{5, 6, "filename.js", "two"},
|
||||
{6, 4, "filename.js", "one"},
|
||||
{7, 2, "filename.js", nullptr}};
|
||||
|
||||
size_t i = 0;
|
||||
for (JS::Handle<js::SavedFrame*> frame : js::SavedFrame::RootedRange(cx, savedFrameStack)) {
|
||||
for (JS::Handle<js::SavedFrame*> frame :
|
||||
js::SavedFrame::RootedRange(cx, savedFrameStack)) {
|
||||
CHECK(i < 4);
|
||||
|
||||
// Line
|
||||
uint32_t line = 123;
|
||||
JS::SavedFrameResult result = JS::GetSavedFrameLine(cx, principals, frame, &line,
|
||||
JS::SavedFrameSelfHosted::Exclude);
|
||||
JS::SavedFrameResult result = JS::GetSavedFrameLine(
|
||||
cx, principals, frame, &line, JS::SavedFrameSelfHosted::Exclude);
|
||||
CHECK(result == JS::SavedFrameResult::Ok);
|
||||
CHECK_EQUAL(line, expected[i].line);
|
||||
|
||||
@ -370,15 +368,16 @@ BEGIN_TEST(test_JS_GetPendingExceptionStack)
|
||||
|
||||
// Source
|
||||
JS::RootedString str(cx);
|
||||
result = JS::GetSavedFrameSource(cx, principals, frame, &str, JS::SavedFrameSelfHosted::Exclude);
|
||||
result = JS::GetSavedFrameSource(cx, principals, frame, &str,
|
||||
JS::SavedFrameSelfHosted::Exclude);
|
||||
CHECK(result == JS::SavedFrameResult::Ok);
|
||||
JSLinearString* linear = str->ensureLinear(cx);
|
||||
CHECK(linear);
|
||||
CHECK(js::StringEqualsAscii(linear, expected[i].source));
|
||||
|
||||
// Function display name
|
||||
result = JS::GetSavedFrameFunctionDisplayName(cx, principals, frame, &str,
|
||||
JS::SavedFrameSelfHosted::Exclude);
|
||||
result = JS::GetSavedFrameFunctionDisplayName(
|
||||
cx, principals, frame, &str, JS::SavedFrameSelfHosted::Exclude);
|
||||
CHECK(result == JS::SavedFrameResult::Ok);
|
||||
if (auto expectedName = expected[i].functionDisplayName) {
|
||||
CHECK(str);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "mozilla/Utf8.h" // mozilla::Utf8Unit
|
||||
|
||||
#include "js/CompilationAndEvaluation.h" // JS::Compile{,DontInflate,Utf8{FileDontInflate,Path}}
|
||||
#include "js/SourceText.h" // JS::Source{Ownership,Text}
|
||||
#include "js/SourceText.h" // JS::Source{Ownership,Text}
|
||||
#include "jsapi-tests/tests.h"
|
||||
|
||||
struct ScriptObjectFixture : public JSAPITest {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "builtin/String.h"
|
||||
#include "js/BuildId.h" // JS::BuildIdCharVector, JS::SetProcessBuildIdOp
|
||||
#include "js/CompilationAndEvaluation.h" // JS::CompileDontInflate
|
||||
#include "js/SourceText.h" // JS::Source{Ownership,Text}
|
||||
#include "js/SourceText.h" // JS::Source{Ownership,Text}
|
||||
#include "js/Transcoding.h"
|
||||
#include "jsapi-tests/tests.h"
|
||||
#include "vm/JSScript.h"
|
||||
|
@ -984,10 +984,9 @@ static bool EnumerateStandardClasses(JSContext* cx, JS::HandleObject obj,
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API bool JS_NewEnumerateStandardClasses(JSContext* cx,
|
||||
JS::HandleObject obj,
|
||||
JS::MutableHandleIdVector properties,
|
||||
bool enumerableOnly) {
|
||||
JS_PUBLIC_API bool JS_NewEnumerateStandardClasses(
|
||||
JSContext* cx, JS::HandleObject obj, JS::MutableHandleIdVector properties,
|
||||
bool enumerableOnly) {
|
||||
return EnumerateStandardClasses(cx, obj, properties, enumerableOnly, false);
|
||||
}
|
||||
|
||||
@ -4992,9 +4991,7 @@ JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx) {
|
||||
cx->clearPendingException();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API JSObject*
|
||||
JS::GetPendingExceptionStack(JSContext* cx)
|
||||
{
|
||||
JS_PUBLIC_API JSObject* JS::GetPendingExceptionStack(JSContext* cx) {
|
||||
AssertHeapIsIdle();
|
||||
CHECK_THREAD(cx);
|
||||
return cx->getPendingExceptionStack();
|
||||
|
@ -2781,7 +2781,7 @@ extern JS_PUBLIC_API bool JS_GetPendingException(JSContext* cx,
|
||||
|
||||
namespace JS {
|
||||
|
||||
enum class ExceptionStackBehavior: bool {
|
||||
enum class ExceptionStackBehavior : bool {
|
||||
// Do not capture any stack.
|
||||
DoNotCapture,
|
||||
|
||||
@ -2790,11 +2790,11 @@ enum class ExceptionStackBehavior: bool {
|
||||
Capture
|
||||
};
|
||||
|
||||
} // namespace JS
|
||||
} // namespace JS
|
||||
|
||||
extern JS_PUBLIC_API void JS_SetPendingException(JSContext* cx,
|
||||
JS::HandleValue v,
|
||||
JS::ExceptionStackBehavior behavior = JS::ExceptionStackBehavior::Capture);
|
||||
extern JS_PUBLIC_API void JS_SetPendingException(
|
||||
JSContext* cx, JS::HandleValue v,
|
||||
JS::ExceptionStackBehavior behavior = JS::ExceptionStackBehavior::Capture);
|
||||
|
||||
extern JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx);
|
||||
|
||||
|
@ -960,7 +960,8 @@ inline void CopyFlatStringChars(char16_t* dest, JSFlatString* s, size_t len) {
|
||||
* results that match the output of Reflect.ownKeys.
|
||||
*/
|
||||
JS_FRIEND_API bool GetPropertyKeys(JSContext* cx, JS::HandleObject obj,
|
||||
unsigned flags, JS::MutableHandleIdVector props);
|
||||
unsigned flags,
|
||||
JS::MutableHandleIdVector props);
|
||||
|
||||
JS_FRIEND_API bool AppendUnique(JSContext* cx, JS::MutableHandleIdVector base,
|
||||
JS::HandleIdVector others);
|
||||
|
@ -228,9 +228,8 @@ bool js::SetPropertyIgnoringNamedGetter(JSContext* cx, HandleObject obj,
|
||||
return result.succeed();
|
||||
}
|
||||
|
||||
bool BaseProxyHandler::getOwnEnumerablePropertyKeys(JSContext* cx,
|
||||
HandleObject proxy,
|
||||
MutableHandleIdVector props) const {
|
||||
bool BaseProxyHandler::getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const {
|
||||
assertEnteredPolicy(cx, proxy, JSID_VOID, ENUMERATE);
|
||||
MOZ_ASSERT(props.length() == 0);
|
||||
|
||||
|
@ -60,9 +60,8 @@ bool CrossCompartmentWrapper::defineProperty(JSContext* cx,
|
||||
Wrapper::defineProperty(cx, wrapper, id, desc2, result), NOTHING);
|
||||
}
|
||||
|
||||
bool CrossCompartmentWrapper::ownPropertyKeys(JSContext* cx,
|
||||
HandleObject wrapper,
|
||||
MutableHandleIdVector props) const {
|
||||
bool CrossCompartmentWrapper::ownPropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const {
|
||||
PIERCE(cx, wrapper, NOTHING, Wrapper::ownPropertyKeys(cx, wrapper, props),
|
||||
MarkAtoms(cx, props));
|
||||
}
|
||||
|
@ -23,9 +23,8 @@ bool OpaqueCrossCompartmentWrapper::defineProperty(
|
||||
return result.succeed();
|
||||
}
|
||||
|
||||
bool OpaqueCrossCompartmentWrapper::ownPropertyKeys(JSContext* cx,
|
||||
HandleObject wrapper,
|
||||
MutableHandleIdVector props) const {
|
||||
bool OpaqueCrossCompartmentWrapper::ownPropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -35,8 +34,8 @@ bool OpaqueCrossCompartmentWrapper::delete_(JSContext* cx, HandleObject wrapper,
|
||||
return result.succeed();
|
||||
}
|
||||
|
||||
bool OpaqueCrossCompartmentWrapper::enumerate(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const {
|
||||
bool OpaqueCrossCompartmentWrapper::enumerate(
|
||||
JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const {
|
||||
return BaseProxyHandler::enumerate(cx, proxy, props);
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,8 @@ bool Proxy::getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy,
|
||||
return handler->getOwnEnumerablePropertyKeys(cx, proxy, props);
|
||||
}
|
||||
|
||||
bool Proxy::enumerate(JSContext* cx, HandleObject proxy, MutableHandleIdVector props) {
|
||||
bool Proxy::enumerate(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) {
|
||||
if (!CheckRecursionLimit(cx)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -36,7 +36,8 @@ class Proxy {
|
||||
MutableHandleIdVector props);
|
||||
static bool delete_(JSContext* cx, HandleObject proxy, HandleId id,
|
||||
ObjectOpResult& result);
|
||||
static bool enumerate(JSContext* cx, HandleObject proxy, MutableHandleIdVector props);
|
||||
static bool enumerate(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props);
|
||||
static bool isExtensible(JSContext* cx, HandleObject proxy, bool* extensible);
|
||||
static bool preventExtensions(JSContext* cx, HandleObject proxy,
|
||||
ObjectOpResult& result);
|
||||
|
@ -59,8 +59,8 @@ bool ForwardingProxyHandler::defineProperty(JSContext* cx, HandleObject proxy,
|
||||
return DefineProperty(cx, target, id, desc, result);
|
||||
}
|
||||
|
||||
bool ForwardingProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject proxy,
|
||||
MutableHandleIdVector props) const {
|
||||
bool ForwardingProxyHandler::ownPropertyKeys(
|
||||
JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const {
|
||||
assertEnteredPolicy(cx, proxy, JSID_VOID, ENUMERATE);
|
||||
RootedObject target(cx, proxy->as<ProxyObject>().target());
|
||||
return GetPropertyKeys(
|
||||
|
@ -278,8 +278,7 @@ class StringBuffer {
|
||||
|
||||
class JSStringBuilder : public StringBuffer {
|
||||
public:
|
||||
explicit JSStringBuilder(JSContext* cx)
|
||||
: StringBuffer(cx) {}
|
||||
explicit JSStringBuilder(JSContext* cx) : StringBuffer(cx) {}
|
||||
|
||||
/*
|
||||
* Creates a string from the characters in this buffer, then (regardless
|
||||
|
@ -438,7 +438,8 @@ class ModuleEnvironmentObject : public EnvironmentObject {
|
||||
static bool deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
|
||||
ObjectOpResult& result);
|
||||
static bool newEnumerate(JSContext* cx, HandleObject obj,
|
||||
MutableHandleIdVector properties, bool enumerableOnly);
|
||||
MutableHandleIdVector properties,
|
||||
bool enumerableOnly);
|
||||
};
|
||||
|
||||
typedef Rooted<ModuleEnvironmentObject*> RootedModuleEnvironmentObject;
|
||||
|
@ -163,7 +163,8 @@ void ForOfIterator::closeThrow() {
|
||||
RootedValue completionException(cx_);
|
||||
RootedSavedFrame completionExceptionStack(cx_);
|
||||
if (cx_->isExceptionPending()) {
|
||||
if (!GetAndClearExceptionAndStack(cx_, &completionException, &completionExceptionStack)) {
|
||||
if (!GetAndClearExceptionAndStack(cx_, &completionException,
|
||||
&completionExceptionStack)) {
|
||||
completionException.setUndefined();
|
||||
completionExceptionStack = nullptr;
|
||||
}
|
||||
|
@ -547,7 +547,8 @@ bool ThrowMsgOperation(JSContext* cx, const unsigned errorNum);
|
||||
|
||||
bool GetAndClearException(JSContext* cx, MutableHandleValue res);
|
||||
|
||||
bool GetAndClearExceptionAndStack(JSContext* cx, MutableHandleValue res, MutableHandleSavedFrame stack);
|
||||
bool GetAndClearExceptionAndStack(JSContext* cx, MutableHandleValue res,
|
||||
MutableHandleSavedFrame stack);
|
||||
|
||||
bool DeleteNameOperation(JSContext* cx, HandlePropertyName name,
|
||||
HandleObject scopeObj, MutableHandleValue res);
|
||||
|
@ -543,7 +543,8 @@ static bool Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags,
|
||||
}
|
||||
|
||||
JS_FRIEND_API bool js::GetPropertyKeys(JSContext* cx, HandleObject obj,
|
||||
unsigned flags, MutableHandleIdVector props) {
|
||||
unsigned flags,
|
||||
MutableHandleIdVector props) {
|
||||
return Snapshot(cx, obj,
|
||||
flags & (JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS |
|
||||
JSITER_SYMBOLSONLY),
|
||||
@ -592,8 +593,8 @@ static PropertyIteratorObject* NewPropertyIteratorObject(JSContext* cx) {
|
||||
}
|
||||
|
||||
static PropertyIteratorObject* CreatePropertyIterator(
|
||||
JSContext* cx, Handle<JSObject*> objBeingIterated,
|
||||
HandleIdVector props, uint32_t numGuards, uint32_t guardKey) {
|
||||
JSContext* cx, Handle<JSObject*> objBeingIterated, HandleIdVector props,
|
||||
uint32_t numGuards, uint32_t guardKey) {
|
||||
Rooted<PropertyIteratorObject*> propIter(cx, NewPropertyIteratorObject(cx));
|
||||
if (!propIter) {
|
||||
return nullptr;
|
||||
|
@ -302,7 +302,8 @@ inline void JSContext::minorGC(JS::GCReason reason) {
|
||||
runtime()->gc.minorGC(reason);
|
||||
}
|
||||
|
||||
inline void JSContext::setPendingException(JS::HandleValue v, js::HandleSavedFrame stack) {
|
||||
inline void JSContext::setPendingException(JS::HandleValue v,
|
||||
js::HandleSavedFrame stack) {
|
||||
#if defined(NIGHTLY_BUILD)
|
||||
do {
|
||||
// Do not intercept exceptions if we are already
|
||||
|
@ -1352,7 +1352,9 @@ static const size_t MAX_REPORTED_STACK_DEPTH = 1u << 7;
|
||||
|
||||
void JSContext::setPendingExceptionAndCaptureStack(HandleValue value) {
|
||||
RootedObject stack(this);
|
||||
if (!CaptureCurrentStack(this, &stack, JS::StackCapture(JS::MaxFrames(MAX_REPORTED_STACK_DEPTH)))) {
|
||||
if (!CaptureCurrentStack(
|
||||
this, &stack,
|
||||
JS::StackCapture(JS::MaxFrames(MAX_REPORTED_STACK_DEPTH)))) {
|
||||
clearPendingException();
|
||||
}
|
||||
|
||||
|
@ -1329,8 +1329,8 @@ bool JSStructuredCloneWriter::startObject(HandleObject obj, bool* backref) {
|
||||
}
|
||||
|
||||
static bool TryAppendNativeProperties(JSContext* cx, HandleObject obj,
|
||||
MutableHandleIdVector entries, size_t* properties,
|
||||
bool* optimized) {
|
||||
MutableHandleIdVector entries,
|
||||
size_t* properties, bool* optimized) {
|
||||
*optimized = false;
|
||||
|
||||
if (!obj->isNative()) {
|
||||
|
@ -241,7 +241,7 @@ static bool GetProperty(JSContext* cx, HandleObject obj, const char* chars,
|
||||
}
|
||||
|
||||
bool js::wasm::GetImports(JSContext* cx, const Module& module,
|
||||
HandleObject importObj, ImportValues* imports) {
|
||||
HandleObject importObj, ImportValues* imports) {
|
||||
if (!module.imports().empty() && !importObj) {
|
||||
return ThrowBadImportArg(cx);
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ bool XPC_WN_Helper_Enumerate(JSContext* cx, JS::HandleObject obj);
|
||||
bool XPC_WN_Shared_Enumerate(JSContext* cx, JS::HandleObject obj);
|
||||
|
||||
bool XPC_WN_NewEnumerate(JSContext* cx, JS::HandleObject obj,
|
||||
JS::MutableHandleIdVector properties, bool enumerableOnly);
|
||||
JS::MutableHandleIdVector properties,
|
||||
bool enumerableOnly);
|
||||
|
||||
bool XPC_WN_Helper_Resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
|
||||
bool* resolvedp);
|
||||
|
@ -795,7 +795,8 @@ bool SandboxProxyHandler::set(JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
}
|
||||
|
||||
bool SandboxProxyHandler::getOwnEnumerablePropertyKeys(
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy, MutableHandleIdVector props) const {
|
||||
JSContext* cx, JS::Handle<JSObject*> proxy,
|
||||
MutableHandleIdVector props) const {
|
||||
return BaseProxyHandler::getOwnEnumerablePropertyKeys(cx, proxy, props);
|
||||
}
|
||||
|
||||
|
@ -1347,7 +1347,8 @@ nsXPCComponents_Utils::ReportError(HandleValue error, HandleValue stack,
|
||||
if (errorObj) {
|
||||
JS::RootedObject stackVal(cx);
|
||||
JS::RootedObject stackGlobal(cx);
|
||||
FindExceptionStackForConsoleReport(win, error, nullptr, &stackVal, &stackGlobal);
|
||||
FindExceptionStackForConsoleReport(win, error, nullptr, &stackVal,
|
||||
&stackGlobal);
|
||||
if (stackVal) {
|
||||
scripterr = new nsScriptErrorWithStack(stackVal, stackGlobal);
|
||||
}
|
||||
|
@ -61,7 +61,8 @@ BackstagePass::Resolve(nsIXPConnectWrappedNative* wrapper, JSContext* cx,
|
||||
|
||||
NS_IMETHODIMP
|
||||
BackstagePass::NewEnumerate(nsIXPConnectWrappedNative* wrapper, JSContext* cx,
|
||||
JSObject* objArg, JS::MutableHandleIdVector properties,
|
||||
JSObject* objArg,
|
||||
JS::MutableHandleIdVector properties,
|
||||
bool enumerableOnly, bool* _retval) {
|
||||
JS::RootedObject obj(cx, objArg);
|
||||
*_retval = WebIDLGlobalNameHash::NewEnumerateSystemGlobal(cx, obj, properties,
|
||||
|
@ -850,7 +850,8 @@ bool XPC_WN_Helper_Enumerate(JSContext* cx, HandleObject obj) {
|
||||
/***************************************************************************/
|
||||
|
||||
bool XPC_WN_NewEnumerate(JSContext* cx, HandleObject obj,
|
||||
MutableHandleIdVector properties, bool enumerableOnly) {
|
||||
MutableHandleIdVector properties,
|
||||
bool enumerableOnly) {
|
||||
XPCCallContext ccx(cx, obj);
|
||||
XPCWrappedNative* wrapper = ccx.GetWrapper();
|
||||
THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
|
||||
|
@ -76,7 +76,8 @@ bool AppendCrossOriginWhitelistedPropNames(JSContext* cx,
|
||||
}
|
||||
|
||||
template <typename Policy>
|
||||
static bool Filter(JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) {
|
||||
static bool Filter(JSContext* cx, HandleObject wrapper,
|
||||
MutableHandleIdVector props) {
|
||||
size_t w = 0;
|
||||
RootedId id(cx);
|
||||
for (size_t n = 0; n < props.length(); ++n) {
|
||||
@ -162,9 +163,9 @@ bool FilteringWrapper<Base, Policy>::getOwnEnumerablePropertyKeys(
|
||||
}
|
||||
|
||||
template <typename Base, typename Policy>
|
||||
bool FilteringWrapper<Base, Policy>::enumerate(JSContext* cx,
|
||||
HandleObject wrapper,
|
||||
JS::MutableHandleIdVector props) const {
|
||||
bool FilteringWrapper<Base, Policy>::enumerate(
|
||||
JSContext* cx, HandleObject wrapper,
|
||||
JS::MutableHandleIdVector props) const {
|
||||
assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE);
|
||||
// Trigger the default proxy enumerate trap, which will use
|
||||
// js::GetPropertyKeys for the list of (censored) ids.
|
||||
|
@ -1713,7 +1713,8 @@ bool DOMXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper,
|
||||
}
|
||||
|
||||
bool DOMXrayTraits::enumerateNames(JSContext* cx, HandleObject wrapper,
|
||||
unsigned flags, MutableHandleIdVector props) {
|
||||
unsigned flags,
|
||||
MutableHandleIdVector props) {
|
||||
// Put the indexed properties for a window first.
|
||||
nsGlobalWindowInner* win = AsWindow(cx, wrapper);
|
||||
if (win) {
|
||||
@ -2032,9 +2033,8 @@ bool XrayWrapper<Base, Traits>::defineProperty(JSContext* cx,
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
bool XrayWrapper<Base, Traits>::ownPropertyKeys(JSContext* cx,
|
||||
HandleObject wrapper,
|
||||
MutableHandleIdVector props) const {
|
||||
bool XrayWrapper<Base, Traits>::ownPropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const {
|
||||
assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE);
|
||||
return getPropertyKeys(
|
||||
cx, wrapper, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props);
|
||||
@ -2134,8 +2134,9 @@ bool XrayWrapper<Base, Traits>::getOwnEnumerablePropertyKeys(
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
bool XrayWrapper<Base, Traits>::enumerate(JSContext* cx, HandleObject wrapper,
|
||||
JS::MutableHandleIdVector props) const {
|
||||
bool XrayWrapper<Base, Traits>::enumerate(
|
||||
JSContext* cx, HandleObject wrapper,
|
||||
JS::MutableHandleIdVector props) const {
|
||||
MOZ_CRASH("Shouldn't be called: we return true for hasPrototype()");
|
||||
}
|
||||
|
||||
@ -2292,10 +2293,9 @@ bool XrayWrapper<Base, Traits>::setImmutablePrototype(JSContext* cx,
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
bool XrayWrapper<Base, Traits>::getPropertyKeys(JSContext* cx,
|
||||
HandleObject wrapper,
|
||||
unsigned flags,
|
||||
MutableHandleIdVector props) const {
|
||||
bool XrayWrapper<Base, Traits>::getPropertyKeys(
|
||||
JSContext* cx, HandleObject wrapper, unsigned flags,
|
||||
MutableHandleIdVector props) const {
|
||||
assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE);
|
||||
|
||||
// Enumerate expando properties first. Note that the expando object lives
|
||||
|
@ -118,12 +118,12 @@ struct nsCounterChangeNode : public nsCounterNode {
|
||||
int32_t aPropIndex)
|
||||
: nsCounterNode( // Fake a content index for resets, increments and sets
|
||||
// that comes before all the real content, with
|
||||
// the resets first, in order, and then the increments and
|
||||
// then the sets.
|
||||
aPropIndex + (aChangeType == RESET
|
||||
? (INT32_MIN)
|
||||
: (aChangeType == INCREMENT ? ((INT32_MIN / 3) * 2)
|
||||
: INT32_MIN / 3)),
|
||||
// the resets first, in order, and then the increments
|
||||
// and then the sets.
|
||||
aPropIndex + (aChangeType == RESET ? (INT32_MIN)
|
||||
: (aChangeType == INCREMENT
|
||||
? ((INT32_MIN / 3) * 2)
|
||||
: INT32_MIN / 3)),
|
||||
aChangeType),
|
||||
mChangeValue(aChangeValue) {
|
||||
NS_ASSERTION(aPropIndex >= 0, "out of range");
|
||||
|
@ -4699,8 +4699,9 @@ bool nsBlockFrame::DrainOverflowLines() {
|
||||
ReparentingDirection::Forwards);
|
||||
|
||||
// Collect overflow containers from our [Excess]OverflowContainers lists
|
||||
// that are continuations from the frames we picked up from our prev-in-flow.
|
||||
// We'll append these to mFrames to ensure the continuations are ordered.
|
||||
// that are continuations from the frames we picked up from our
|
||||
// prev-in-flow. We'll append these to mFrames to ensure the continuations
|
||||
// are ordered.
|
||||
auto HasOverflowContainers = [this]() -> bool {
|
||||
return GetPropTableFrames(OverflowContainersProperty()) ||
|
||||
GetPropTableFrames(ExcessOverflowContainersProperty());
|
||||
|
@ -3717,8 +3717,9 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// create a displayport for this frame. We'll add the item later on.
|
||||
if (!mWillBuildScrollableLayer) {
|
||||
if (aBuilder->BuildCompositorHitTestInfo()) {
|
||||
CompositorHitTestInfo info(CompositorHitTestFlags::eVisibleToHitTest,
|
||||
CompositorHitTestFlags::eInactiveScrollframe);
|
||||
CompositorHitTestInfo info(
|
||||
CompositorHitTestFlags::eVisibleToHitTest,
|
||||
CompositorHitTestFlags::eInactiveScrollframe);
|
||||
// If the scroll frame has non-default overscroll-behavior, instruct
|
||||
// APZ to require a target confirmation before processing events that
|
||||
// hit this scroll frame (that is, to drop the events if a
|
||||
|
@ -2306,7 +2306,7 @@ Maybe<nsIFrame::Cursor> nsImageFrame::GetCursor(const nsPoint& aPoint) {
|
||||
|
||||
// Use the cursor from the style of the *area* element.
|
||||
RefPtr<ComputedStyle> areaStyle =
|
||||
PresShell()->StyleSet()->ResolveStyleLazily(*area);
|
||||
PresShell()->StyleSet()->ResolveStyleLazily(*area);
|
||||
StyleCursorKind kind = areaStyle->StyleUI()->mCursor;
|
||||
if (kind == StyleCursorKind::Auto) {
|
||||
kind = StyleCursorKind::Default;
|
||||
|
@ -180,8 +180,7 @@ class ServoStyleSet {
|
||||
//
|
||||
// TODO(emilio): Element argument should be `const`.
|
||||
already_AddRefed<ComputedStyle> ResolveStyleLazily(
|
||||
dom::Element&,
|
||||
PseudoStyleType = PseudoStyleType::NotPseudo,
|
||||
dom::Element&, PseudoStyleType = PseudoStyleType::NotPseudo,
|
||||
StyleRuleInclusion = StyleRuleInclusion::All);
|
||||
|
||||
// Get a ComputedStyle for an anonymous box. The pseudo type must be an
|
||||
|
@ -70,8 +70,8 @@ nscolor StyleColor::CalcColor(const StyleRGBA& aForegroundColor) const {
|
||||
}
|
||||
MOZ_ASSERT(IsComplex());
|
||||
const auto& complex = AsComplex();
|
||||
return LinearBlendColors(complex.color, complex.ratios.bg,
|
||||
aForegroundColor, complex.ratios.fg);
|
||||
return LinearBlendColors(complex.color, complex.ratios.bg, aForegroundColor,
|
||||
complex.ratios.fg);
|
||||
}
|
||||
|
||||
template <>
|
||||
|
@ -1698,8 +1698,8 @@ nsChangeHint nsStyleTableBorder::CalcDifference(
|
||||
//
|
||||
|
||||
static StyleRGBA DefaultColor(const Document& aDocument) {
|
||||
return
|
||||
StyleRGBA::FromColor(PreferenceSheet::PrefsFor(aDocument).mDefaultColor);
|
||||
return StyleRGBA::FromColor(
|
||||
PreferenceSheet::PrefsFor(aDocument).mDefaultColor);
|
||||
}
|
||||
|
||||
nsStyleColor::nsStyleColor(const Document& aDocument)
|
||||
|
@ -163,8 +163,8 @@ void nsMenuPopupFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
mInContentShell = false;
|
||||
}
|
||||
|
||||
// Support incontentshell=false attribute to allow popups to be displayed outside of the
|
||||
// content shell. Chrome only.
|
||||
// Support incontentshell=false attribute to allow popups to be displayed
|
||||
// outside of the content shell. Chrome only.
|
||||
if (aContent->NodePrincipal()->IsSystemPrincipal()) {
|
||||
if (aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
|
||||
nsGkAtoms::incontentshell,
|
||||
|
@ -2433,13 +2433,13 @@ void arena_t::Purge(bool aAll) {
|
||||
mStats.committed -= npages;
|
||||
|
||||
#ifndef MALLOC_DECOMMIT
|
||||
#ifdef XP_SOLARIS
|
||||
# ifdef XP_SOLARIS
|
||||
posix_madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)),
|
||||
(npages << gPageSize2Pow), MADV_FREE);
|
||||
#else
|
||||
(npages << gPageSize2Pow), MADV_FREE);
|
||||
# else
|
||||
madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)),
|
||||
(npages << gPageSize2Pow), MADV_FREE);
|
||||
#endif
|
||||
# endif
|
||||
# ifdef MALLOC_DOUBLE_PURGE
|
||||
madvised = true;
|
||||
# endif
|
||||
|
@ -559,7 +559,8 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen,
|
||||
// In case of IPv6 address check its validity
|
||||
if (*hostnameLen > 1 && *(serverinfo + *hostnamePos) == '[' &&
|
||||
*(serverinfo + *hostnamePos + *hostnameLen - 1) == ']' &&
|
||||
!net_IsValidIPv6Addr(Substring(serverinfo + *hostnamePos + 1, *hostnameLen - 2)))
|
||||
!net_IsValidIPv6Addr(
|
||||
Substring(serverinfo + *hostnamePos + 1, *hostnameLen - 2)))
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
|
||||
return NS_OK;
|
||||
|
@ -958,8 +958,7 @@ void GatherBaselineRequirementsTelemetry(const UniqueCERTCertList& certList) {
|
||||
// Note that the net_IsValidHostName check will catch things like
|
||||
// "a.*.example.com".
|
||||
if (!net_IsValidHostName(altNameWithoutWildcard) ||
|
||||
net_IsValidIPv4Addr(altName) ||
|
||||
net_IsValidIPv6Addr(altName)) {
|
||||
net_IsValidIPv4Addr(altName) || net_IsValidIPv6Addr(altName)) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
|
||||
("BR telemetry: DNSName '%s' not valid (for '%s')\n",
|
||||
altName.get(), commonName.get()));
|
||||
|
@ -700,8 +700,7 @@ nsresult nsKeygenFormProcessor::ProcessValueIPC(const nsAString& aOldValue,
|
||||
const nsAString& aKeyType,
|
||||
const nsAString& aKeyParams,
|
||||
nsAString& newValue) {
|
||||
return GetPublicKey(aOldValue, aChallenge, aKeyType,
|
||||
newValue, aKeyParams);
|
||||
return GetPublicKey(aOldValue, aChallenge, aKeyType, newValue, aKeyParams);
|
||||
}
|
||||
|
||||
nsresult nsKeygenFormProcessor::ProvideContent(const nsAString& aFormType,
|
||||
|
@ -28,9 +28,10 @@ using ::testing::UnitTest;
|
||||
namespace mozilla {
|
||||
|
||||
#ifdef ANDROID
|
||||
#define MOZ_STDOUT_PRINT(...) __android_log_print(ANDROID_LOG_INFO, "gtest", __VA_ARGS__);
|
||||
# define MOZ_STDOUT_PRINT(...) \
|
||||
__android_log_print(ANDROID_LOG_INFO, "gtest", __VA_ARGS__);
|
||||
#else
|
||||
#define MOZ_STDOUT_PRINT(...) printf(__VA_ARGS__);
|
||||
# define MOZ_STDOUT_PRINT(...) printf(__VA_ARGS__);
|
||||
#endif
|
||||
|
||||
#define MOZ_PRINT(...) \
|
||||
@ -53,8 +54,8 @@ class MozillaPrinter : public EmptyTestEventListener {
|
||||
}
|
||||
virtual void OnTestProgramEnd(const UnitTest& aUnitTest) override {
|
||||
MOZ_PRINT("TEST-%s | GTest unit test: %s\n",
|
||||
aUnitTest.Passed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
aUnitTest.Passed() ? "passed" : "failed");
|
||||
aUnitTest.Passed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
aUnitTest.Passed() ? "passed" : "failed");
|
||||
MOZ_PRINT("Passed: %d\n", aUnitTest.successful_test_count());
|
||||
MOZ_PRINT("Failed: %d\n", aUnitTest.failed_test_count());
|
||||
if (mLogFile) {
|
||||
@ -65,21 +66,21 @@ class MozillaPrinter : public EmptyTestEventListener {
|
||||
virtual void OnTestStart(const TestInfo& aTestInfo) override {
|
||||
mTestInfo = &aTestInfo;
|
||||
MOZ_PRINT("TEST-START | %s.%s\n", mTestInfo->test_case_name(),
|
||||
mTestInfo->name());
|
||||
mTestInfo->name());
|
||||
}
|
||||
virtual void OnTestPartResult(
|
||||
const TestPartResult& aTestPartResult) override {
|
||||
MOZ_PRINT("TEST-%s | %s.%s | %s @ %s:%i\n",
|
||||
!aTestPartResult.failed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
mTestInfo ? mTestInfo->test_case_name() : "?",
|
||||
mTestInfo ? mTestInfo->name() : "?", aTestPartResult.summary(),
|
||||
aTestPartResult.file_name(), aTestPartResult.line_number());
|
||||
!aTestPartResult.failed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
mTestInfo ? mTestInfo->test_case_name() : "?",
|
||||
mTestInfo ? mTestInfo->name() : "?", aTestPartResult.summary(),
|
||||
aTestPartResult.file_name(), aTestPartResult.line_number());
|
||||
}
|
||||
virtual void OnTestEnd(const TestInfo& aTestInfo) override {
|
||||
MOZ_PRINT("TEST-%s | %s.%s | test completed (time: %llims)\n",
|
||||
aTestInfo.result()->Passed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
aTestInfo.test_case_name(), aTestInfo.name(),
|
||||
aTestInfo.result()->elapsed_time());
|
||||
aTestInfo.result()->Passed() ? "PASS" : "UNEXPECTED-FAIL",
|
||||
aTestInfo.test_case_name(), aTestInfo.name(),
|
||||
aTestInfo.result()->elapsed_time());
|
||||
MOZ_ASSERT(&aTestInfo == mTestInfo);
|
||||
mTestInfo = nullptr;
|
||||
}
|
||||
@ -134,8 +135,8 @@ int RunGTestFunc(int* argc, char** argv) {
|
||||
if (!file) {
|
||||
nsCOMPtr<nsIProperties> dirsvc =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
|
||||
nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, NS_GET_IID(nsIFile),
|
||||
getter_AddRefs(file));
|
||||
nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR,
|
||||
NS_GET_IID(nsIFile), getter_AddRefs(file));
|
||||
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
||||
}
|
||||
crashreporter->SetEnabled(true);
|
||||
|
@ -3,7 +3,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifdef mozilla_StartupTimeline_Event
|
||||
// clang-format off
|
||||
// clang-format off
|
||||
mozilla_StartupTimeline_Event(PROCESS_CREATION, "process")
|
||||
mozilla_StartupTimeline_Event(START, "start")
|
||||
mozilla_StartupTimeline_Event(MAIN, "main")
|
||||
@ -27,7 +27,7 @@
|
||||
// of shutdown
|
||||
mozilla_StartupTimeline_Event(QUIT_APPLICATION, "quitApplication")
|
||||
mozilla_StartupTimeline_Event(PROFILE_BEFORE_CHANGE, "profileBeforeChange")
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
# ifndef mozilla_StartupTimeline
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user