mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Bug 1519636 - Automatically reformat recent changes using clang-format r=Ehsan
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D60354 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
8726edbce5
commit
187e9bafaf
@ -20,9 +20,9 @@ namespace dom {
|
||||
class ChildProcessChannelListener final {
|
||||
NS_INLINE_DECL_REFCOUNTING(ChildProcessChannelListener)
|
||||
|
||||
using Callback = std::function<void(nsIChannel*,
|
||||
nsTArray<net::DocumentChannelRedirect>&&,
|
||||
uint32_t, nsDOMNavigationTiming*)>;
|
||||
using Callback =
|
||||
std::function<void(nsIChannel*, nsTArray<net::DocumentChannelRedirect>&&,
|
||||
uint32_t, nsDOMNavigationTiming*)>;
|
||||
|
||||
void RegisterCallback(uint64_t aIdentifier, Callback&& aCallback);
|
||||
|
||||
|
@ -601,7 +601,8 @@ void CustomElementRegistry::UpgradeCandidates(
|
||||
return;
|
||||
}
|
||||
|
||||
mozilla::UniquePtr<nsTHashtable<nsRefPtrHashKey<nsIWeakReference>>> candidates;
|
||||
mozilla::UniquePtr<nsTHashtable<nsRefPtrHashKey<nsIWeakReference>>>
|
||||
candidates;
|
||||
if (mCandidatesMap.Remove(aKey, &candidates)) {
|
||||
MOZ_ASSERT(candidates);
|
||||
CustomElementReactionsStack* reactionsStack =
|
||||
|
@ -191,8 +191,8 @@ class nsDOMNavigationTiming final : public mozilla::RelativeTimeline {
|
||||
|
||||
bool IsTopLevelContentDocumentInContentProcess() const;
|
||||
|
||||
// Should those be amended, the IPC serializer should be updated
|
||||
// accordingly.
|
||||
// Should those be amended, the IPC serializer should be updated
|
||||
// accordingly.
|
||||
mozilla::WeakPtr<nsDocShell> mDocShell;
|
||||
|
||||
nsCOMPtr<nsIURI> mUnloadedURI;
|
||||
|
@ -885,7 +885,7 @@ bool nsFrameLoader::Show(nsSubDocumentFrame* frame) {
|
||||
|
||||
ds->SetScrollbarPreference(GetScrollbarPreference(mOwnerContent));
|
||||
const bool marginsChanged =
|
||||
ds->UpdateFrameMargins(GetMarginAttributes(mOwnerContent));
|
||||
ds->UpdateFrameMargins(GetMarginAttributes(mOwnerContent));
|
||||
if (PresShell* presShell = ds->GetPresShell()) {
|
||||
// Ensure root scroll frame is reflowed in case margins have changed
|
||||
if (marginsChanged) {
|
||||
|
@ -109,10 +109,8 @@ class nsIStyleSheetLinkingElement : public nsISupports {
|
||||
already_AddRefed<nsIPrincipal> aTriggeringPrincipal,
|
||||
already_AddRefed<nsIReferrerInfo> aReferrerInfo,
|
||||
mozilla::CORSMode, const nsAString& aTitle,
|
||||
const nsAString& aMedia,
|
||||
const nsAString& aIntegrity,
|
||||
const nsAString& aNonce,
|
||||
HasAlternateRel, IsInline,
|
||||
const nsAString& aMedia, const nsAString& aIntegrity,
|
||||
const nsAString& aNonce, HasAlternateRel, IsInline,
|
||||
IsExplicitlyEnabled);
|
||||
|
||||
~SheetInfo();
|
||||
|
@ -251,7 +251,8 @@ inline void AssignFromStringBuffer(nsStringBuffer* buffer, size_t len,
|
||||
buffer->ToString(len, dest);
|
||||
}
|
||||
|
||||
template <typename T, typename std::enable_if_t<std::is_same<typename T::char_type, char16_t>::value>* = nullptr>
|
||||
template <typename T, typename std::enable_if_t<std::is_same<
|
||||
typename T::char_type, char16_t>::value>* = nullptr>
|
||||
inline bool AssignJSString(JSContext* cx, T& dest, JSString* s) {
|
||||
size_t len = JS::GetStringLength(s);
|
||||
static_assert(js::MaxStringLength < (1 << 30),
|
||||
@ -285,7 +286,8 @@ inline bool AssignJSString(JSContext* cx, T& dest, JSString* s) {
|
||||
}
|
||||
|
||||
// Specialization for UTF8String.
|
||||
template <typename T, typename std::enable_if_t<std::is_same<typename T::char_type, char>::value>* = nullptr>
|
||||
template <typename T, typename std::enable_if_t<std::is_same<
|
||||
typename T::char_type, char>::value>* = nullptr>
|
||||
inline bool AssignJSString(JSContext* cx, T& dest, JSString* s) {
|
||||
using namespace mozilla;
|
||||
CheckedInt<size_t> bufLen(JS::GetStringLength(s));
|
||||
|
@ -59,10 +59,9 @@ void BroadcastChannelService::RegisterActor(
|
||||
AssertIsOnBackgroundThread();
|
||||
MOZ_ASSERT(aParent);
|
||||
|
||||
const auto& parents =
|
||||
mAgents.LookupForAdd(aOriginChannelKey).OrInsert([]() {
|
||||
return new nsTArray<BroadcastChannelParent*>();
|
||||
});
|
||||
const auto& parents = mAgents.LookupForAdd(aOriginChannelKey).OrInsert([]() {
|
||||
return new nsTArray<BroadcastChannelParent*>();
|
||||
});
|
||||
|
||||
MOZ_ASSERT(!parents->Contains(aParent));
|
||||
parents->AppendElement(aParent);
|
||||
|
@ -681,8 +681,7 @@ class RawBuffer {
|
||||
* If aTakeData is true, RawBuffer will delete[] the memory when destroyed.
|
||||
*/
|
||||
RawBuffer(size_t len, T* data, bool aTakeData = false)
|
||||
: mData(data), mLength(len), mOwnsData(aTakeData) {
|
||||
}
|
||||
: mData(data), mLength(len), mOwnsData(aTakeData) {}
|
||||
|
||||
RawBuffer(size_t len, RefPtr<mozilla::ipc::SharedMemoryBasic>& aSmem)
|
||||
: mSmem(aSmem), mData(aSmem->memory()), mLength(len), mOwnsData(false) {
|
||||
|
@ -2932,7 +2932,7 @@ void HTMLInputElement::Blur(ErrorResult& aError) {
|
||||
}
|
||||
|
||||
void HTMLInputElement::Focus(const FocusOptions& aOptions,
|
||||
CallerType aCallerType, ErrorResult& aError) {
|
||||
CallerType aCallerType, ErrorResult& aError) {
|
||||
if ((mType == NS_FORM_INPUT_TIME || mType == NS_FORM_INPUT_DATE) &&
|
||||
!IsExperimentalMobileType(mType)) {
|
||||
if (Element* dateTimeBoxElement = GetDateTimeBoxElement()) {
|
||||
|
@ -188,7 +188,6 @@ void WindowGlobalParent::GetContentBlockingLog(nsAString& aLog) {
|
||||
aLog.Assign(std::move(log));
|
||||
}
|
||||
|
||||
|
||||
mozilla::ipc::IPCResult WindowGlobalParent::RecvLoadURI(
|
||||
dom::BrowsingContext* aTargetBC, nsDocShellLoadState* aLoadState,
|
||||
bool aSetNavigating) {
|
||||
@ -311,7 +310,7 @@ void WindowGlobalParent::NotifyContentBlockingEvent(
|
||||
MOZ_ASSERT_IF(isCookiesBlockedTracker && !aBlocked, aReason.isSome());
|
||||
MOZ_DIAGNOSTIC_ASSERT(XRE_IsParentProcess());
|
||||
// TODO: temporarily remove this until we find the root case of Bug 1609144
|
||||
//MOZ_DIAGNOSTIC_ASSERT_IF(XRE_IsE10sParentProcess(), !IsInProcess());
|
||||
// MOZ_DIAGNOSTIC_ASSERT_IF(XRE_IsE10sParentProcess(), !IsInProcess());
|
||||
|
||||
// Return early if this WindowGlobalParent is in process.
|
||||
if (IsInProcess()) {
|
||||
|
@ -3666,9 +3666,9 @@ void DatastoreWriteOptimizer::ApplyAndReset(
|
||||
// about the UpdateWithMove flag.
|
||||
|
||||
aOrderedItems.RemoveElementAt(index);
|
||||
entry.Data() = MakeUnique<InsertItemInfo>(updateItemInfo->SerialNumber(),
|
||||
updateItemInfo->GetKey(),
|
||||
updateItemInfo->GetValue());
|
||||
entry.Data() = MakeUnique<InsertItemInfo>(
|
||||
updateItemInfo->SerialNumber(), updateItemInfo->GetKey(),
|
||||
updateItemInfo->GetValue());
|
||||
} else {
|
||||
item.value() = updateItemInfo->GetValue();
|
||||
entry.Remove();
|
||||
|
@ -1210,13 +1210,15 @@ bool RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate) {
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
const auto& domainInfo = mDomainMap.LookupForAdd(domain).OrInsert([&domain, parent]() {
|
||||
NS_ASSERTION(!parent, "Shouldn't have a parent here!");
|
||||
Unused << parent; // silence clang -Wunused-lambda-capture in opt builds
|
||||
WorkerDomainInfo* wdi = new WorkerDomainInfo();
|
||||
wdi->mDomain = domain;
|
||||
return wdi;
|
||||
});
|
||||
const auto& domainInfo =
|
||||
mDomainMap.LookupForAdd(domain).OrInsert([&domain, parent]() {
|
||||
NS_ASSERTION(!parent, "Shouldn't have a parent here!");
|
||||
Unused
|
||||
<< parent; // silence clang -Wunused-lambda-capture in opt builds
|
||||
WorkerDomainInfo* wdi = new WorkerDomainInfo();
|
||||
wdi->mDomain = domain;
|
||||
return wdi;
|
||||
});
|
||||
|
||||
queued = gMaxWorkersPerDomain &&
|
||||
domainInfo->ActiveWorkerCount() >= gMaxWorkersPerDomain &&
|
||||
@ -1277,9 +1279,8 @@ bool RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate) {
|
||||
if (!isServiceWorker) {
|
||||
// Service workers are excluded since their lifetime is separate from
|
||||
// that of dom windows.
|
||||
const auto& windowArray =
|
||||
mWindowMap.LookupForAdd(window).OrInsert(
|
||||
[]() { return new nsTArray<WorkerPrivate*>(1); });
|
||||
const auto& windowArray = mWindowMap.LookupForAdd(window).OrInsert(
|
||||
[]() { return new nsTArray<WorkerPrivate*>(1); });
|
||||
if (!windowArray->Contains(aWorkerPrivate)) {
|
||||
windowArray->AppendElement(aWorkerPrivate);
|
||||
} else {
|
||||
|
@ -2194,7 +2194,6 @@ WorkerPrivate::WorkerPrivate(
|
||||
mJSSettings.content.realmOptions.creationOptions().setToSourceEnabled(
|
||||
UsesSystemPrincipal());
|
||||
|
||||
|
||||
if (mIsSecureContext) {
|
||||
mJSSettings.chrome.realmOptions.creationOptions().setSecureContext(true);
|
||||
mJSSettings.content.realmOptions.creationOptions().setSecureContext(true);
|
||||
|
@ -193,8 +193,8 @@ ChangeStyleTransaction::DoTransaction() {
|
||||
} else {
|
||||
values.Assign(mValue);
|
||||
}
|
||||
rv = cssDecl->SetProperty(propertyNameString,
|
||||
NS_ConvertUTF16toUTF8(values), priority);
|
||||
rv = cssDecl->SetProperty(propertyNameString, NS_ConvertUTF16toUTF8(values),
|
||||
priority);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ inline bool IsIgnorableCharacter(char16_t ch) {
|
||||
// part of a word, and are otherwise punctuation.
|
||||
|
||||
inline bool IsConditionalPunctuation(char ch) {
|
||||
return (ch == '\'' || // RIGHT SINGLE QUOTATION MARK
|
||||
return (ch == '\'' || // RIGHT SINGLE QUOTATION MARK
|
||||
ch == static_cast<char>(0xB7)); // MIDDLE DOT
|
||||
}
|
||||
|
||||
@ -610,7 +610,8 @@ bool WordSplitState<T>::ShouldSkipWord(int32_t aStart, int32_t aLength) const {
|
||||
|
||||
// check to see if the word contains a digit
|
||||
for (int32_t i = aStart; i < last; i++) {
|
||||
if (mozilla::unicode::GetGenCategory(GetUnicharAt(i)) == nsUGenCategory::kNumber) {
|
||||
if (mozilla::unicode::GetGenCategory(GetUnicharAt(i)) ==
|
||||
nsUGenCategory::kNumber) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -3538,7 +3538,8 @@ void AsyncPanZoomController::RecordScrollPayload(const TimeStamp& aTimeStamp) {
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::StartTouch(const ParentLayerPoint& aPoint, uint32_t aTime) {
|
||||
void AsyncPanZoomController::StartTouch(const ParentLayerPoint& aPoint,
|
||||
uint32_t aTime) {
|
||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||
mX.StartTouch(aPoint.x, aTime);
|
||||
mY.StartTouch(aPoint.y, aTime);
|
||||
|
@ -843,7 +843,8 @@ class AsyncPanZoomController {
|
||||
void TrackTouch(const MultiTouchInput& aEvent);
|
||||
|
||||
/**
|
||||
* Register the start of a touch or pan gesture at the given position and time.
|
||||
* Register the start of a touch or pan gesture at the given position and
|
||||
* time.
|
||||
*/
|
||||
void StartTouch(const ParentLayerPoint& aPoint, uint32_t aTime);
|
||||
|
||||
|
@ -739,7 +739,8 @@ mozilla::ipc::IPCResult ContentCompositorBridgeParent::RecvPreferredDXGIAdapter(
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
||||
RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetCompositorDevice();
|
||||
RefPtr<ID3D11Device> device =
|
||||
gfx::DeviceManagerDx::Get()->GetCompositorDevice();
|
||||
if (!device) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
@ -53,11 +53,11 @@ class gfxWindowsNativeDrawing {
|
||||
* } while (nativeDraw.ShouldRenderAgain());
|
||||
* nativeDraw.PaintToContext();
|
||||
*/
|
||||
gfxWindowsNativeDrawing(gfxContext* ctx, const gfxRect& nativeRect,
|
||||
uint32_t nativeDrawFlags =
|
||||
CANNOT_DRAW_TO_COLOR_ALPHA |
|
||||
CANNOT_AXIS_ALIGNED_SCALE |
|
||||
CANNOT_COMPLEX_TRANSFORM);
|
||||
gfxWindowsNativeDrawing(
|
||||
gfxContext* ctx, const gfxRect& nativeRect,
|
||||
uint32_t nativeDrawFlags = CANNOT_DRAW_TO_COLOR_ALPHA |
|
||||
CANNOT_AXIS_ALIGNED_SCALE |
|
||||
CANNOT_COMPLEX_TRANSFORM);
|
||||
|
||||
/* Returns a HDC which may be used for native drawing. This HDC is valid
|
||||
* until EndNativeDrawing is called; if it is used for drawing after that
|
||||
|
@ -551,7 +551,7 @@ enum class VRTelemetryId : uint8_t {
|
||||
TOTAL = 4,
|
||||
};
|
||||
|
||||
enum class VRTelemetryInstallFrom: uint8_t {
|
||||
enum class VRTelemetryInstallFrom : uint8_t {
|
||||
User = 0,
|
||||
FxR = 1,
|
||||
HTC = 2,
|
||||
@ -559,7 +559,7 @@ enum class VRTelemetryInstallFrom: uint8_t {
|
||||
TOTAL = 4,
|
||||
};
|
||||
|
||||
enum class VRTelemetryEntryMethod: uint8_t {
|
||||
enum class VRTelemetryEntryMethod : uint8_t {
|
||||
SystemBtn = 0,
|
||||
Library = 1,
|
||||
Gaze = 2,
|
||||
|
@ -433,8 +433,8 @@ void DCSurface::UpdateAllocatedRect() {
|
||||
for (auto it = mDCLayers.begin(); it != mDCLayers.end(); ++it) {
|
||||
RECT rect;
|
||||
|
||||
rect.left = (LONG) (VIRTUAL_OFFSET + it->first.mX * mTileSize.width);
|
||||
rect.top = (LONG) (VIRTUAL_OFFSET + it->first.mY * mTileSize.height);
|
||||
rect.left = (LONG)(VIRTUAL_OFFSET + it->first.mX * mTileSize.width);
|
||||
rect.top = (LONG)(VIRTUAL_OFFSET + it->first.mY * mTileSize.height);
|
||||
rect.right = rect.left + mTileSize.width;
|
||||
rect.bottom = rect.top + mTileSize.height;
|
||||
|
||||
|
@ -14,13 +14,13 @@
|
||||
#include "mozilla/Assertions.h" // MOZ_ASSERT
|
||||
#include "mozilla/Attributes.h" // MOZ_MUST_USE
|
||||
|
||||
#include "js/Promise.h" // JS::{Resolve,Reject}Promise, JS::PromiseState
|
||||
#include "js/RootingAPI.h" // JS::Rooted, JS::{,Mutable}Handle
|
||||
#include "js/Value.h" // JS::UndefinedHandleValue, JS::Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::Call
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "js/Promise.h" // JS::{Resolve,Reject}Promise, JS::PromiseState
|
||||
#include "js/RootingAPI.h" // JS::Rooted, JS::{,Mutable}Handle
|
||||
#include "js/Value.h" // JS::UndefinedHandleValue, JS::Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::Call
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "vm/Compartment-inl.h" // JS::Compartment::wrap
|
||||
|
@ -28,10 +28,7 @@ class PipeToState : public NativeObject {
|
||||
/**
|
||||
* Memory layout for PipeToState instances.
|
||||
*/
|
||||
enum Slots {
|
||||
Slot_Flags,
|
||||
SlotCount
|
||||
};
|
||||
enum Slots { Slot_Flags, SlotCount };
|
||||
|
||||
private:
|
||||
enum Flags {
|
||||
|
@ -25,14 +25,14 @@
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource
|
||||
#include "js/Value.h" // JS::{,Int32,Object}Value, JS::UndefinedHandleValue
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::Call, js::GetAndClearExceptionAndStack
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::Call, js::GetAndClearExceptionAndStack
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Runtime.h" // JSAtomState
|
||||
#include "vm/SavedFrame.h" // js::SavedFrame
|
||||
#include "vm/Runtime.h" // JSAtomState
|
||||
#include "vm/SavedFrame.h" // js::SavedFrame
|
||||
|
||||
#include "builtin/streams/HandlerFunction-inl.h" // js::NewHandler
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall
|
||||
|
@ -25,13 +25,13 @@
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "js/Stream.h" // JS::ReadableStreamUnderlyingSource, JS::ReadableStreamMode
|
||||
#include "js/Value.h" // JS::Value, JS::{Boolean,Object}Value, JS::UndefinedHandleValue
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSFunction.h" // JSFunction, js::NewNativeFunction
|
||||
#include "vm/NativeObject.h" // js::NativeObject
|
||||
#include "vm/ObjectGroup.h" // js::GenericObject
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSFunction.h" // JSFunction, js::NewNativeFunction
|
||||
#include "vm/NativeObject.h" // js::NativeObject
|
||||
#include "vm/ObjectGroup.h" // js::GenericObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Realm.h" // JS::Realm
|
||||
#include "vm/StringType.h" // js::PropertyName
|
||||
#include "vm/Realm.h" // JS::Realm
|
||||
#include "vm/StringType.h" // js::PropertyName
|
||||
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::{Reject,Resolve}UnwrappedPromiseWithUndefined, js::SetSettledPromiseIsHandled
|
||||
#include "builtin/streams/ReadableStreamReader-inl.h" // js::js::UnwrapReaderFromStream{,NoThrow}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "jsapi.h" // JS_SetPrivate
|
||||
|
||||
#include "builtin/Array.h" // js::NewDenseFullyAllocatedArray
|
||||
#include "builtin/Array.h" // js::NewDenseFullyAllocatedArray
|
||||
#include "builtin/Promise.h" // js::RejectPromiseWithPendingError
|
||||
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
|
||||
#include "builtin/streams/ReadableStreamController.h" // js::ReadableStream{,Default}Controller
|
||||
|
@ -18,11 +18,11 @@
|
||||
#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamController
|
||||
#include "builtin/streams/ReadableStreamInternals.h" // js::ReadableStream{Cancel,CreateReadResult}
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "js/Value.h" // JS::Value, JS::UndefinedHandleValue
|
||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "js/Value.h" // JS::Value, JS::UndefinedHandleValue
|
||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Runtime.h" // JSRuntime
|
||||
#include "vm/Runtime.h" // JSRuntime
|
||||
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::SetSettledPromiseIsHandled
|
||||
#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapInternalSlot
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include "builtin/streams/TeeState.h"
|
||||
|
||||
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
|
||||
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "js/Class.h" // JSClass, JSCLASS_HAS_RESERVED_SLOTS
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "vm/JSObject-inl.h" // js::NewBuiltinClassInstance
|
||||
|
@ -15,8 +15,8 @@
|
||||
|
||||
#include "builtin/streams/ReadableStreamController.h" // js::ReadableStreamDefaultController
|
||||
#include "js/Class.h" // JSClass
|
||||
#include "js/Value.h" // JS::{Int32,Object}Value
|
||||
#include "vm/NativeObject.h" // js::NativeObject
|
||||
#include "js/Value.h" // JS::{Int32,Object}Value
|
||||
#include "vm/NativeObject.h" // js::NativeObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
namespace js {
|
||||
|
@ -22,12 +22,12 @@
|
||||
#include "js/Promise.h" // JS::AddPromiseReactions
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "js/Value.h" // JS::{,Int32,Magic,Object}Value, JS::UndefinedHandleValue, JS_WRITABLESTREAM_CLOSE_RECORD
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/JSObject.h" // JSObject
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
#include "vm/Runtime.h" // JSAtomState
|
||||
#include "vm/Runtime.h" // JSAtomState
|
||||
|
||||
#include "builtin/streams/HandlerFunction-inl.h" // js::TargetFromHandler
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall
|
||||
|
@ -22,10 +22,10 @@
|
||||
#include "js/CallArgs.h" // JS::CallArgs{,FromVp}
|
||||
#include "js/Class.h" // js::ClassSpec, JS_NULL_CLASS_OPS
|
||||
#include "js/PropertySpec.h" // JS{Function,Property}Spec, JS_{FS,PS}_END, JS_{FN,PSG}
|
||||
#include "js/RootingAPI.h" // JS::Handle
|
||||
#include "js/Value.h" // JS::Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "js/RootingAPI.h" // JS::Handle
|
||||
#include "js/Value.h" // JS::Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::SetSettledPromiseIsHandled
|
||||
|
@ -25,9 +25,9 @@
|
||||
#include "js/Promise.h" // JS::{Reject,Resolve}Promise
|
||||
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
|
||||
#include "js/Value.h" // JS::Value, JS::ObjecValue, JS::UndefinedHandleValue
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/List.h" // js::ListObject
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "builtin/streams/HandlerFunction-inl.h" // js::NewHandler, js::TargetFromHandler
|
||||
|
@ -21,10 +21,10 @@
|
||||
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::WritableStreamDefaultWriter
|
||||
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStream{Abort,CloseQueuedOrInFlight}
|
||||
#include "js/Promise.h" // JS::PromiseState
|
||||
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "js/Value.h" // JS::Value, JS::{Int32,Null}Value
|
||||
#include "vm/Compartment.h" // JS::Compartment
|
||||
#include "vm/Interpreter.h" // js::GetAndClearException
|
||||
#include "vm/JSContext.h" // JSContext
|
||||
#include "vm/PromiseObject.h" // js::PromiseObject
|
||||
|
||||
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::ResolveUnwrappedPromiseWithUndefined, js::SetSettledPromiseIsHandled
|
||||
|
@ -33,38 +33,38 @@
|
||||
#include "js/Conversions.h" // for ToObject
|
||||
#include "js/HeapAPI.h" // for IsInsideNursery
|
||||
#include "js/Promise.h" // for PromiseState
|
||||
#include "js/Proxy.h" // for PropertyDescriptor
|
||||
#include "js/StableStringChars.h" // for AutoStableStringChars
|
||||
#include "proxy/ScriptedProxyHandler.h" // for ScriptedProxyHandler
|
||||
#include "vm/ArgumentsObject.h" // for ARGS_LENGTH_MAX
|
||||
#include "vm/ArrayObject.h" // for ArrayObject
|
||||
#include "vm/AsyncFunction.h" // for AsyncGeneratorObject
|
||||
#include "vm/AsyncIteration.h" // for AsyncFunctionGeneratorObject
|
||||
#include "vm/BytecodeUtil.h" // for JSDVG_SEARCH_STACK
|
||||
#include "vm/Compartment.h" // for Compartment
|
||||
#include "vm/EnvironmentObject.h" // for GetDebugEnvironmentForFunction
|
||||
#include "vm/ErrorObject.h" // for JSObject::is, ErrorObject
|
||||
#include "vm/GeneratorObject.h" // for AbstractGeneratorObject
|
||||
#include "vm/GlobalObject.h" // for JSObject::is, GlobalObject
|
||||
#include "vm/Instrumentation.h" // for RealmInstrumentation
|
||||
#include "vm/Interpreter.h" // for Call
|
||||
#include "vm/JSAtom.h" // for Atomize, js_apply_str
|
||||
#include "vm/JSContext.h" // for JSContext, ReportValueError
|
||||
#include "vm/JSFunction.h" // for JSFunction
|
||||
#include "vm/JSScript.h" // for JSScript
|
||||
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
|
||||
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
|
||||
#include "vm/ObjectOperations.h" // for DefineProperty
|
||||
#include "vm/PromiseObject.h" // for js::PromiseObject
|
||||
#include "vm/Realm.h" // for AutoRealm, ErrorCopier, Realm
|
||||
#include "vm/Runtime.h" // for JSAtomState
|
||||
#include "vm/SavedFrame.h" // for SavedFrame
|
||||
#include "vm/Scope.h" // for PositionalFormalParameterIter
|
||||
#include "vm/SelfHosting.h" // for GetClonedSelfHostedFunctionName
|
||||
#include "vm/Shape.h" // for Shape
|
||||
#include "vm/Stack.h" // for InvokeArgs
|
||||
#include "vm/StringType.h" // for JSAtom, PropertyName
|
||||
#include "vm/WrapperObject.h" // for JSObject::is, WrapperObject
|
||||
#include "js/Proxy.h" // for PropertyDescriptor
|
||||
#include "js/StableStringChars.h" // for AutoStableStringChars
|
||||
#include "proxy/ScriptedProxyHandler.h" // for ScriptedProxyHandler
|
||||
#include "vm/ArgumentsObject.h" // for ARGS_LENGTH_MAX
|
||||
#include "vm/ArrayObject.h" // for ArrayObject
|
||||
#include "vm/AsyncFunction.h" // for AsyncGeneratorObject
|
||||
#include "vm/AsyncIteration.h" // for AsyncFunctionGeneratorObject
|
||||
#include "vm/BytecodeUtil.h" // for JSDVG_SEARCH_STACK
|
||||
#include "vm/Compartment.h" // for Compartment
|
||||
#include "vm/EnvironmentObject.h" // for GetDebugEnvironmentForFunction
|
||||
#include "vm/ErrorObject.h" // for JSObject::is, ErrorObject
|
||||
#include "vm/GeneratorObject.h" // for AbstractGeneratorObject
|
||||
#include "vm/GlobalObject.h" // for JSObject::is, GlobalObject
|
||||
#include "vm/Instrumentation.h" // for RealmInstrumentation
|
||||
#include "vm/Interpreter.h" // for Call
|
||||
#include "vm/JSAtom.h" // for Atomize, js_apply_str
|
||||
#include "vm/JSContext.h" // for JSContext, ReportValueError
|
||||
#include "vm/JSFunction.h" // for JSFunction
|
||||
#include "vm/JSScript.h" // for JSScript
|
||||
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
|
||||
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
|
||||
#include "vm/ObjectOperations.h" // for DefineProperty
|
||||
#include "vm/PromiseObject.h" // for js::PromiseObject
|
||||
#include "vm/Realm.h" // for AutoRealm, ErrorCopier, Realm
|
||||
#include "vm/Runtime.h" // for JSAtomState
|
||||
#include "vm/SavedFrame.h" // for SavedFrame
|
||||
#include "vm/Scope.h" // for PositionalFormalParameterIter
|
||||
#include "vm/SelfHosting.h" // for GetClonedSelfHostedFunctionName
|
||||
#include "vm/Shape.h" // for Shape
|
||||
#include "vm/Stack.h" // for InvokeArgs
|
||||
#include "vm/StringType.h" // for JSAtom, PropertyName
|
||||
#include "vm/WrapperObject.h" // for JSObject::is, WrapperObject
|
||||
|
||||
#include "vm/Compartment-inl.h" // for Compartment::wrap
|
||||
#include "vm/JSAtom-inl.h" // for ValueToId
|
||||
|
@ -162,7 +162,6 @@ class FreeSpan {
|
||||
* index calculation easier; see TenuredCell::indexInArena() for details.
|
||||
*/
|
||||
class Arena {
|
||||
|
||||
/*
|
||||
* The first span of free things in the arena. Most of these spans are
|
||||
* stored as offsets in free regions of the data array, and most operations
|
||||
|
@ -901,7 +901,7 @@ static const JSStdName builtin_property_names[] = {
|
||||
|
||||
static bool SkipUneval(JSContext* cx, jsid id) {
|
||||
return !cx->realm()->creationOptions().getToSourceEnabled() &&
|
||||
id == NameToId(cx->names().uneval);
|
||||
id == NameToId(cx->names().uneval);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API bool JS_ResolveStandardClass(JSContext* cx, HandleObject obj,
|
||||
@ -1156,7 +1156,8 @@ JS_PUBLIC_API JSProtoKey JS_IdToProtoKey(JSContext* cx, HandleId id) {
|
||||
return JSProto_Null;
|
||||
}
|
||||
|
||||
static_assert(mozilla::ArrayLength(standard_class_names) == JSProto_LIMIT + 1);
|
||||
static_assert(mozilla::ArrayLength(standard_class_names) ==
|
||||
JSProto_LIMIT + 1);
|
||||
return static_cast<JSProtoKey>(stdnm - standard_class_names);
|
||||
}
|
||||
|
||||
|
@ -1656,25 +1656,25 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_CALLER bool Interpret(JSContext* cx,
|
||||
* indirect goto (aka a threaded interpreter), which is technically
|
||||
* non-standard but is supported by all of our supported compilers.
|
||||
*/
|
||||
# define INTERPRETER_LOOP()
|
||||
# define CASE(OP) label_##OP:
|
||||
# define DEFAULT() \
|
||||
#define INTERPRETER_LOOP()
|
||||
#define CASE(OP) label_##OP:
|
||||
#define DEFAULT() \
|
||||
label_default:
|
||||
# define DISPATCH_TO(OP) goto* addresses[(OP)]
|
||||
#define DISPATCH_TO(OP) goto* addresses[(OP)]
|
||||
|
||||
# define LABEL(X) (&&label_##X)
|
||||
#define LABEL(X) (&&label_##X)
|
||||
|
||||
// Use addresses instead of offsets to optimize for runtime speed over
|
||||
// load-time relocation overhead.
|
||||
static const void* const addresses[EnableInterruptsPseudoOpcode + 1] = {
|
||||
# define OPCODE_LABEL(op, ...) LABEL(op),
|
||||
#define OPCODE_LABEL(op, ...) LABEL(op),
|
||||
FOR_EACH_OPCODE(OPCODE_LABEL)
|
||||
# undef OPCODE_LABEL
|
||||
# define TRAILING_LABEL(v) \
|
||||
((v) == EnableInterruptsPseudoOpcode ? LABEL(EnableInterruptsPseudoOpcode) \
|
||||
: LABEL(default)),
|
||||
#undef OPCODE_LABEL
|
||||
#define TRAILING_LABEL(v) \
|
||||
((v) == EnableInterruptsPseudoOpcode ? LABEL(EnableInterruptsPseudoOpcode) \
|
||||
: LABEL(default)),
|
||||
FOR_EACH_TRAILING_UNUSED_OPCODE(TRAILING_LABEL)
|
||||
# undef TRAILING_LABEL
|
||||
#undef TRAILING_LABEL
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -893,8 +893,8 @@ void js::ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v,
|
||||
|
||||
if (!reportScanStack) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_CANT_CONVERT_TO,
|
||||
NullOrUndefinedToCharZ(v), "object");
|
||||
JSMSG_CANT_CONVERT_TO, NullOrUndefinedToCharZ(v),
|
||||
"object");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -938,8 +938,7 @@ void js::ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v,
|
||||
|
||||
if (!reportScanStack) {
|
||||
JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, JSMSG_PROPERTY_FAIL,
|
||||
keyStr.get(),
|
||||
NullOrUndefinedToCharZ(v));
|
||||
keyStr.get(), NullOrUndefinedToCharZ(v));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -957,8 +956,8 @@ void js::ReportIsNullOrUndefinedForPropertyAccess(JSContext* cx, HandleValue v,
|
||||
}
|
||||
|
||||
JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_PROPERTY_FAIL_EXPR, keyStr.get(),
|
||||
bytes.get(), NullOrUndefinedToCharZ(v));
|
||||
JSMSG_PROPERTY_FAIL_EXPR, keyStr.get(), bytes.get(),
|
||||
NullOrUndefinedToCharZ(v));
|
||||
}
|
||||
|
||||
bool js::ReportValueErrorFlags(JSContext* cx, unsigned flags,
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
#include "jsfriendapi.h" // CheckRecursionLimit
|
||||
|
||||
#include "builtin/Array.h" // ArrayToSource
|
||||
#include "builtin/Array.h" // ArrayToSource
|
||||
#include "builtin/Boolean.h" // BooleanToString
|
||||
#include "builtin/Object.h" // ObjectToSource
|
||||
#include "gc/Allocator.h" // CanGC
|
||||
#include "js/Symbol.h" // SymbolCode, JS::WellKnownSymbolLimit
|
||||
#include "builtin/Object.h" // ObjectToSource
|
||||
#include "gc/Allocator.h" // CanGC
|
||||
#include "js/Symbol.h" // SymbolCode, JS::WellKnownSymbolLimit
|
||||
#include "js/TypeDecls.h" // Rooted{Function, Object, String, Value}, HandleValue, Latin1Char
|
||||
#include "js/Utility.h" // UniqueChars
|
||||
#include "js/Value.h" // JS::Value
|
||||
|
@ -279,9 +279,9 @@ bool nsCounterManager::AddCounterChanges(nsIFrame* aFrame) {
|
||||
|
||||
nsCounterList* nsCounterManager::CounterListFor(nsAtom* aCounterName) {
|
||||
MOZ_ASSERT(aCounterName);
|
||||
return mNames.LookupForAdd(aCounterName).OrInsert([]() {
|
||||
return new nsCounterList();
|
||||
}).get();
|
||||
return mNames.LookupForAdd(aCounterName)
|
||||
.OrInsert([]() { return new nsCounterList(); })
|
||||
.get();
|
||||
}
|
||||
|
||||
void nsCounterManager::RecalcAll() {
|
||||
|
@ -89,9 +89,8 @@ struct nsCounterUseNode : public nsCounterNode {
|
||||
}
|
||||
|
||||
// args go directly to member variables here and of nsGenConNode
|
||||
nsCounterUseNode(mozilla::CounterStylePtr aCounterStyle,
|
||||
nsString aSeparator, uint32_t aContentIndex,
|
||||
bool aAllCounters)
|
||||
nsCounterUseNode(mozilla::CounterStylePtr aCounterStyle, nsString aSeparator,
|
||||
uint32_t aContentIndex, bool aAllCounters)
|
||||
: nsCounterNode(aContentIndex, USE),
|
||||
mCounterStyle(std::move(aCounterStyle)),
|
||||
mSeparator(std::move(aSeparator)),
|
||||
|
@ -37,11 +37,9 @@ using mozilla::dom::Document;
|
||||
|
||||
already_AddRefed<nsIContentViewer> NS_NewContentViewer();
|
||||
|
||||
static const char* const gHTMLTypes[] = {TEXT_HTML,
|
||||
VIEWSOURCE_CONTENT_TYPE,
|
||||
static const char* const gHTMLTypes[] = {TEXT_HTML, VIEWSOURCE_CONTENT_TYPE,
|
||||
APPLICATION_XHTML_XML,
|
||||
APPLICATION_WAPXHTML_XML,
|
||||
0};
|
||||
APPLICATION_WAPXHTML_XML, 0};
|
||||
|
||||
static const char* const gXMLTypes[] = {TEXT_XML,
|
||||
APPLICATION_XML,
|
||||
|
@ -145,7 +145,7 @@ class nsTextControlFrame : public nsContainerFrame,
|
||||
//==== NSITEXTCONTROLFRAME
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY already_AddRefed<mozilla::TextEditor>
|
||||
GetTextEditor() override;
|
||||
GetTextEditor() override;
|
||||
MOZ_CAN_RUN_SCRIPT NS_IMETHOD
|
||||
SetSelectionRange(uint32_t aSelectionStart, uint32_t aSelectionEnd,
|
||||
SelectionDirection aDirection = eNone) override;
|
||||
|
@ -9298,8 +9298,9 @@ static nsRect UnionBorderBoxes(
|
||||
// Iterate over all children except pop-up, absolutely-positioned,
|
||||
// float, and overflow ones.
|
||||
const nsIFrame::ChildListIDs skip = {
|
||||
nsIFrame::kPopupList, nsIFrame::kSelectPopupList, nsIFrame::kAbsoluteList,
|
||||
nsIFrame::kFixedList, nsIFrame::kFloatList, nsIFrame::kOverflowList};
|
||||
nsIFrame::kPopupList, nsIFrame::kSelectPopupList,
|
||||
nsIFrame::kAbsoluteList, nsIFrame::kFixedList,
|
||||
nsIFrame::kFloatList, nsIFrame::kOverflowList};
|
||||
for (nsIFrame::ChildListIterator childLists(aFrame); !childLists.IsDone();
|
||||
childLists.Next()) {
|
||||
if (skip.contains(childLists.CurrentID())) {
|
||||
|
@ -22,7 +22,8 @@ class CSSFontFaceRuleDecl final : public nsICSSDeclaration {
|
||||
NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
|
||||
|
||||
nsINode* GetParentObject() final;
|
||||
void IndexedGetter(uint32_t aIndex, bool& aFound, nsACString& aPropName) final;
|
||||
void IndexedGetter(uint32_t aIndex, bool& aFound,
|
||||
nsACString& aPropName) final;
|
||||
|
||||
void GetPropertyValue(nsCSSFontDesc aFontDescID, nsAString& aResult) const;
|
||||
|
||||
|
@ -626,7 +626,8 @@ static void AddImageURL(const nsStyleImageRequest& aRequest,
|
||||
AddImageURL(aRequest.GetImageValue(), aURLs);
|
||||
}
|
||||
|
||||
static void AddImageURL(const nsStyleImage& aImage, nsTArray<nsCString>& aURLs) {
|
||||
static void AddImageURL(const nsStyleImage& aImage,
|
||||
nsTArray<nsCString>& aURLs) {
|
||||
if (auto* urlValue = aImage.GetURLValue()) {
|
||||
AddImageURL(*urlValue, aURLs);
|
||||
}
|
||||
@ -1562,7 +1563,7 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::GetGridTemplateColumnsRows(
|
||||
}
|
||||
|
||||
const bool serializeImplicit =
|
||||
StaticPrefs::layout_css_serialize_grid_implicit_tracks();
|
||||
StaticPrefs::layout_css_serialize_grid_implicit_tracks();
|
||||
|
||||
const nsTArray<nscoord>& trackSizes = aTrackInfo.mSizes;
|
||||
const uint32_t numExplicitTracks = aTrackInfo.mNumExplicitTracks;
|
||||
@ -1571,7 +1572,8 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::GetGridTemplateColumnsRows(
|
||||
uint32_t numSizes = trackSizes.Length();
|
||||
MOZ_ASSERT(numSizes >= numLeadingImplicitTracks + numExplicitTracks);
|
||||
|
||||
const bool hasTracksToSerialize = serializeImplicit ? !!numSizes : !!numExplicitTracks;
|
||||
const bool hasTracksToSerialize =
|
||||
serializeImplicit ? !!numSizes : !!numExplicitTracks;
|
||||
const bool hasRepeatAuto = aTrackList.HasRepeatAuto();
|
||||
if (!hasTracksToSerialize && !hasRepeatAuto) {
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
@ -1693,8 +1695,8 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::GetGridTemplateColumnsRows(
|
||||
|
||||
// Add any trailing implicit tracks.
|
||||
if (serializeImplicit) {
|
||||
for (uint32_t i = numLeadingImplicitTracks + numExplicitTracks; i < numSizes;
|
||||
++i) {
|
||||
for (uint32_t i = numLeadingImplicitTracks + numExplicitTracks;
|
||||
i < numSizes; ++i) {
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetAppUnits(trackSizes[i]);
|
||||
valueList->AppendCSSValue(val.forget());
|
||||
|
@ -74,7 +74,8 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
|
||||
const nsACString& aValue,
|
||||
nsIPrincipal* aSubjectPrincipal) override;
|
||||
|
||||
void IndexedGetter(uint32_t aIndex, bool& aFound, nsACString& aPropName) final;
|
||||
void IndexedGetter(uint32_t aIndex, bool& aFound,
|
||||
nsACString& aPropName) final;
|
||||
|
||||
enum StyleType {
|
||||
eDefaultOnly, // Only includes UA and user sheets
|
||||
|
@ -328,8 +328,9 @@ nsresult nsDOMCSSDeclaration::ParseCustomPropertyValue(
|
||||
aSubjectPrincipal, &closureData,
|
||||
[&](DeclarationBlock* decl, ParsingEnvironment& env) {
|
||||
return Servo_DeclarationBlock_SetProperty(
|
||||
decl->Raw(), &aPropertyName, &aPropValue, aIsImportant, env.mUrlExtraData,
|
||||
ParsingMode::Default, env.mCompatMode, env.mLoader, closure);
|
||||
decl->Raw(), &aPropertyName, &aPropValue, aIsImportant,
|
||||
env.mUrlExtraData, ParsingMode::Default, env.mCompatMode,
|
||||
env.mLoader, closure);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID)
|
||||
void GetPropertyPriority(const nsACString& propertyName, \
|
||||
nsAString& aPriority) override; \
|
||||
NS_IMETHOD SetProperty(const nsACString& propertyName, \
|
||||
const nsACString& value, const nsAString& priority, \
|
||||
const nsACString& value, const nsAString& priority, \
|
||||
nsIPrincipal* aSubjectPrincipal = nullptr) override; \
|
||||
uint32_t Length() override; \
|
||||
mozilla::css::Rule* GetParentRule() override;
|
||||
|
@ -89,8 +89,8 @@ enum class StyleDisplay : uint16_t {
|
||||
/// XUL boxes.
|
||||
MozBox =
|
||||
StyleDisplayFrom(StyleDisplayOutside::Block, StyleDisplayInside::MozBox),
|
||||
MozInlineBox = StyleDisplayFrom(StyleDisplayOutside::Inline,
|
||||
StyleDisplayInside::MozBox),
|
||||
MozInlineBox =
|
||||
StyleDisplayFrom(StyleDisplayOutside::Inline, StyleDisplayInside::MozBox),
|
||||
MozGrid =
|
||||
StyleDisplayFrom(StyleDisplayOutside::XUL, StyleDisplayInside::MozGrid),
|
||||
MozGridGroup = StyleDisplayFrom(StyleDisplayOutside::XUL,
|
||||
|
@ -12,10 +12,10 @@
|
||||
#ifndef mozilla_Utf8_h
|
||||
#define mozilla_Utf8_h
|
||||
|
||||
#include "mozilla/Casting.h" // for mozilla::AssertedCast
|
||||
#include "mozilla/Likely.h" // for MOZ_UNLIKELY
|
||||
#include "mozilla/Maybe.h" // for mozilla::Maybe
|
||||
#include "mozilla/Span.h" // for mozilla::Span
|
||||
#include "mozilla/Casting.h" // for mozilla::AssertedCast
|
||||
#include "mozilla/Likely.h" // for MOZ_UNLIKELY
|
||||
#include "mozilla/Maybe.h" // for mozilla::Maybe
|
||||
#include "mozilla/Span.h" // for mozilla::Span
|
||||
#include "mozilla/TextUtils.h" // for mozilla::IsAscii and via Latin1.h for
|
||||
// encoding_rs_mem.h and MOZ_HAS_JSRUST.
|
||||
#include "mozilla/Tuple.h" // for mozilla::Tuple
|
||||
|
@ -2733,8 +2733,8 @@ nsPrefBranch::RemoveObserverImpl(const nsACString& aDomain,
|
||||
mozilla::UniquePtr<PrefCallback> pCallback;
|
||||
mObservers.Remove(&key, &pCallback);
|
||||
if (pCallback) {
|
||||
rv = Preferences::UnregisterCallback(NotifyObserver, prefName, pCallback.get(),
|
||||
Preferences::PrefixMatch);
|
||||
rv = Preferences::UnregisterCallback(
|
||||
NotifyObserver, prefName, pCallback.get(), Preferences::PrefixMatch);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -11,9 +11,7 @@
|
||||
|
||||
#include <shlwapi.h>
|
||||
|
||||
static int NormalImport() {
|
||||
return ::GetSystemMetrics(SM_CYCAPTION);
|
||||
}
|
||||
static int NormalImport() { return ::GetSystemMetrics(SM_CYCAPTION); }
|
||||
|
||||
static bool DelayLoadImport() {
|
||||
return !!::UrlIsW(L"http://example.com/", URLIS_FILEURL);
|
||||
|
@ -1216,8 +1216,8 @@ nsresult CacheFile::SetNetworkTimes(uint64_t aOnStartTime,
|
||||
aOnStopTime <= kIndexTimeOutOfBound ? aOnStopTime : kIndexTimeOutOfBound;
|
||||
|
||||
if (mHandle && !mHandle->IsDoomed()) {
|
||||
CacheFileIOManager::UpdateIndexEntry(mHandle, nullptr, nullptr,
|
||||
&onStartTime16, &onStopTime16, nullptr);
|
||||
CacheFileIOManager::UpdateIndexEntry(
|
||||
mHandle, nullptr, nullptr, &onStartTime16, &onStopTime16, nullptr);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2539,9 +2539,8 @@ nsresult CacheFile::InitIndexEntry() {
|
||||
contentType = n64;
|
||||
}
|
||||
|
||||
rv = CacheFileIOManager::UpdateIndexEntry(mHandle, &frecency, &hasAltData,
|
||||
&onStartTime, &onStopTime,
|
||||
&contentType);
|
||||
rv = CacheFileIOManager::UpdateIndexEntry(
|
||||
mHandle, &frecency, &hasAltData, &onStartTime, &onStopTime, &contentType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1033,13 +1033,12 @@ class UpdateIndexEntryEvent : public Runnable {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
CacheIndex::UpdateEntry(
|
||||
mHandle->Hash(), mHasFrecency ? &mFrecency : nullptr,
|
||||
mHasHasAltData ? &mHasAltData : nullptr,
|
||||
mHasOnStartTime ? &mOnStartTime : nullptr,
|
||||
mHasOnStopTime ? &mOnStopTime : nullptr,
|
||||
mHasContentType ? &mContentType : nullptr,
|
||||
nullptr);
|
||||
CacheIndex::UpdateEntry(mHandle->Hash(),
|
||||
mHasFrecency ? &mFrecency : nullptr,
|
||||
mHasHasAltData ? &mHasAltData : nullptr,
|
||||
mHasOnStartTime ? &mOnStartTime : nullptr,
|
||||
mHasOnStopTime ? &mOnStopTime : nullptr,
|
||||
mHasContentType ? &mContentType : nullptr, nullptr);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -3517,10 +3516,12 @@ nsresult CacheFileIOManager::InitIndexEntry(CacheFileHandle* aHandle,
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult CacheFileIOManager::UpdateIndexEntry(
|
||||
CacheFileHandle* aHandle, const uint32_t* aFrecency,
|
||||
const bool* aHasAltData, const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime, const uint8_t* aContentType) {
|
||||
nsresult CacheFileIOManager::UpdateIndexEntry(CacheFileHandle* aHandle,
|
||||
const uint32_t* aFrecency,
|
||||
const bool* aHasAltData,
|
||||
const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime,
|
||||
const uint8_t* aContentType) {
|
||||
LOG(
|
||||
("CacheFileIOManager::UpdateIndexEntry() [handle=%p, frecency=%s, "
|
||||
"hasAltData=%s, onStartTime=%s, onStopTime=%s, contentType=%s]",
|
||||
|
@ -925,11 +925,13 @@ nsresult CacheIndex::RemoveEntry(const SHA1Sum::Hash* aHash) {
|
||||
}
|
||||
|
||||
// static
|
||||
nsresult CacheIndex::UpdateEntry(
|
||||
const SHA1Sum::Hash* aHash, const uint32_t* aFrecency,
|
||||
const bool* aHasAltData, const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime, const uint8_t* aContentType,
|
||||
const uint32_t* aSize) {
|
||||
nsresult CacheIndex::UpdateEntry(const SHA1Sum::Hash* aHash,
|
||||
const uint32_t* aFrecency,
|
||||
const bool* aHasAltData,
|
||||
const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime,
|
||||
const uint8_t* aContentType,
|
||||
const uint32_t* aSize) {
|
||||
LOG(
|
||||
("CacheIndex::UpdateEntry() [hash=%08x%08x%08x%08x%08x, "
|
||||
"frecency=%s, hasAltData=%s, onStartTime=%s, onStopTime=%s, "
|
||||
@ -976,9 +978,8 @@ nsresult CacheIndex::UpdateEntry(
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
if (!HasEntryChanged(
|
||||
entry, aFrecency, aHasAltData, aOnStartTime, aOnStopTime,
|
||||
aContentType, aSize)) {
|
||||
if (!HasEntryChanged(entry, aFrecency, aHasAltData, aOnStartTime,
|
||||
aOnStopTime, aContentType, aSize)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -682,11 +682,13 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
|
||||
// MUST be initialized. Call to AddEntry() or EnsureEntryExists() and to
|
||||
// InitEntry() must precede the call to this method.
|
||||
// Pass nullptr if the value didn't change.
|
||||
static nsresult UpdateEntry(
|
||||
const SHA1Sum::Hash* aHash, const uint32_t* aFrecency,
|
||||
const bool* aHasAltData, const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime, const uint8_t* aContentType,
|
||||
const uint32_t* aSize);
|
||||
static nsresult UpdateEntry(const SHA1Sum::Hash* aHash,
|
||||
const uint32_t* aFrecency,
|
||||
const bool* aHasAltData,
|
||||
const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime,
|
||||
const uint8_t* aContentType,
|
||||
const uint32_t* aSize);
|
||||
|
||||
// Remove all entries from the index. Called when clearing the whole cache.
|
||||
static nsresult RemoveAll();
|
||||
@ -789,11 +791,13 @@ class CacheIndex final : public CacheFileIOListener, public nsIRunnable {
|
||||
OriginAttrsHash aOriginAttrsHash, bool aAnonymous);
|
||||
|
||||
// Checks whether any of the information about the entry has changed.
|
||||
static bool HasEntryChanged(
|
||||
CacheIndexEntry* aEntry, const uint32_t* aFrecency,
|
||||
const bool* aHasAltData, const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime, const uint8_t* aContentType,
|
||||
const uint32_t* aSize);
|
||||
static bool HasEntryChanged(CacheIndexEntry* aEntry,
|
||||
const uint32_t* aFrecency,
|
||||
const bool* aHasAltData,
|
||||
const uint16_t* aOnStartTime,
|
||||
const uint16_t* aOnStopTime,
|
||||
const uint8_t* aContentType,
|
||||
const uint32_t* aSize);
|
||||
|
||||
// Merge all pending operations from mPendingUpdates into mIndex.
|
||||
void ProcessPendingOperations();
|
||||
|
@ -453,8 +453,7 @@ nsresult Http3Session::ProcessOutputAndEvents() {
|
||||
void Http3Session::SetupTimer(uint64_t aTimeout) {
|
||||
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
|
||||
|
||||
LOG(("Http3Session::SetupTimer to %" PRIu64 "ms [this=%p].", aTimeout,
|
||||
this));
|
||||
LOG(("Http3Session::SetupTimer to %" PRIu64 "ms [this=%p].", aTimeout, this));
|
||||
if (!mTimer) {
|
||||
mTimer = NS_NewTimer();
|
||||
}
|
||||
|
@ -148,7 +148,8 @@ class nsHttpAuthNode {
|
||||
nsTArray<nsAutoPtr<nsHttpAuthEntry> > mList;
|
||||
|
||||
friend class nsHttpAuthCache;
|
||||
friend class mozilla::DefaultDelete<nsHttpAuthNode>; // needs to call the destructor
|
||||
friend class mozilla::DefaultDelete<nsHttpAuthNode>; // needs to call the
|
||||
// destructor
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -772,6 +772,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
|
||||
TimeStamp mLastActiveTabLoadOptimizationHit;
|
||||
|
||||
Mutex mSpdyBlacklistLock;
|
||||
|
||||
public:
|
||||
MOZ_MUST_USE nsresult NewChannelId(uint64_t& channelId);
|
||||
|
||||
|
@ -281,8 +281,9 @@ void nsExpatDriver::HandleStartElement(void* aUserData, const char16_t* aName,
|
||||
if (self->mSink) {
|
||||
// We store the tagdepth in a PRUint16, so make sure the limit fits in a
|
||||
// PRUint16.
|
||||
static_assert(sMaxXMLTreeDepth <=
|
||||
std::numeric_limits<decltype(nsExpatDriver::mTagDepth)>::max());
|
||||
static_assert(
|
||||
sMaxXMLTreeDepth <=
|
||||
std::numeric_limits<decltype(nsExpatDriver::mTagDepth)>::max());
|
||||
|
||||
if (++self->mTagDepth > sMaxXMLTreeDepth) {
|
||||
self->MaybeStopParser(NS_ERROR_HTMLPARSER_HIERARCHYTOODEEP);
|
||||
|
@ -14,8 +14,7 @@ namespace mozilla {
|
||||
namespace recordreplay {
|
||||
|
||||
Assembler::Assembler(uint8_t* aStorage, size_t aSize)
|
||||
: mCursor(aStorage),
|
||||
mCursorEnd(aStorage + aSize) {}
|
||||
: mCursor(aStorage), mCursorEnd(aStorage + aSize) {}
|
||||
|
||||
// The maximum byte length of an x86/x64 instruction.
|
||||
static const size_t MaximumInstructionLength = 15;
|
||||
@ -25,9 +24,7 @@ void Assembler::Advance(size_t aSize) {
|
||||
MOZ_RELEASE_ASSERT(mCursor + MaximumInstructionLength <= mCursorEnd);
|
||||
}
|
||||
|
||||
uint8_t* Assembler::Current() {
|
||||
return mCursor;
|
||||
}
|
||||
uint8_t* Assembler::Current() { return mCursor; }
|
||||
|
||||
void Assembler::Jump(void* aTarget) {
|
||||
PushImmediate(aTarget);
|
||||
@ -53,13 +50,9 @@ void Assembler::Push16(uint16_t aValue) {
|
||||
Advance(4);
|
||||
}
|
||||
|
||||
void Assembler::Return() {
|
||||
NewInstruction(0xC3);
|
||||
}
|
||||
void Assembler::Return() { NewInstruction(0xC3); }
|
||||
|
||||
void Assembler::Breakpoint() {
|
||||
NewInstruction(0xCC);
|
||||
}
|
||||
void Assembler::Breakpoint() { NewInstruction(0xCC); }
|
||||
|
||||
void Assembler::PushRax() { NewInstruction(0x50); }
|
||||
|
||||
@ -91,7 +84,8 @@ void Assembler::MoveRaxToRegister(Register aRegister) {
|
||||
|
||||
void Assembler::MoveRegisterToRax(Register aRegister) {
|
||||
if (aRegister <= Register::RDI) {
|
||||
NewInstruction(0x48, 0x89, 0xC0 + ((int)aRegister - (int)Register::RAX) * 8);
|
||||
NewInstruction(0x48, 0x89,
|
||||
0xC0 + ((int)aRegister - (int)Register::RAX) * 8);
|
||||
} else {
|
||||
NewInstruction(0x4C, 0x89, 0xC0 + ((int)aRegister - (int)Register::R8) * 8);
|
||||
}
|
||||
|
@ -16,7 +16,22 @@ namespace recordreplay {
|
||||
|
||||
// x86-64 general purpose registers.
|
||||
enum class Register {
|
||||
RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15,
|
||||
RAX,
|
||||
RCX,
|
||||
RDX,
|
||||
RBX,
|
||||
RSP,
|
||||
RBP,
|
||||
RSI,
|
||||
RDI,
|
||||
R8,
|
||||
R9,
|
||||
R10,
|
||||
R11,
|
||||
R12,
|
||||
R13,
|
||||
R14,
|
||||
R15,
|
||||
};
|
||||
|
||||
// Assembler for x64 instructions. This is a simple assembler that is primarily
|
||||
|
@ -95,7 +95,8 @@ bool OnExternalCall(size_t aCallId, CallArguments* aArguments, bool aDiverged) {
|
||||
}
|
||||
|
||||
if (aDiverged) {
|
||||
PrintSpew("OnExternalCall Diverged %s %s\n", redirection.mName, messageName);
|
||||
PrintSpew("OnExternalCall Diverged %s %s\n", redirection.mName,
|
||||
messageName);
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(*gMonitor);
|
||||
@ -106,8 +107,7 @@ bool OnExternalCall(size_t aCallId, CallArguments* aArguments, bool aDiverged) {
|
||||
|
||||
// Save all the call's inputs.
|
||||
{
|
||||
ExternalCallContext cx(call, aArguments,
|
||||
ExternalCallPhase::SaveInput);
|
||||
ExternalCallContext cx(call, aArguments, ExternalCallPhase::SaveInput);
|
||||
redirection.mExternalCall(cx);
|
||||
if (cx.mFailed) {
|
||||
delete call;
|
||||
@ -145,8 +145,7 @@ bool OnExternalCall(size_t aCallId, CallArguments* aArguments, bool aDiverged) {
|
||||
// we need. Run the SaveOutput phase to capture these so that we can reuse
|
||||
// them later and associate any system outputs with the call.
|
||||
if (!aDiverged) {
|
||||
ExternalCallContext cx(call, aArguments,
|
||||
ExternalCallPhase::SaveOutput);
|
||||
ExternalCallContext cx(call, aArguments, ExternalCallPhase::SaveOutput);
|
||||
redirection.mExternalCall(cx);
|
||||
if (isNewCall) {
|
||||
gUnflushedCalls.append(call);
|
||||
@ -169,9 +168,8 @@ bool OnExternalCall(size_t aCallId, CallArguments* aArguments, bool aDiverged) {
|
||||
|
||||
// Synchronously wait for the call result.
|
||||
InfallibleVector<char> outputData;
|
||||
child::SendExternalCallRequest(call->mId,
|
||||
inputData.begin(), inputData.length(),
|
||||
&outputData);
|
||||
child::SendExternalCallRequest(call->mId, inputData.begin(),
|
||||
inputData.length(), &outputData);
|
||||
|
||||
// Decode the external call's output.
|
||||
BufferStream outputStream(outputData.begin(), outputData.length());
|
||||
@ -416,9 +414,9 @@ void EX_SystemOutput(ExternalCallContext& aCx, const void** aOutput,
|
||||
break;
|
||||
}
|
||||
// If we haven't encountered the aliased call, fall through and generate
|
||||
// a new value for it. Aliases might be spurious if they were derived from
|
||||
// the recording and reflect a value that was released and had its memory
|
||||
// reused.
|
||||
// a new value for it. Aliases might be spurious if they were derived
|
||||
// from the recording and reflect a value that was released and had its
|
||||
// memory reused.
|
||||
}
|
||||
*aOutput = MangledSystemValue(aCx.mCall->mId);
|
||||
} while (false);
|
||||
|
@ -170,9 +170,7 @@ struct ExternalCallContext {
|
||||
|
||||
ExternalCallContext(ExternalCall* aCall, CallArguments* aArguments,
|
||||
ExternalCallPhase aPhase)
|
||||
: mCall(aCall),
|
||||
mArguments(aArguments),
|
||||
mPhase(aPhase) {
|
||||
: mCall(aCall), mArguments(aArguments), mPhase(aPhase) {
|
||||
switch (mPhase) {
|
||||
case ExternalCallPhase::SaveInput:
|
||||
mInputStream.emplace(&mCall->mInput);
|
||||
@ -218,7 +216,8 @@ struct ExternalCallContext {
|
||||
|
||||
bool AccessInput() { return mInputStream.isSome(); }
|
||||
|
||||
void ReadOrWriteInputBytes(void* aBuffer, size_t aSize, bool aExcludeInput = false) {
|
||||
void ReadOrWriteInputBytes(void* aBuffer, size_t aSize,
|
||||
bool aExcludeInput = false) {
|
||||
switch (mPhase) {
|
||||
case ExternalCallPhase::SaveInput:
|
||||
// Only one buffer can be excluded, and it has to be the last input to
|
||||
@ -298,8 +297,7 @@ struct ExternalCallContext {
|
||||
// any outputs for the call must be filled in; otherwise, they already have
|
||||
// been filled in using data from the recording. Returns false if the call was
|
||||
// unable to be processed.
|
||||
bool OnExternalCall(size_t aCallId, CallArguments* aArguments,
|
||||
bool aDiverged);
|
||||
bool OnExternalCall(size_t aCallId, CallArguments* aArguments, bool aDiverged);
|
||||
|
||||
// In the external process, perform one or more calls encoded in aInputData
|
||||
// and encode the output of the final call in aOutputData.
|
||||
@ -375,9 +373,8 @@ template <size_t StringArg>
|
||||
static inline void EX_CString(ExternalCallContext& aCx) {
|
||||
if (aCx.AccessInput()) {
|
||||
auto& buffer = aCx.mArguments->Arg<StringArg, char*>();
|
||||
size_t len = (aCx.mPhase == ExternalCallPhase::SaveInput)
|
||||
? strlen(buffer) + 1
|
||||
: 0;
|
||||
size_t len =
|
||||
(aCx.mPhase == ExternalCallPhase::SaveInput) ? strlen(buffer) + 1 : 0;
|
||||
aCx.ReadOrWriteInputBytes(&len, sizeof(len));
|
||||
aCx.ReadOrWriteInputBuffer((void**)&buffer, len);
|
||||
}
|
||||
@ -425,9 +422,9 @@ static inline void EX_SkipExecuting(ExternalCallContext& aCx) {
|
||||
|
||||
static inline void EX_NoOp(ExternalCallContext& aCx) {}
|
||||
|
||||
template <ExternalCallFn Fn0, ExternalCallFn Fn1,
|
||||
ExternalCallFn Fn2 = EX_NoOp, ExternalCallFn Fn3 = EX_NoOp,
|
||||
ExternalCallFn Fn4 = EX_NoOp, ExternalCallFn Fn5 = EX_NoOp>
|
||||
template <ExternalCallFn Fn0, ExternalCallFn Fn1, ExternalCallFn Fn2 = EX_NoOp,
|
||||
ExternalCallFn Fn3 = EX_NoOp, ExternalCallFn Fn4 = EX_NoOp,
|
||||
ExternalCallFn Fn5 = EX_NoOp>
|
||||
static inline void EX_Compose(ExternalCallContext& aCx) {
|
||||
Fn0(aCx);
|
||||
Fn1(aCx);
|
||||
|
@ -231,18 +231,21 @@ MOZ_EXPORT void RecordReplayInterface_InternalInvalidateRecording(
|
||||
Unreachable();
|
||||
}
|
||||
|
||||
MOZ_EXPORT void RecordReplayInterface_InternalBeginPassThroughThreadEventsWithLocalReplay() {
|
||||
MOZ_EXPORT void
|
||||
RecordReplayInterface_InternalBeginPassThroughThreadEventsWithLocalReplay() {
|
||||
if (IsReplaying() && !gReplayingInCloud) {
|
||||
BeginPassThroughThreadEvents();
|
||||
}
|
||||
}
|
||||
|
||||
MOZ_EXPORT void RecordReplayInterface_InternalEndPassThroughThreadEventsWithLocalReplay() {
|
||||
MOZ_EXPORT void
|
||||
RecordReplayInterface_InternalEndPassThroughThreadEventsWithLocalReplay() {
|
||||
// If we are replaying locally we will be skipping over a section of the
|
||||
// recording while events are passed through. Include the current stream
|
||||
// position in the recording so that we will know how much to skip over.
|
||||
MOZ_RELEASE_ASSERT(Thread::CurrentIsMainThread());
|
||||
Stream* localReplayStream = gRecording->OpenStream(StreamName::LocalReplaySkip, 0);
|
||||
Stream* localReplayStream =
|
||||
gRecording->OpenStream(StreamName::LocalReplaySkip, 0);
|
||||
Stream& events = Thread::Current()->Events();
|
||||
|
||||
size_t position = IsRecording() ? events.StreamPosition() : 0;
|
||||
@ -279,9 +282,10 @@ void FlushRecording() {
|
||||
gRecording->AllowStreamWrites();
|
||||
|
||||
if (gRecording->Size() > gRecordingDataSentToMiddleman) {
|
||||
child::SendRecordingData(gRecordingDataSentToMiddleman,
|
||||
gRecording->Data() + gRecordingDataSentToMiddleman,
|
||||
gRecording->Size() - gRecordingDataSentToMiddleman);
|
||||
child::SendRecordingData(
|
||||
gRecordingDataSentToMiddleman,
|
||||
gRecording->Data() + gRecordingDataSentToMiddleman,
|
||||
gRecording->Size() - gRecordingDataSentToMiddleman);
|
||||
gRecordingDataSentToMiddleman = gRecording->Size();
|
||||
}
|
||||
}
|
||||
@ -484,13 +488,13 @@ static void CrashDetectorThread(void*) {
|
||||
request.body.exception == EXC_BAD_ACCESS && request.body.codeCnt == 2) {
|
||||
uint8_t* faultingAddress = (uint8_t*)request.body.code[1];
|
||||
child::MinidumpInfo info(request.body.exception, request.body.code[0],
|
||||
request.body.code[1],
|
||||
request.body.thread.name,
|
||||
request.body.code[1], request.body.thread.name,
|
||||
request.body.task.name);
|
||||
child::ReportCrash(info, faultingAddress);
|
||||
} else {
|
||||
child::ReportFatalError("CrashDetectorThread mach_msg "
|
||||
"returned unexpected data");
|
||||
child::ReportFatalError(
|
||||
"CrashDetectorThread mach_msg "
|
||||
"returned unexpected data");
|
||||
}
|
||||
|
||||
__Reply__exception_raise_t reply;
|
||||
|
@ -305,16 +305,19 @@ uint8_t* GenerateRedirectStub(Assembler& aAssembler, size_t aCallId,
|
||||
uint8_t* newFunction = aAssembler.Current();
|
||||
if (aPreserveCallerSaveRegisters) {
|
||||
static Register registers[] = {
|
||||
Register::RDI, Register::RDI /* for alignment */,
|
||||
Register::RSI, Register::RDX, Register::RCX,
|
||||
Register::R8, Register::R9, Register::R10, Register::R11,
|
||||
Register::RDI, Register::RDI /* for alignment */,
|
||||
Register::RSI, Register::RDX,
|
||||
Register::RCX, Register::R8,
|
||||
Register::R9, Register::R10,
|
||||
Register::R11,
|
||||
};
|
||||
for (size_t i = 0; i < ArrayLength(registers); i++) {
|
||||
aAssembler.MoveRegisterToRax(registers[i]);
|
||||
aAssembler.PushRax();
|
||||
}
|
||||
aAssembler.MoveImmediateToRax((void*)aCallId);
|
||||
uint8_t* after = aAssembler.Current() + Assembler::PushImmediateBytes + Assembler::JumpBytes;
|
||||
uint8_t* after = aAssembler.Current() + Assembler::PushImmediateBytes +
|
||||
Assembler::JumpBytes;
|
||||
aAssembler.PushImmediate(after);
|
||||
aAssembler.Jump(BitwiseCast<void*>(RecordReplayRedirectCall));
|
||||
for (int i = ArrayLength(registers) - 1; i >= 0; i--) {
|
||||
|
@ -89,19 +89,19 @@ struct CallArguments {
|
||||
static const size_t NumStackArguments = 64;
|
||||
|
||||
protected:
|
||||
size_t arg0; // 0
|
||||
size_t arg1; // 8
|
||||
size_t arg2; // 16
|
||||
size_t arg3; // 24
|
||||
size_t arg4; // 32
|
||||
size_t arg5; // 40
|
||||
double floatarg0; // 48
|
||||
double floatarg1; // 56
|
||||
double floatarg2; // 64
|
||||
size_t rval0; // 72
|
||||
size_t rval1; // 80
|
||||
double floatrval0; // 88
|
||||
double floatrval1; // 96
|
||||
size_t arg0; // 0
|
||||
size_t arg1; // 8
|
||||
size_t arg2; // 16
|
||||
size_t arg3; // 24
|
||||
size_t arg4; // 32
|
||||
size_t arg5; // 40
|
||||
double floatarg0; // 48
|
||||
double floatarg1; // 56
|
||||
double floatarg2; // 64
|
||||
size_t rval0; // 72
|
||||
size_t rval1; // 80
|
||||
double floatrval0; // 88
|
||||
double floatrval1; // 96
|
||||
size_t stack[NumStackArguments]; // 104
|
||||
// Size: 616
|
||||
|
||||
|
@ -248,7 +248,7 @@ static void EX_ObjCInput(ExternalCallContext& aCx, id* aThingPtr) {
|
||||
MOZ_RELEASE_ASSERT(cstring.get()[len - 1] == 0);
|
||||
void* ptr = dlsym(RTLD_DEFAULT, cstring.get() + strlen(cloudPrefix));
|
||||
MOZ_RELEASE_ASSERT(ptr);
|
||||
*aThingPtr = (id)*(CFStringRef*)ptr;
|
||||
*aThingPtr = (id) * (CFStringRef*)ptr;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ static void EX_CFTypeOutputArg(ExternalCallContext& aCx) {
|
||||
auto& arg = aCx.mArguments->Arg<Argument, const void**>();
|
||||
|
||||
if (aCx.mPhase == ExternalCallPhase::RestoreInput) {
|
||||
arg = (const void**) aCx.AllocateBytes(sizeof(const void*));
|
||||
arg = (const void**)aCx.AllocateBytes(sizeof(const void*));
|
||||
}
|
||||
|
||||
EX_CFTypeOutput(aCx, arg, /* aOwnsReference = */ false);
|
||||
@ -324,9 +324,8 @@ static void EX_AutoreleaseCFTypeRval(ExternalCallContext& aCx) {
|
||||
|
||||
if (rval && aCx.mPhase == ExternalCallPhase::SaveOutput && !IsReplaying()) {
|
||||
SendMessageToObject(rval, "retain");
|
||||
aCx.mReleaseCallbacks->append([=]() {
|
||||
SendMessageToObject(rval, "autorelease");
|
||||
});
|
||||
aCx.mReleaseCallbacks->append(
|
||||
[=]() { SendMessageToObject(rval, "autorelease"); });
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,29 +347,30 @@ static PreambleResult Preamble_SetError(CallArguments* aArguments) {
|
||||
return PreambleResult::Veto;
|
||||
}
|
||||
|
||||
#define ForEachFixedInputAddress(Macro) \
|
||||
Macro(kCFTypeArrayCallBacks) \
|
||||
Macro(kCFTypeDictionaryKeyCallBacks) \
|
||||
Macro(kCFTypeDictionaryValueCallBacks)
|
||||
#define ForEachFixedInputAddress(Macro) \
|
||||
Macro(kCFTypeArrayCallBacks) Macro(kCFTypeDictionaryKeyCallBacks) \
|
||||
Macro(kCFTypeDictionaryValueCallBacks)
|
||||
|
||||
#define ForEachFixedInput(Macro) \
|
||||
Macro(kCFAllocatorDefault) \
|
||||
Macro(kCFAllocatorNull)
|
||||
#define ForEachFixedInput(Macro) \
|
||||
Macro(kCFAllocatorDefault) Macro(kCFAllocatorNull)
|
||||
|
||||
enum class FixedInput {
|
||||
#define DefineEnum(Name) Name,
|
||||
ForEachFixedInputAddress(DefineEnum)
|
||||
ForEachFixedInput(DefineEnum)
|
||||
ForEachFixedInputAddress(DefineEnum) ForEachFixedInput(DefineEnum)
|
||||
#undef DefineEnum
|
||||
};
|
||||
|
||||
static const void* GetFixedInput(FixedInput aWhich) {
|
||||
switch (aWhich) {
|
||||
#define FetchEnumAddress(Name) case FixedInput::Name: return &Name;
|
||||
#define FetchEnumAddress(Name) \
|
||||
case FixedInput::Name: \
|
||||
return &Name;
|
||||
ForEachFixedInputAddress(FetchEnumAddress)
|
||||
#undef FetchEnumAddress
|
||||
#define FetchEnum(Name) case FixedInput::Name: return Name;
|
||||
ForEachFixedInput(FetchEnum)
|
||||
#define FetchEnum(Name) \
|
||||
case FixedInput::Name: \
|
||||
return Name;
|
||||
ForEachFixedInput(FetchEnum)
|
||||
#undef FetchEnum
|
||||
}
|
||||
MOZ_CRASH("Unknown fixed input");
|
||||
@ -384,9 +384,9 @@ static void EX_RequireFixed(ExternalCallContext& aCx) {
|
||||
if (aCx.AccessInput()) {
|
||||
const void* value = GetFixedInput(Which);
|
||||
if (aCx.mPhase == ExternalCallPhase::SaveInput) {
|
||||
MOZ_RELEASE_ASSERT(arg == value ||
|
||||
(Which == FixedInput::kCFAllocatorDefault &&
|
||||
arg == nullptr));
|
||||
MOZ_RELEASE_ASSERT(
|
||||
arg == value ||
|
||||
(Which == FixedInput::kCFAllocatorDefault && arg == nullptr));
|
||||
} else {
|
||||
arg = value;
|
||||
}
|
||||
@ -473,7 +473,7 @@ static void RR_open(Stream& aEvents, CallArguments* aArguments,
|
||||
}
|
||||
|
||||
static void RR_close(Stream& aEvents, CallArguments* aArguments,
|
||||
ErrorType* aError) {
|
||||
ErrorType* aError) {
|
||||
RR_SaveRvalHadErrorNegative(aEvents, aArguments, aError);
|
||||
|
||||
if (IsRecording()) {
|
||||
@ -552,9 +552,8 @@ static PreambleResult Preamble_mmap(CallArguments* aArguments) {
|
||||
size_t hash = RecordReplayValue(0);
|
||||
|
||||
int fd = DirectOpenFile(path.get(), /* aWriting */ false);
|
||||
void* fileContents = CallFunction<void*>(gOriginal_mmap, nullptr, size,
|
||||
PROT_READ, MAP_PRIVATE,
|
||||
fd, offset);
|
||||
void* fileContents = CallFunction<void*>(
|
||||
gOriginal_mmap, nullptr, size, PROT_READ, MAP_PRIVATE, fd, offset);
|
||||
MOZ_RELEASE_ASSERT(fileContents != MAP_FAILED);
|
||||
|
||||
memcpy(memory, fileContents, size);
|
||||
@ -730,8 +729,7 @@ static ssize_t WaitForCvar(pthread_mutex_t* aMutex, pthread_cond_t* aCond,
|
||||
if (!lock) {
|
||||
if (IsReplaying() && !AreThreadEventsPassedThrough()) {
|
||||
Thread* thread = Thread::Current();
|
||||
if (thread->MaybeWaitForFork(
|
||||
[=]() { pthread_mutex_unlock(aMutex); })) {
|
||||
if (thread->MaybeWaitForFork([=]() { pthread_mutex_unlock(aMutex); })) {
|
||||
// We unlocked the mutex while the thread idled, so don't wait on the
|
||||
// condvar: the state the thread is waiting on may have changed and it
|
||||
// might not want to continue waiting. Returning immediately means this
|
||||
@ -978,31 +976,30 @@ static PreambleResult Preamble_pthread_self(CallArguments* aArguments) {
|
||||
return PreambleResult::PassThrough;
|
||||
}
|
||||
|
||||
static void*
|
||||
GetTLVTemplate(void* aPtr, size_t* aSize) {
|
||||
static void* GetTLVTemplate(void* aPtr, size_t* aSize) {
|
||||
uint8_t* tlvTemplate = nullptr;
|
||||
*aSize = 0;
|
||||
|
||||
Dl_info info;
|
||||
dladdr(aPtr, &info);
|
||||
mach_header_64* header = (mach_header_64*) info.dli_fbase;
|
||||
mach_header_64* header = (mach_header_64*)info.dli_fbase;
|
||||
MOZ_RELEASE_ASSERT(header->magic == MH_MAGIC_64);
|
||||
|
||||
uint32_t offset = sizeof(mach_header_64);
|
||||
for (size_t i = 0; i < header->ncmds; i++) {
|
||||
load_command* cmd = (load_command*) ((uint8_t*)header + offset);
|
||||
load_command* cmd = (load_command*)((uint8_t*)header + offset);
|
||||
if (LC_SEGMENT_64 == (cmd->cmd & ~LC_REQ_DYLD)) {
|
||||
segment_command_64* ncmd = (segment_command_64*) cmd;
|
||||
section_64* sect = (section_64*) (ncmd + 1);
|
||||
segment_command_64* ncmd = (segment_command_64*)cmd;
|
||||
section_64* sect = (section_64*)(ncmd + 1);
|
||||
for (size_t i = 0; i < ncmd->nsects; i++, sect++) {
|
||||
switch (sect->flags & SECTION_TYPE) {
|
||||
case S_THREAD_LOCAL_REGULAR:
|
||||
case S_THREAD_LOCAL_ZEROFILL:
|
||||
if (!tlvTemplate) {
|
||||
tlvTemplate = (uint8_t*)header + sect->addr;
|
||||
}
|
||||
*aSize = (uint8_t*)header + sect->addr + sect->size - tlvTemplate;
|
||||
break;
|
||||
case S_THREAD_LOCAL_REGULAR:
|
||||
case S_THREAD_LOCAL_ZEROFILL:
|
||||
if (!tlvTemplate) {
|
||||
tlvTemplate = (uint8_t*)header + sect->addr;
|
||||
}
|
||||
*aSize = (uint8_t*)header + sect->addr + sect->size - tlvTemplate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1314,7 +1311,7 @@ static void EX_PerformSelector(ExternalCallContext& aCx) {
|
||||
}
|
||||
|
||||
if (aCx.mPhase == ExternalCallPhase::RestoreInput) {
|
||||
selector = (const char*) sel_registerName(selector);
|
||||
selector = (const char*)sel_registerName(selector);
|
||||
}
|
||||
|
||||
EX_AutoreleaseCFTypeRval(aCx);
|
||||
@ -1420,8 +1417,8 @@ static ObjCMessageInfo gObjCExternalCallMessages[] = {
|
||||
// NSBezierPath
|
||||
{"addClip", EX_NoOp, true},
|
||||
{"bezierPathWithRoundedRect:xRadius:yRadius:",
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGRect)>,
|
||||
EX_FloatArg<0>, EX_FloatArg<1>, EX_AutoreleaseCFTypeRval>},
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGRect)>, EX_FloatArg<0>,
|
||||
EX_FloatArg<1>, EX_AutoreleaseCFTypeRval>},
|
||||
|
||||
// NSCell
|
||||
{"drawFocusRingMaskWithFrame:inView:",
|
||||
@ -1483,12 +1480,10 @@ static ObjCMessageInfo gObjCExternalCallMessages[] = {
|
||||
EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
{"pointSize"},
|
||||
{"smallSystemFontSize"},
|
||||
{"systemFontOfSize:",
|
||||
EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
{"systemFontOfSize:", EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
{"toolTipsFontOfSize:",
|
||||
EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
{"userFontOfSize:",
|
||||
EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
{"userFontOfSize:", EX_Compose<EX_FloatArg<0>, EX_AutoreleaseCFTypeRval>},
|
||||
|
||||
// NSFontManager
|
||||
{"availableMembersOfFontFamily:",
|
||||
@ -1529,7 +1524,7 @@ static void EX_objc_msgSend(ExternalCallContext& aCx) {
|
||||
auto& message = aCx.mArguments->Arg<1, const char*>();
|
||||
|
||||
if (aCx.mPhase == ExternalCallPhase::RestoreInput) {
|
||||
message = (const char*) sel_registerName(message);
|
||||
message = (const char*)sel_registerName(message);
|
||||
}
|
||||
|
||||
for (const ObjCMessageInfo& info : gObjCExternalCallMessages) {
|
||||
@ -2177,18 +2172,17 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
Preamble_SetError<EACCES>},
|
||||
{"lseek", RR_SaveRvalHadErrorNegative},
|
||||
{"select$DARWIN_EXTSN",
|
||||
RR_SaveRvalHadErrorNegative<RR_Compose<RR_OutParam<1, fd_set>,
|
||||
RR_OutParam<2, fd_set>,
|
||||
RR_OutParam<3, fd_set>>>,
|
||||
RR_SaveRvalHadErrorNegative<
|
||||
RR_Compose<RR_OutParam<1, fd_set>, RR_OutParam<2, fd_set>,
|
||||
RR_OutParam<3, fd_set>>>,
|
||||
nullptr, nullptr, Preamble_WaitForever},
|
||||
{"socketpair",
|
||||
RR_SaveRvalHadErrorNegative<RR_WriteBufferFixedSize<3, 2 * sizeof(int)>>},
|
||||
{"fileport_makeport", RR_SaveRvalHadErrorNegative<RR_OutParam<1, size_t>>},
|
||||
{"getsockopt", RR_SaveRvalHadErrorNegative<RR_getsockopt>},
|
||||
{"gettimeofday",
|
||||
RR_SaveRvalHadErrorNegative<RR_Compose<
|
||||
RR_OutParam<0, struct timeval>,
|
||||
RR_OutParam<1, struct timezone>>>,
|
||||
RR_SaveRvalHadErrorNegative<RR_Compose<RR_OutParam<0, struct timeval>,
|
||||
RR_OutParam<1, struct timezone>>>,
|
||||
nullptr, nullptr, Preamble_PassThrough},
|
||||
{"getuid", RR_ScalarRval},
|
||||
{"geteuid", RR_ScalarRval},
|
||||
@ -2207,22 +2201,20 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"stat$INODE64", RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct stat>>,
|
||||
nullptr, nullptr, Preamble_SetError},
|
||||
{"statfs$INODE64",
|
||||
RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct statfs>>,
|
||||
nullptr, nullptr, Preamble_SetError},
|
||||
RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct statfs>>, nullptr,
|
||||
nullptr, Preamble_SetError},
|
||||
{"fstatfs$INODE64",
|
||||
RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct statfs>>,
|
||||
nullptr, nullptr, Preamble_SetError},
|
||||
RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct statfs>>, nullptr,
|
||||
nullptr, Preamble_SetError},
|
||||
{"readlink", RR_SaveRvalHadErrorNegative<RR_WriteBuffer<1, 2>>},
|
||||
{"__getdirentries64",
|
||||
RR_SaveRvalHadErrorNegative<RR_Compose<
|
||||
RR_WriteBuffer<1, 2>, RR_OutParam<3, size_t>>>},
|
||||
RR_SaveRvalHadErrorNegative<
|
||||
RR_Compose<RR_WriteBuffer<1, 2>, RR_OutParam<3, size_t>>>},
|
||||
{"getdirentriesattr",
|
||||
RR_SaveRvalHadErrorNegative<RR_Compose<
|
||||
RR_WriteBufferFixedSize<1, sizeof(struct attrlist)>,
|
||||
RR_WriteBuffer<2, 3>,
|
||||
RR_OutParam<4, size_t>,
|
||||
RR_OutParam<5, size_t>,
|
||||
RR_OutParam<6, size_t>>>},
|
||||
RR_SaveRvalHadErrorNegative<
|
||||
RR_Compose<RR_WriteBufferFixedSize<1, sizeof(struct attrlist)>,
|
||||
RR_WriteBuffer<2, 3>, RR_OutParam<4, size_t>,
|
||||
RR_OutParam<5, size_t>, RR_OutParam<6, size_t>>>},
|
||||
{"getrusage", RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct rusage>>,
|
||||
nullptr, nullptr, Preamble_SetError},
|
||||
{"getrlimit", RR_SaveRvalHadErrorNegative<RR_OutParam<1, struct rlimit>>},
|
||||
@ -2248,15 +2240,12 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"umask", RR_ScalarRval},
|
||||
{"__select",
|
||||
RR_SaveRvalHadErrorNegative<
|
||||
RR_Compose<RR_OutParam<1, fd_set>,
|
||||
RR_OutParam<2, fd_set>,
|
||||
RR_OutParam<3, fd_set>,
|
||||
RR_OutParam<4, timeval>>>,
|
||||
RR_Compose<RR_OutParam<1, fd_set>, RR_OutParam<2, fd_set>,
|
||||
RR_OutParam<3, fd_set>, RR_OutParam<4, timeval>>>,
|
||||
nullptr, nullptr, Preamble_WaitForever},
|
||||
{"__process_policy", RR_SaveRvalHadErrorNegative},
|
||||
{"__kdebug_trace", RR_SaveRvalHadErrorNegative},
|
||||
{"guarded_kqueue_np",
|
||||
RR_SaveRvalHadErrorNegative<RR_OutParam<0, size_t>>},
|
||||
{"guarded_kqueue_np", RR_SaveRvalHadErrorNegative<RR_OutParam<0, size_t>>},
|
||||
{"csops", RR_SaveRvalHadErrorNegative<RR_WriteBuffer<2, 3>>},
|
||||
{"__getlogin", RR_SaveRvalHadErrorNegative<RR_WriteBuffer<0, 1>>},
|
||||
{"__workq_kernreturn", nullptr, Preamble___workq_kernreturn},
|
||||
@ -2303,17 +2292,16 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"fwrite", RR_ScalarRval},
|
||||
{"getenv", RR_CStringRval, Preamble_getenv, nullptr, Preamble_Veto<0>},
|
||||
{"localtime_r",
|
||||
RR_SaveRvalHadErrorZero<RR_Compose<RR_OutParam<1, struct tm>,
|
||||
RR_RvalIsArgument<1>>>,
|
||||
RR_SaveRvalHadErrorZero<
|
||||
RR_Compose<RR_OutParam<1, struct tm>, RR_RvalIsArgument<1>>>,
|
||||
nullptr, nullptr, Preamble_PassThrough},
|
||||
{"gmtime_r",
|
||||
RR_SaveRvalHadErrorZero<RR_Compose<RR_OutParam<1, struct tm>,
|
||||
RR_RvalIsArgument<1>>>,
|
||||
RR_SaveRvalHadErrorZero<
|
||||
RR_Compose<RR_OutParam<1, struct tm>, RR_RvalIsArgument<1>>>,
|
||||
nullptr, nullptr, Preamble_PassThrough},
|
||||
{"localtime", nullptr, Preamble_localtime, nullptr, Preamble_PassThrough},
|
||||
{"gmtime", nullptr, Preamble_gmtime, nullptr, Preamble_PassThrough},
|
||||
{"mktime",
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<0, struct tm>>},
|
||||
{"mktime", RR_Compose<RR_ScalarRval, RR_OutParam<0, struct tm>>},
|
||||
{"setlocale", RR_CStringRval},
|
||||
{"strftime", RR_Compose<RR_ScalarRval, RR_WriteBufferViaRval<0, 1, 1>>},
|
||||
{"arc4random", RR_ScalarRval, nullptr, nullptr, Preamble_PassThrough},
|
||||
@ -2356,11 +2344,11 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"task_get_special_port",
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<2, mach_port_t>>},
|
||||
{"task_set_special_port", RR_ScalarRval},
|
||||
{"task_swap_exception_ports", RR_ScalarRval}, // Ignore out parameters
|
||||
{"time", RR_Compose<RR_ScalarRval, RR_OutParam<0, time_t>>,
|
||||
nullptr, nullptr, Preamble_PassThrough},
|
||||
{"uname", RR_SaveRvalHadErrorNegative<RR_OutParam<0, utsname>>,
|
||||
nullptr, nullptr, Preamble_SetError},
|
||||
{"task_swap_exception_ports", RR_ScalarRval}, // Ignore out parameters
|
||||
{"time", RR_Compose<RR_ScalarRval, RR_OutParam<0, time_t>>, nullptr,
|
||||
nullptr, Preamble_PassThrough},
|
||||
{"uname", RR_SaveRvalHadErrorNegative<RR_OutParam<0, utsname>>, nullptr,
|
||||
nullptr, Preamble_SetError},
|
||||
{"vm_allocate", nullptr, Preamble_VetoIfNotPassedThrough<KERN_FAILURE>},
|
||||
{"vm_copy", nullptr, Preamble_PassThrough},
|
||||
{"tzset"},
|
||||
@ -2408,8 +2396,8 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_CFArrayGetValueAtIndex},
|
||||
{"CFArrayRemoveValueAtIndex"},
|
||||
{"CFAttributedStringCreate", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>,
|
||||
EX_CFTypeArg<1>, EX_CFTypeArg<2>, EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_CFTypeArg<1>, EX_CFTypeArg<2>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CFBundleCopyExecutableURL", RR_ScalarRval},
|
||||
{"CFBundleCopyInfoDictionaryForURL", RR_ScalarRval},
|
||||
{"CFBundleCreate", RR_ScalarRval},
|
||||
@ -2432,16 +2420,13 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>, EX_CFTypeArg<1>, EX_CFTypeArg<2>>},
|
||||
{"CFDictionaryCreate", RR_ScalarRval, nullptr, EX_CFDictionaryCreate},
|
||||
{"CFDictionaryCreateMutable", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>,
|
||||
EX_ScalarArg<1>,
|
||||
EX_RequireFixed<2,
|
||||
FixedInput::kCFTypeDictionaryKeyCallBacks>,
|
||||
EX_RequireFixed<3,
|
||||
FixedInput::kCFTypeDictionaryValueCallBacks>,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_ScalarArg<1>,
|
||||
EX_RequireFixed<2, FixedInput::kCFTypeDictionaryKeyCallBacks>,
|
||||
EX_RequireFixed<3, FixedInput::kCFTypeDictionaryValueCallBacks>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CFDictionaryCreateMutableCopy", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>,
|
||||
EX_ScalarArg<1>, EX_CFTypeArg<2>, EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_ScalarArg<1>, EX_CFTypeArg<2>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CFDictionaryGetTypeID", RR_ScalarRval, nullptr, EX_NoOp},
|
||||
{"CFDictionaryGetValue", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>, EX_CFTypeRval>},
|
||||
@ -2500,13 +2485,11 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"CFStringCreateArrayBySeparatingStrings", RR_ScalarRval},
|
||||
{"CFStringCreateMutable", RR_ScalarRval},
|
||||
{"CFStringCreateWithBytes", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>,
|
||||
EX_Buffer<1, 2>, EX_ScalarArg<3>, EX_ScalarArg<4>,
|
||||
EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_Buffer<1, 2>, EX_ScalarArg<3>,
|
||||
EX_ScalarArg<4>, EX_CreateCFTypeRval>},
|
||||
{"CFStringCreateWithBytesNoCopy", RR_ScalarRval},
|
||||
{"CFStringCreateWithCharactersNoCopy", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>,
|
||||
EX_Buffer<1, 2, UniChar>,
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_Buffer<1, 2, UniChar>,
|
||||
EX_RequireFixed<3, FixedInput::kCFAllocatorNull>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CFStringCreateWithCString", RR_ScalarRval},
|
||||
@ -2522,8 +2505,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
// We also need to specify the argument register with the range's length
|
||||
// here.
|
||||
RR_WriteBuffer<3, 2, UniChar>, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>,
|
||||
EX_ScalarArg<1>,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_ScalarArg<1>,
|
||||
EX_WriteBuffer<3, 2, UniChar>>},
|
||||
{"CFStringGetCString", RR_Compose<RR_ScalarRval, RR_WriteBuffer<1, 2>>},
|
||||
{"CFStringGetCStringPtr", nullptr, Preamble_VetoIfNotPassedThrough<0>},
|
||||
@ -2546,18 +2528,17 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_Compose<EX_RequireDefaultAllocator<0>, EX_CreateCFTypeRval>},
|
||||
{"CFUUIDCreateString", RR_ScalarRval},
|
||||
{"CFUUIDGetUUIDBytes", RR_ComplexScalarRval, nullptr, EX_CFTypeArg<0>},
|
||||
{"CGAffineTransformConcat",
|
||||
RR_OversizeRval<sizeof(CGAffineTransform)>, nullptr,
|
||||
{"CGAffineTransformConcat", RR_OversizeRval<sizeof(CGAffineTransform)>,
|
||||
nullptr,
|
||||
EX_Compose<EX_StackArgumentData<2 * sizeof(CGAffineTransform)>,
|
||||
EX_OversizeRval<CGAffineTransform>>},
|
||||
{"CGAffineTransformInvert",
|
||||
RR_OversizeRval<sizeof(CGAffineTransform)>, nullptr,
|
||||
{"CGAffineTransformInvert", RR_OversizeRval<sizeof(CGAffineTransform)>,
|
||||
nullptr,
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGAffineTransform)>,
|
||||
EX_OversizeRval<CGAffineTransform>>},
|
||||
{"CGAffineTransformMakeScale",
|
||||
RR_OversizeRval<sizeof(CGAffineTransform)>, nullptr,
|
||||
EX_Compose<EX_FloatArg<0>,
|
||||
EX_FloatArg<1>,
|
||||
{"CGAffineTransformMakeScale", RR_OversizeRval<sizeof(CGAffineTransform)>,
|
||||
nullptr,
|
||||
EX_Compose<EX_FloatArg<0>, EX_FloatArg<1>,
|
||||
EX_OversizeRval<CGAffineTransform>>},
|
||||
{"CGBitmapContextCreateImage", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CreateCFTypeRval>},
|
||||
@ -2595,8 +2576,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_CFTypeArg<1>, EX_FlushCGContext<0>>},
|
||||
{"CGContextDrawLinearGradient", RR_FlushCGContext<0>, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>,
|
||||
EX_StackArgumentData<2 * sizeof(CGPoint)>,
|
||||
EX_ScalarArg<2>,
|
||||
EX_StackArgumentData<2 * sizeof(CGPoint)>, EX_ScalarArg<2>,
|
||||
EX_FlushCGContext<0>>},
|
||||
{"CGContextEndTransparencyLayer", nullptr, nullptr, EX_UpdateCFTypeArg<0>},
|
||||
{"CGContextFillPath", RR_FlushCGContext<0>, nullptr,
|
||||
@ -2630,13 +2610,11 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"CGContextSetGrayFillColor", nullptr, nullptr,
|
||||
EX_Compose<EX_FloatArg<0>, EX_FloatArg<1>, EX_UpdateCFTypeArg<0>>},
|
||||
{"CGContextSetRGBFillColor", nullptr, nullptr,
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>,
|
||||
EX_FloatArg<0>, EX_FloatArg<1>, EX_FloatArg<2>,
|
||||
EX_StackArgumentData<sizeof(CGFloat)>>},
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>, EX_FloatArg<0>, EX_FloatArg<1>,
|
||||
EX_FloatArg<2>, EX_StackArgumentData<sizeof(CGFloat)>>},
|
||||
{"CGContextSetRGBStrokeColor", nullptr, nullptr,
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>,
|
||||
EX_FloatArg<0>, EX_FloatArg<1>, EX_FloatArg<2>,
|
||||
EX_StackArgumentData<sizeof(CGFloat)>>},
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>, EX_FloatArg<0>, EX_FloatArg<1>,
|
||||
EX_FloatArg<2>, EX_StackArgumentData<sizeof(CGFloat)>>},
|
||||
{"CGContextSetShouldAntialias", nullptr, nullptr,
|
||||
EX_Compose<EX_UpdateCFTypeArg<0>, EX_ScalarArg<1>>},
|
||||
{"CGContextSetShouldSmoothFonts", nullptr, nullptr,
|
||||
@ -2706,17 +2684,16 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"CGPathContainsPoint", RR_ScalarRval},
|
||||
{"CGPathCreateMutable", RR_ScalarRval},
|
||||
{"CGPathCreateWithRoundedRect", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGRect)>,
|
||||
EX_FloatArg<0>, EX_FloatArg<1>,
|
||||
EX_InParam<0, CGAffineTransform>,
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGRect)>, EX_FloatArg<0>,
|
||||
EX_FloatArg<1>, EX_InParam<0, CGAffineTransform>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CGPathGetBoundingBox", RR_OversizeRval<sizeof(CGRect)>},
|
||||
{"CGPathGetCurrentPoint", RR_ComplexFloatRval},
|
||||
{"CGPathIsEmpty", RR_ScalarRval},
|
||||
{"CGRectApplyAffineTransform", RR_OversizeRval<sizeof(CGRect)>, nullptr,
|
||||
EX_Compose<EX_StackArgumentData<sizeof(CGRect) +
|
||||
sizeof(CGAffineTransform)>,
|
||||
EX_OversizeRval<CGRect>>},
|
||||
EX_Compose<
|
||||
EX_StackArgumentData<sizeof(CGRect) + sizeof(CGAffineTransform)>,
|
||||
EX_OversizeRval<CGRect>>},
|
||||
{"CGSSetDebugOptions", RR_ScalarRval},
|
||||
{"CGSShutdownServerConnections"},
|
||||
{"CTFontCopyFamilyName", RR_ScalarRval, nullptr,
|
||||
@ -2733,29 +2710,21 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"CTFontCopyVariationAxes", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CreateCFTypeRval>},
|
||||
{"CTFontCreateForString", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>,
|
||||
EX_ScalarArg<2>, EX_ScalarArg<3>, EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>, EX_ScalarArg<2>,
|
||||
EX_ScalarArg<3>, EX_CreateCFTypeRval>},
|
||||
{"CTFontCreatePathForGlyph", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>,
|
||||
EX_ScalarArg<1>,
|
||||
EX_InParam<2, CGAffineTransform>,
|
||||
EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_ScalarArg<1>,
|
||||
EX_InParam<2, CGAffineTransform>, EX_CreateCFTypeRval>},
|
||||
{"CTFontCreateWithFontDescriptor", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>,
|
||||
EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>,
|
||||
EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>, EX_CreateCFTypeRval>},
|
||||
{"CTFontCreateWithGraphicsFont", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>,
|
||||
EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>,
|
||||
EX_CFTypeArg<2>,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>, EX_CFTypeArg<2>,
|
||||
EX_CreateCFTypeRval>},
|
||||
{"CTFontCreateWithName", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>,
|
||||
EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>,
|
||||
EX_CreateCFTypeRval>},
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_FloatArg<0>,
|
||||
EX_InParam<1, CGAffineTransform>, EX_CreateCFTypeRval>},
|
||||
{"CTFontDescriptorCopyAttribute", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>, EX_CreateCFTypeRval>},
|
||||
{"CTFontDescriptorCreateCopyWithAttributes", RR_ScalarRval, nullptr,
|
||||
@ -2769,8 +2738,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_Buffer<2, 3, CGPoint>, EX_FlushCGContext<4>>},
|
||||
{"CTFontGetAdvancesForGlyphs",
|
||||
RR_Compose<RR_FloatRval, RR_WriteOptionalBuffer<3, 4, CGSize>>, nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_ScalarArg<1>,
|
||||
EX_Buffer<2, 4, CGGlyph>,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_ScalarArg<1>, EX_Buffer<2, 4, CGGlyph>,
|
||||
EX_WriteBuffer<3, 4, CGSize>>},
|
||||
{"CTFontGetAscent", RR_FloatRval, nullptr, EX_CFTypeArg<0>},
|
||||
{"CTFontGetBoundingBox", RR_OversizeRval<sizeof(CGRect)>, nullptr,
|
||||
@ -2780,8 +2748,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
RR_Compose<RR_OversizeRval<sizeof(CGRect)>,
|
||||
RR_WriteOptionalBuffer<4, 5, CGRect>>,
|
||||
nullptr,
|
||||
EX_Compose<EX_CFTypeArg<1>, EX_ScalarArg<2>,
|
||||
EX_Buffer<3, 5, CGGlyph>,
|
||||
EX_Compose<EX_CFTypeArg<1>, EX_ScalarArg<2>, EX_Buffer<3, 5, CGGlyph>,
|
||||
EX_OversizeRval<CGRect>, EX_WriteBuffer<4, 5, CGRect>>},
|
||||
{"CTFontGetCapHeight", RR_FloatRval, nullptr, EX_CFTypeArg<0>},
|
||||
{"CTFontGetDescent", RR_FloatRval, nullptr, EX_CFTypeArg<0>},
|
||||
@ -2818,9 +2785,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
{"CTRunGetTypographicBounds",
|
||||
// Argument indexes are off by one here as the CFRange argument uses two
|
||||
// slots.
|
||||
RR_Compose<RR_FloatRval,
|
||||
RR_OutParam<3, CGFloat>,
|
||||
RR_OutParam<4, CGFloat>,
|
||||
RR_Compose<RR_FloatRval, RR_OutParam<3, CGFloat>, RR_OutParam<4, CGFloat>,
|
||||
RR_OutParam<5, CGFloat>>,
|
||||
nullptr,
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_ScalarArg<1>, EX_ScalarArg<2>,
|
||||
@ -2830,10 +2795,8 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
EX_Compose<EX_CFTypeArg<0>, EX_CFTypeArg<1>, EX_CFTypeArg<2>,
|
||||
EX_StackArgumentData<sizeof(CGRect)>>},
|
||||
{"FSCompareFSRefs", RR_ScalarRval},
|
||||
{"FSGetVolumeInfo",
|
||||
RR_Compose<RR_ScalarRval,
|
||||
RR_OutParam<5, HFSUniStr255>,
|
||||
RR_OutParam<6, FSRef>>},
|
||||
{"FSGetVolumeInfo", RR_Compose<RR_ScalarRval, RR_OutParam<5, HFSUniStr255>,
|
||||
RR_OutParam<6, FSRef>>},
|
||||
{"FSFindFolder", RR_Compose<RR_ScalarRval, RR_OutParam<3, FSRef>>},
|
||||
{"Gestalt", RR_Compose<RR_ScalarRval, RR_OutParam<1, SInt32>>},
|
||||
{"GetEventClass", RR_ScalarRval},
|
||||
@ -2847,65 +2810,42 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
nullptr, EX_Compose<EX_ScalarArg<0>, EX_OutParam<1, SInt32>>},
|
||||
{"HIThemeDrawButton", RR_Compose<RR_OutParam<4, HIRect>, RR_ScalarRval>,
|
||||
nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeButtonDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>,
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeButtonDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>,
|
||||
EX_OutParam<4, HIRect>>},
|
||||
{"HIThemeDrawFrame", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeFrameDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeFrameDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawGroupBox", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeGroupBoxDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeGroupBoxDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawGrowBox", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIPoint>,
|
||||
EX_InParam<1, HIThemeGrowBoxDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIPoint>, EX_InParam<1, HIThemeGrowBoxDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawMenuBackground", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeMenuDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeMenuDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawMenuItem", RR_Compose<RR_OutParam<5, HIRect>, RR_ScalarRval>,
|
||||
nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIRect>,
|
||||
EX_InParam<2, HIThemeMenuItemDrawInfo>,
|
||||
EX_UpdateCFTypeArg<3>,
|
||||
EX_ScalarArg<4>,
|
||||
EX_OutParam<5, HIRect>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIRect>,
|
||||
EX_InParam<2, HIThemeMenuItemDrawInfo>, EX_UpdateCFTypeArg<3>,
|
||||
EX_ScalarArg<4>, EX_OutParam<5, HIRect>>},
|
||||
{"HIThemeDrawMenuSeparator", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIRect>,
|
||||
EX_InParam<2, HIThemeMenuItemDrawInfo>,
|
||||
EX_UpdateCFTypeArg<3>,
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIRect>,
|
||||
EX_InParam<2, HIThemeMenuItemDrawInfo>, EX_UpdateCFTypeArg<3>,
|
||||
EX_ScalarArg<4>>},
|
||||
{"HIThemeDrawSeparator", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeSeparatorDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeSeparatorDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawTabPane", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIRect>,
|
||||
EX_InParam<1, HIThemeTabPaneDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIRect>, EX_InParam<1, HIThemeTabPaneDrawInfo>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeDrawTrack", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIThemeTrackDrawInfo>,
|
||||
EX_InParam<1, HIRect>,
|
||||
EX_UpdateCFTypeArg<2>,
|
||||
EX_ScalarArg<3>>},
|
||||
EX_Compose<EX_InParam<0, HIThemeTrackDrawInfo>, EX_InParam<1, HIRect>,
|
||||
EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
{"HIThemeGetGrowBoxBounds",
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<2, HIRect>>,
|
||||
nullptr,
|
||||
EX_Compose<EX_InParam<0, HIPoint>,
|
||||
EX_InParam<1, HIThemeGrowBoxDrawInfo>,
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<2, HIRect>>, nullptr,
|
||||
EX_Compose<EX_InParam<0, HIPoint>, EX_InParam<1, HIThemeGrowBoxDrawInfo>,
|
||||
EX_OutParam<2, HIRect>>},
|
||||
{"HIThemeSetFill", RR_ScalarRval, nullptr,
|
||||
EX_Compose<EX_ScalarArg<0>, EX_UpdateCFTypeArg<2>, EX_ScalarArg<3>>},
|
||||
@ -2917,14 +2857,10 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<3, CFTypeRef>>},
|
||||
{"LSCopyKindStringForMIMEType",
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<1, CFStringRef>>},
|
||||
{"LSGetApplicationForInfo",
|
||||
RR_Compose<RR_ScalarRval,
|
||||
RR_OutParam<4, FSRef>,
|
||||
RR_OutParam<5, CFURLRef>>},
|
||||
{"LSGetApplicationForURL",
|
||||
RR_Compose<RR_ScalarRval,
|
||||
RR_OutParam<2, FSRef>,
|
||||
RR_OutParam<3, CFURLRef>>},
|
||||
{"LSGetApplicationForInfo", RR_Compose<RR_ScalarRval, RR_OutParam<4, FSRef>,
|
||||
RR_OutParam<5, CFURLRef>>},
|
||||
{"LSGetApplicationForURL", RR_Compose<RR_ScalarRval, RR_OutParam<2, FSRef>,
|
||||
RR_OutParam<3, CFURLRef>>},
|
||||
{"LSCopyDefaultApplicationURLForURL",
|
||||
RR_Compose<RR_ScalarRval, RR_OutParam<2, CFErrorRef>>},
|
||||
{"NSClassFromString", RR_ScalarRval, nullptr,
|
||||
@ -2971,9 +2907,7 @@ static SystemRedirection gSystemRedirections[] = {
|
||||
// Redirection Generation
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
size_t NumRedirections() {
|
||||
return ArrayLength(gSystemRedirections);
|
||||
}
|
||||
size_t NumRedirections() { return ArrayLength(gSystemRedirections); }
|
||||
|
||||
static Redirection* gRedirections;
|
||||
|
||||
@ -3036,9 +2970,8 @@ void InitializeRedirections() {
|
||||
redirection.mOriginalFunction = FunctionStartAddress(redirection);
|
||||
|
||||
if (IsRecordingOrReplaying()) {
|
||||
redirection.mRedirectedFunction =
|
||||
GenerateRedirectStub(assembler.ref(), i,
|
||||
PreserveCallerSaveRegisters(redirection.mName));
|
||||
redirection.mRedirectedFunction = GenerateRedirectStub(
|
||||
assembler.ref(), i, PreserveCallerSaveRegisters(redirection.mName));
|
||||
gRedirectionAddresses->insert(RedirectionAddressMap::value_type(
|
||||
std::string(redirection.mName), redirection.mRedirectedFunction));
|
||||
}
|
||||
@ -3085,8 +3018,7 @@ static void ApplyBinding(const char* aName, void** aPtr) {
|
||||
void* binding = FindRedirectionBinding(aName);
|
||||
if (binding) {
|
||||
if (!strcmp(aName, "_tlv_bootstrap")) {
|
||||
MOZ_RELEASE_ASSERT(gTLVGetAddress == nullptr ||
|
||||
gTLVGetAddress == *aPtr);
|
||||
MOZ_RELEASE_ASSERT(gTLVGetAddress == nullptr || gTLVGetAddress == *aPtr);
|
||||
gTLVGetAddress = *aPtr;
|
||||
}
|
||||
*aPtr = binding;
|
||||
@ -3131,8 +3063,8 @@ struct MachOLibrary {
|
||||
MOZ_RELEASE_ASSERT(rv >= 0);
|
||||
|
||||
mFileSize = info.st_size;
|
||||
mFileAddress = (uint8_t*)mmap(nullptr, mFileSize, PROT_READ,
|
||||
MAP_PRIVATE, mFile, 0);
|
||||
mFileAddress =
|
||||
(uint8_t*)mmap(nullptr, mFileSize, PROT_READ, MAP_PRIVATE, mFile, 0);
|
||||
MOZ_RELEASE_ASSERT(mFileAddress != MAP_FAILED);
|
||||
|
||||
mach_header_64* header = (mach_header_64*)mFileAddress;
|
||||
@ -3146,50 +3078,50 @@ struct MachOLibrary {
|
||||
|
||||
void ApplyRedirections() {
|
||||
ForEachCommand([=](load_command* aCmd) {
|
||||
switch (aCmd->cmd & ~LC_REQ_DYLD) {
|
||||
case LC_SYMTAB:
|
||||
AddSymbolTable((symtab_command*)aCmd);
|
||||
break;
|
||||
case LC_DYSYMTAB:
|
||||
AddDynamicSymbolTable((dysymtab_command*)aCmd);
|
||||
break;
|
||||
}
|
||||
});
|
||||
switch (aCmd->cmd & ~LC_REQ_DYLD) {
|
||||
case LC_SYMTAB:
|
||||
AddSymbolTable((symtab_command*)aCmd);
|
||||
break;
|
||||
case LC_DYSYMTAB:
|
||||
AddDynamicSymbolTable((dysymtab_command*)aCmd);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
ForEachCommand([=](load_command* aCmd) {
|
||||
switch (aCmd->cmd & ~LC_REQ_DYLD) {
|
||||
case LC_DYLD_INFO:
|
||||
BindLoadInfo((dyld_info_command*)aCmd);
|
||||
break;
|
||||
case LC_SEGMENT_64: {
|
||||
auto ncmd = (segment_command_64*)aCmd;
|
||||
mSegments.append(ncmd);
|
||||
BindSegment(ncmd);
|
||||
break;
|
||||
}
|
||||
switch (aCmd->cmd & ~LC_REQ_DYLD) {
|
||||
case LC_DYLD_INFO:
|
||||
BindLoadInfo((dyld_info_command*)aCmd);
|
||||
break;
|
||||
case LC_SEGMENT_64: {
|
||||
auto ncmd = (segment_command_64*)aCmd;
|
||||
mSegments.append(ncmd);
|
||||
BindSegment(ncmd);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void ForEachCommand(const std::function<void(load_command*)>& aCallback) {
|
||||
mach_header_64* header = (mach_header_64*)mFileAddress;
|
||||
uint32_t offset = sizeof(mach_header_64);
|
||||
for (size_t i = 0; i < header->ncmds; i++) {
|
||||
load_command* cmd = (load_command*) (mFileAddress + offset);
|
||||
load_command* cmd = (load_command*)(mFileAddress + offset);
|
||||
aCallback(cmd);
|
||||
offset += cmd->cmdsize;
|
||||
}
|
||||
}
|
||||
|
||||
void AddSymbolTable(symtab_command* aCmd) {
|
||||
mSymbolTable = (nlist_64*) (mFileAddress + aCmd->symoff);
|
||||
mSymbolTable = (nlist_64*)(mFileAddress + aCmd->symoff);
|
||||
mSymbolCount = aCmd->nsyms;
|
||||
|
||||
mStringTable = (char*) (mFileAddress + aCmd->stroff);
|
||||
mStringTable = (char*)(mFileAddress + aCmd->stroff);
|
||||
}
|
||||
|
||||
void AddDynamicSymbolTable(dysymtab_command* aCmd) {
|
||||
mIndirectSymbols = (uint32_t*) (mFileAddress + aCmd->indirectsymoff);
|
||||
mIndirectSymbols = (uint32_t*)(mFileAddress + aCmd->indirectsymoff);
|
||||
mIndirectSymbolCount = aCmd->nindirectsyms;
|
||||
}
|
||||
|
||||
@ -3237,29 +3169,29 @@ struct MachOLibrary {
|
||||
case BIND_OPCODE_SET_ADDEND_SLEB:
|
||||
break;
|
||||
case BIND_OPCODE_DO_BIND:
|
||||
DoBinding(segmentIndex, segmentOffset,
|
||||
symbolName, symbolFlags, symbolType);
|
||||
DoBinding(segmentIndex, segmentOffset, symbolName, symbolFlags,
|
||||
symbolType);
|
||||
segmentOffset += sizeof(uintptr_t);
|
||||
break;
|
||||
case BIND_OPCODE_ADD_ADDR_ULEB:
|
||||
segmentOffset += ReadLEB128(cursor, end);
|
||||
break;
|
||||
case BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB:
|
||||
DoBinding(segmentIndex, segmentOffset,
|
||||
symbolName, symbolFlags, symbolType);
|
||||
DoBinding(segmentIndex, segmentOffset, symbolName, symbolFlags,
|
||||
symbolType);
|
||||
segmentOffset += ReadLEB128(cursor, end) + sizeof(uintptr_t);
|
||||
break;
|
||||
case BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED:
|
||||
DoBinding(segmentIndex, segmentOffset,
|
||||
symbolName, symbolFlags, symbolType);
|
||||
DoBinding(segmentIndex, segmentOffset, symbolName, symbolFlags,
|
||||
symbolType);
|
||||
segmentOffset += immediate * sizeof(uintptr_t) + sizeof(uintptr_t);
|
||||
break;
|
||||
case BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB: {
|
||||
size_t count = ReadLEB128(cursor, end);
|
||||
size_t skip = ReadLEB128(cursor, end);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
DoBinding(segmentIndex, segmentOffset,
|
||||
symbolName, symbolFlags, symbolType);
|
||||
DoBinding(segmentIndex, segmentOffset, symbolName, symbolFlags,
|
||||
symbolType);
|
||||
segmentOffset += skip + sizeof(uintptr_t);
|
||||
}
|
||||
break;
|
||||
@ -3279,12 +3211,12 @@ struct MachOLibrary {
|
||||
uint8_t* address = mAddress + seg->vmaddr + aSegmentOffset;
|
||||
|
||||
MOZ_RELEASE_ASSERT(aSymbolType == BIND_TYPE_POINTER);
|
||||
void** ptr = (void**) address;
|
||||
void** ptr = (void**)address;
|
||||
ApplyBinding(aSymbolName, ptr);
|
||||
}
|
||||
|
||||
void BindSegment(segment_command_64* aCmd) {
|
||||
section_64* sect = (section_64*) (aCmd + 1);
|
||||
section_64* sect = (section_64*)(aCmd + 1);
|
||||
for (size_t i = 0; i < aCmd->nsects; i++, sect++) {
|
||||
switch (sect->flags & SECTION_TYPE) {
|
||||
case S_NON_LAZY_SYMBOL_POINTERS:
|
||||
@ -3316,11 +3248,11 @@ struct MachOLibrary {
|
||||
// so we check again after each new library is loaded, and clear out these
|
||||
// entries once we have fixed their external references.
|
||||
static const char* gInitialLibrarySymbols[] = {
|
||||
"RecordReplayInterface_Initialize", // XUL
|
||||
"_ZN7mozilla12recordreplay10InitializeEiPPc", // libmozglue
|
||||
"PR_Initialize", // libnss3
|
||||
"FREEBL_GetVector", // libfreebl
|
||||
"NSC_GetFunctionList", // libsoftokn3
|
||||
"RecordReplayInterface_Initialize", // XUL
|
||||
"_ZN7mozilla12recordreplay10InitializeEiPPc", // libmozglue
|
||||
"PR_Initialize", // libnss3
|
||||
"FREEBL_GetVector", // libfreebl
|
||||
"NSC_GetFunctionList", // libsoftokn3
|
||||
};
|
||||
|
||||
void ApplyLibraryRedirections(void* aLibrary) {
|
||||
@ -3371,35 +3303,36 @@ struct PlatformSymbol {
|
||||
uint32_t mValue;
|
||||
};
|
||||
|
||||
#define NewPlatformSymbol(Name) { #Name, Name }
|
||||
#define NewPlatformSymbol(Name) \
|
||||
{ #Name, Name }
|
||||
|
||||
extern "C" {
|
||||
|
||||
MOZ_EXPORT PlatformSymbol RecordReplayInterface_PlatformSymbols[] = {
|
||||
NewPlatformSymbol(PROT_READ),
|
||||
NewPlatformSymbol(PROT_WRITE),
|
||||
NewPlatformSymbol(PROT_EXEC),
|
||||
NewPlatformSymbol(MAP_FIXED),
|
||||
NewPlatformSymbol(MAP_PRIVATE),
|
||||
NewPlatformSymbol(MAP_ANON),
|
||||
NewPlatformSymbol(MAP_NORESERVE),
|
||||
NewPlatformSymbol(PTHREAD_MUTEX_NORMAL),
|
||||
NewPlatformSymbol(PTHREAD_MUTEX_RECURSIVE),
|
||||
NewPlatformSymbol(PTHREAD_CREATE_JOINABLE),
|
||||
NewPlatformSymbol(PTHREAD_CREATE_DETACHED),
|
||||
NewPlatformSymbol(SYS_thread_selfid),
|
||||
NewPlatformSymbol(_SC_PAGESIZE),
|
||||
NewPlatformSymbol(_SC_NPROCESSORS_CONF),
|
||||
NewPlatformSymbol(RLIMIT_AS),
|
||||
NewPlatformSymbol(ETIMEDOUT),
|
||||
NewPlatformSymbol(EINTR),
|
||||
NewPlatformSymbol(EPIPE),
|
||||
NewPlatformSymbol(EAGAIN),
|
||||
NewPlatformSymbol(ECONNRESET),
|
||||
{ nullptr, 0 },
|
||||
NewPlatformSymbol(PROT_READ),
|
||||
NewPlatformSymbol(PROT_WRITE),
|
||||
NewPlatformSymbol(PROT_EXEC),
|
||||
NewPlatformSymbol(MAP_FIXED),
|
||||
NewPlatformSymbol(MAP_PRIVATE),
|
||||
NewPlatformSymbol(MAP_ANON),
|
||||
NewPlatformSymbol(MAP_NORESERVE),
|
||||
NewPlatformSymbol(PTHREAD_MUTEX_NORMAL),
|
||||
NewPlatformSymbol(PTHREAD_MUTEX_RECURSIVE),
|
||||
NewPlatformSymbol(PTHREAD_CREATE_JOINABLE),
|
||||
NewPlatformSymbol(PTHREAD_CREATE_DETACHED),
|
||||
NewPlatformSymbol(SYS_thread_selfid),
|
||||
NewPlatformSymbol(_SC_PAGESIZE),
|
||||
NewPlatformSymbol(_SC_NPROCESSORS_CONF),
|
||||
NewPlatformSymbol(RLIMIT_AS),
|
||||
NewPlatformSymbol(ETIMEDOUT),
|
||||
NewPlatformSymbol(EINTR),
|
||||
NewPlatformSymbol(EPIPE),
|
||||
NewPlatformSymbol(EAGAIN),
|
||||
NewPlatformSymbol(ECONNRESET),
|
||||
{nullptr, 0},
|
||||
};
|
||||
|
||||
} // extern "C"
|
||||
} // extern "C"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Direct system call API
|
||||
@ -3488,8 +3421,8 @@ void InitializeCurrentTime() {
|
||||
}
|
||||
|
||||
double CurrentTime() {
|
||||
return CallFunction<int64_t>(gOriginal_mach_absolute_time) *
|
||||
gNsPerTick / 1000.0;
|
||||
return CallFunction<int64_t>(gOriginal_mach_absolute_time) * gNsPerTick /
|
||||
1000.0;
|
||||
}
|
||||
|
||||
NativeThreadId DirectSpawnThread(void (*aFunction)(void*), void* aArgument,
|
||||
|
@ -27,9 +27,7 @@ static Monitor* gMainThreadCallbackMonitor;
|
||||
// gMainThreadCallbackMonitor.
|
||||
static StaticInfallibleVector<std::function<void()>> gMainThreadCallbacks;
|
||||
|
||||
void InitializeRewindState() {
|
||||
gMainThreadCallbackMonitor = new Monitor();
|
||||
}
|
||||
void InitializeRewindState() { gMainThreadCallbackMonitor = new Monitor(); }
|
||||
|
||||
void NewCheckpoint() {
|
||||
MOZ_RELEASE_ASSERT(Thread::CurrentIsMainThread());
|
||||
|
@ -180,10 +180,9 @@ void Stream::RecordOrReplayThreadEvent(ThreadEvent aEvent, const char* aExtra) {
|
||||
}
|
||||
extra = ReadInputString();
|
||||
}
|
||||
child::ReportFatalError(
|
||||
"Event Mismatch: Recorded %s %s Replayed %s %s",
|
||||
ThreadEventName(oldEvent), extra,
|
||||
ThreadEventName(aEvent), aExtra ? aExtra : "");
|
||||
child::ReportFatalError("Event Mismatch: Recorded %s %s Replayed %s %s",
|
||||
ThreadEventName(oldEvent), extra,
|
||||
ThreadEventName(aEvent), aExtra ? aExtra : "");
|
||||
}
|
||||
mLastEvent = aEvent;
|
||||
PushEvent(ThreadEventName(aEvent));
|
||||
@ -297,9 +296,8 @@ void Stream::Flush(bool aTakeLock) {
|
||||
MOZ_RELEASE_ASSERT((size_t)compressedSize <= bound);
|
||||
|
||||
StreamChunkLocation chunk =
|
||||
mRecording->WriteChunk(mName, mNameIndex,
|
||||
mBallast.get(), compressedSize, mBufferPos,
|
||||
mStreamPos - mBufferPos, aTakeLock);
|
||||
mRecording->WriteChunk(mName, mNameIndex, mBallast.get(), compressedSize,
|
||||
mBufferPos, mStreamPos - mBufferPos, aTakeLock);
|
||||
mChunks.append(chunk);
|
||||
MOZ_ALWAYS_TRUE(++mChunkIndex == mChunks.length());
|
||||
|
||||
@ -396,7 +394,7 @@ void Recording::NewContents(const uint8_t* aContents, size_t aSize,
|
||||
MOZ_RELEASE_ASSERT(aSize >= sizeof(Header));
|
||||
offset += sizeof(Header);
|
||||
|
||||
Header* header = (Header*) aContents;
|
||||
Header* header = (Header*)aContents;
|
||||
MOZ_RELEASE_ASSERT(header->mMagic == MagicValue);
|
||||
|
||||
BuildId currentBuildId;
|
||||
@ -452,7 +450,7 @@ StreamChunkLocation Recording::WriteChunk(StreamName aName, size_t aNameIndex,
|
||||
chunk.mStreamPos = aStreamPos;
|
||||
|
||||
ChunkDescriptor desc;
|
||||
desc.mName = (uint32_t) aName;
|
||||
desc.mName = (uint32_t)aName;
|
||||
desc.mNameIndex = aNameIndex;
|
||||
desc.mChunk = chunk;
|
||||
|
||||
@ -464,7 +462,8 @@ StreamChunkLocation Recording::WriteChunk(StreamName aName, size_t aNameIndex,
|
||||
|
||||
void Recording::ReadChunk(char* aDest, const StreamChunkLocation& aChunk) {
|
||||
AutoSpinLock lock(mLock);
|
||||
MOZ_RELEASE_ASSERT(aChunk.mOffset + aChunk.mCompressedSize <= mContents.length());
|
||||
MOZ_RELEASE_ASSERT(aChunk.mOffset + aChunk.mCompressedSize <=
|
||||
mContents.length());
|
||||
memcpy(aDest, mContents.begin() + aChunk.mOffset, aChunk.mCompressedSize);
|
||||
MOZ_RELEASE_ASSERT(HashBytes(aDest, aChunk.mCompressedSize) == aChunk.mHash);
|
||||
}
|
||||
|
@ -177,7 +177,8 @@ class Stream {
|
||||
|
||||
// Note a new thread event for this stream, and make sure it is the same
|
||||
// while replaying as it was while recording.
|
||||
void RecordOrReplayThreadEvent(ThreadEvent aEvent, const char* aExtra = nullptr);
|
||||
void RecordOrReplayThreadEvent(ThreadEvent aEvent,
|
||||
const char* aExtra = nullptr);
|
||||
|
||||
// Replay a thread event without requiring it to be a specific event.
|
||||
ThreadEvent ReplayThreadEvent();
|
||||
|
@ -113,7 +113,7 @@ void Thread::InitializeThreads() {
|
||||
gThreads = new Thread[MaxThreadId + 1];
|
||||
|
||||
size_t nbytes = (MaxThreadId - MainThreadId) * ThreadStackSize;
|
||||
gThreadStackMemory = (uint8_t*) DirectAllocateMemory(nbytes);
|
||||
gThreadStackMemory = (uint8_t*)DirectAllocateMemory(nbytes);
|
||||
|
||||
for (size_t i = MainThreadId; i <= MaxThreadId; i++) {
|
||||
Thread* thread = &gThreads[i];
|
||||
@ -127,7 +127,8 @@ void Thread::InitializeThreads() {
|
||||
thread->BindToCurrent();
|
||||
thread->mNativeId = DirectCurrentThread();
|
||||
} else {
|
||||
thread->mStackBase = gThreadStackMemory + (i - MainThreadId - 1) * ThreadStackSize;
|
||||
thread->mStackBase =
|
||||
gThreadStackMemory + (i - MainThreadId - 1) * ThreadStackSize;
|
||||
thread->mStackSize = ThreadStackSize - PageSize * 2;
|
||||
|
||||
// Make some memory between thread stacks inaccessible so that breakpad
|
||||
@ -321,7 +322,8 @@ void Thread::ReleaseOrAcquireOwnedLocks(OwnedLockState aState) {
|
||||
}
|
||||
|
||||
void** Thread::GetOrCreateStorage(uintptr_t aKey) {
|
||||
for (StorageEntry** pentry = &mStorageEntries; *pentry; pentry = &(*pentry)->mNext) {
|
||||
for (StorageEntry** pentry = &mStorageEntries; *pentry;
|
||||
pentry = &(*pentry)->mNext) {
|
||||
StorageEntry* entry = *pentry;
|
||||
if (entry->mKey == aKey) {
|
||||
// Put this at the front of the list.
|
||||
@ -331,7 +333,7 @@ void** Thread::GetOrCreateStorage(uintptr_t aKey) {
|
||||
return &entry->mData;
|
||||
}
|
||||
}
|
||||
StorageEntry* entry = (StorageEntry*) AllocateStorage(sizeof(StorageEntry));
|
||||
StorageEntry* entry = (StorageEntry*)AllocateStorage(sizeof(StorageEntry));
|
||||
entry->mKey = aKey;
|
||||
entry->mData = 0;
|
||||
entry->mNext = mStorageEntries;
|
||||
@ -343,7 +345,7 @@ uint8_t* Thread::AllocateStorage(size_t aSize) {
|
||||
// malloc uses TLS, so go directly to the system to allocate TLS storage.
|
||||
if (mStorageCursor + aSize >= mStorageLimit) {
|
||||
size_t nbytes = std::max(aSize, PageSize);
|
||||
mStorageCursor = (uint8_t*) DirectAllocateMemory(nbytes);
|
||||
mStorageCursor = (uint8_t*)DirectAllocateMemory(nbytes);
|
||||
mStorageLimit = mStorageCursor + nbytes;
|
||||
}
|
||||
uint8_t* res = mStorageCursor;
|
||||
@ -510,8 +512,7 @@ void Thread::NotifyUnrecordedWait(
|
||||
}
|
||||
}
|
||||
|
||||
bool Thread::MaybeWaitForFork(
|
||||
const std::function<void()>& aReleaseCallback) {
|
||||
bool Thread::MaybeWaitForFork(const std::function<void()>& aReleaseCallback) {
|
||||
MOZ_RELEASE_ASSERT(!PassThroughEvents());
|
||||
if (IsMainThread()) {
|
||||
return false;
|
||||
|
@ -173,7 +173,6 @@ class Thread {
|
||||
uint8_t* AllocateStorage(size_t aSize);
|
||||
|
||||
public:
|
||||
|
||||
// These are used by certain redirections to convey information from the
|
||||
// SaveOutput hook to the MiddlemanCall hook.
|
||||
uintptr_t mRedirectionValue;
|
||||
@ -236,9 +235,7 @@ class Thread {
|
||||
}
|
||||
|
||||
// Get the macOS mach identifier for this thread.
|
||||
uintptr_t GetMachId() const {
|
||||
return mMachId;
|
||||
}
|
||||
uintptr_t GetMachId() const { return mMachId; }
|
||||
|
||||
// The actual start routine at the root of all recorded threads, and of all
|
||||
// threads when replaying.
|
||||
|
@ -175,8 +175,7 @@ bool SaveThreadState(size_t aId, int* aStackSeparator) {
|
||||
|
||||
MOZ_RELEASE_ASSERT(aId <= MaxThreadId);
|
||||
ThreadState* info = &gThreadState[aId];
|
||||
bool res =
|
||||
SaveThreadStateOrReturnFromRestore(info, aStackSeparator) == 0;
|
||||
bool res = SaveThreadStateOrReturnFromRestore(info, aStackSeparator) == 0;
|
||||
if (!res) {
|
||||
ClearThreadState(info);
|
||||
}
|
||||
@ -199,13 +198,12 @@ void SaveThreadStack(size_t aId) {
|
||||
// Release any existing stack contents from a previous fork.
|
||||
free(info.mStackContents);
|
||||
|
||||
info.mStackContents = (uint8_t*) malloc(stackBytes);
|
||||
info.mStackContents = (uint8_t*)malloc(stackBytes);
|
||||
info.mStackBytes = stackBytes;
|
||||
|
||||
memcpy(info.mStackContents, info.mStackTop, info.mStackTopBytes);
|
||||
memcpy(info.mStackContents + info.mStackTopBytes,
|
||||
stackPointer + info.mStackTopBytes,
|
||||
stackBytes - info.mStackTopBytes);
|
||||
stackPointer + info.mStackTopBytes, stackBytes - info.mStackTopBytes);
|
||||
}
|
||||
|
||||
void RestoreThreadStack(size_t aId) {
|
||||
|
@ -68,7 +68,8 @@ Channel::Channel(size_t aId, Kind aKind, const MessageHandler& aHandler,
|
||||
mConnectionFd(0),
|
||||
mFd(0),
|
||||
mMessageBytes(0) {
|
||||
MOZ_RELEASE_ASSERT(!IsRecordingOrReplaying() || AreThreadEventsPassedThrough());
|
||||
MOZ_RELEASE_ASSERT(!IsRecordingOrReplaying() ||
|
||||
AreThreadEventsPassedThrough());
|
||||
|
||||
if (IsParent()) {
|
||||
ipc::FileDescriptor connection;
|
||||
@ -223,8 +224,7 @@ Message::UniquePtr Channel::WaitForMessage() {
|
||||
// Remove the message we just received from the incoming buffer.
|
||||
size_t remaining = mMessageBytes - messageSize;
|
||||
if (remaining) {
|
||||
memmove(mMessageBuffer.begin(), &mMessageBuffer[messageSize],
|
||||
remaining);
|
||||
memmove(mMessageBuffer.begin(), &mMessageBuffer[messageSize], remaining);
|
||||
}
|
||||
mMessageBytes = remaining;
|
||||
|
||||
|
@ -41,11 +41,11 @@ namespace recordreplay {
|
||||
// replaying process rewinds itself. A few exceptions to this rule are noted
|
||||
// below.
|
||||
|
||||
#define ForEachMessageType(_Macro) \
|
||||
#define ForEachMessageType(_Macro) \
|
||||
/* Messages which can be interpreted or constructed by the cloud server. */ \
|
||||
/* Avoid changing the message IDs for these. */ \
|
||||
\
|
||||
/* Sent by the middleman at startup. */ \
|
||||
/* Avoid changing the message IDs for these. */ \
|
||||
\
|
||||
/* Sent by the middleman at startup. */ \
|
||||
_Macro(Introduction) \
|
||||
\
|
||||
/* An error occurred in the cloud server. */ \
|
||||
@ -162,10 +162,8 @@ struct Message {
|
||||
return mType == MessageType::CreateCheckpoint ||
|
||||
mType == MessageType::SetDebuggerRunsInMiddleman ||
|
||||
mType == MessageType::ExternalCallResponse ||
|
||||
mType == MessageType::Ping ||
|
||||
mType == MessageType::Terminate ||
|
||||
mType == MessageType::Crash ||
|
||||
mType == MessageType::Introduction ||
|
||||
mType == MessageType::Ping || mType == MessageType::Terminate ||
|
||||
mType == MessageType::Crash || mType == MessageType::Introduction ||
|
||||
mType == MessageType::RecordingData;
|
||||
}
|
||||
|
||||
@ -286,7 +284,8 @@ struct ErrorMessage : public Message {
|
||||
typedef ErrorMessage<MessageType::FatalError> FatalErrorMessage;
|
||||
typedef ErrorMessage<MessageType::CloudError> CloudErrorMessage;
|
||||
|
||||
typedef EmptyMessage<MessageType::UnhandledDivergence> UnhandledDivergenceMessage;
|
||||
typedef EmptyMessage<MessageType::UnhandledDivergence>
|
||||
UnhandledDivergenceMessage;
|
||||
|
||||
// The format for graphics data which will be sent to the middleman process.
|
||||
// This needs to match the format expected for canvas image data, to avoid
|
||||
@ -426,7 +425,7 @@ class Channel {
|
||||
|
||||
// Return whether this is the parent side of a connection. This side is opened
|
||||
// first and the child will connect to it afterwards.
|
||||
bool IsParent() {
|
||||
bool IsParent() {
|
||||
switch (mKind) {
|
||||
case Kind::MiddlemanRecord:
|
||||
case Kind::MiddlemanReplay:
|
||||
|
@ -161,8 +161,8 @@ static void ChannelMessageHandler(Message::UniquePtr aMsg) {
|
||||
case MessageType::RecordingData: {
|
||||
MonitorAutoLock lock(*gMonitor);
|
||||
const RecordingDataMessage& nmsg = (const RecordingDataMessage&)*aMsg;
|
||||
MOZ_RELEASE_ASSERT(
|
||||
nmsg.mTag == gRecording->Size() + gPendingRecordingData.length());
|
||||
MOZ_RELEASE_ASSERT(nmsg.mTag ==
|
||||
gRecording->Size() + gPendingRecordingData.length());
|
||||
gPendingRecordingData.append(nmsg.BinaryData(), nmsg.BinaryDataSize());
|
||||
gMonitor->NotifyAll();
|
||||
break;
|
||||
@ -351,9 +351,9 @@ static void ForkListenerThread(void*) {
|
||||
int nbytes = read(gForkReadFd, &process, sizeof(process));
|
||||
MOZ_RELEASE_ASSERT(nbytes == sizeof(process));
|
||||
|
||||
process.mChannel = new Channel(0, Channel::Kind::ReplayRoot,
|
||||
HandleMessageFromForkedProcess,
|
||||
process.mPid);
|
||||
process.mChannel =
|
||||
new Channel(0, Channel::Kind::ReplayRoot,
|
||||
HandleMessageFromForkedProcess, process.mPid);
|
||||
|
||||
// Send any messages destined for this fork.
|
||||
size_t i = 0;
|
||||
@ -377,8 +377,9 @@ static void InitializeForkListener() {
|
||||
Thread::SpawnNonRecordedThread(ForkListenerThread, nullptr);
|
||||
|
||||
if (!ReplayingInCloud()) {
|
||||
gFatalErrorMemory = (char*) mmap(nullptr, FatalErrorMemorySize,
|
||||
PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0);
|
||||
gFatalErrorMemory =
|
||||
(char*)mmap(nullptr, FatalErrorMemorySize, PROT_READ | PROT_WRITE,
|
||||
MAP_ANON | MAP_SHARED, -1, 0);
|
||||
MOZ_RELEASE_ASSERT(gFatalErrorMemory != MAP_FAILED);
|
||||
}
|
||||
}
|
||||
@ -386,9 +387,8 @@ static void InitializeForkListener() {
|
||||
static void SendMessageToForkedProcess(Message::UniquePtr aMsg) {
|
||||
for (ForkedProcess& process : gForkedProcesses) {
|
||||
if (process.mForkId == aMsg->mForkId) {
|
||||
bool remove =
|
||||
aMsg->mType == MessageType::Terminate ||
|
||||
aMsg->mType == MessageType::Crash;
|
||||
bool remove = aMsg->mType == MessageType::Terminate ||
|
||||
aMsg->mType == MessageType::Crash;
|
||||
process.mChannel->SendMessage(std::move(*aMsg));
|
||||
if (remove) {
|
||||
gForkedProcesses.erase(&process);
|
||||
@ -467,15 +467,16 @@ static void SendFatalErrorMessage(size_t aForkId, const char* aMessage) {
|
||||
char msgBuf[4096];
|
||||
size_t header = sizeof(FatalErrorMessage);
|
||||
size_t len = std::min(strlen(aMessage) + 1, sizeof(msgBuf) - header);
|
||||
FatalErrorMessage* msg = new (msgBuf) FatalErrorMessage(header + len, aForkId);
|
||||
FatalErrorMessage* msg =
|
||||
new (msgBuf) FatalErrorMessage(header + len, aForkId);
|
||||
memcpy(&msgBuf[header], aMessage, len);
|
||||
msgBuf[sizeof(msgBuf) - 1] = 0;
|
||||
|
||||
// Don't take the message lock when sending this, to avoid touching the heap.
|
||||
gChannel->SendMessage(std::move(*msg));
|
||||
|
||||
Print("***** Fatal Record/Replay Error #%lu:%lu *****\n%s\n", GetId(), aForkId,
|
||||
aMessage);
|
||||
Print("***** Fatal Record/Replay Error #%lu:%lu *****\n%s\n", GetId(),
|
||||
aForkId, aMessage);
|
||||
}
|
||||
|
||||
void ReportCrash(const MinidumpInfo& aInfo, void* aFaultingAddress) {
|
||||
@ -537,7 +538,7 @@ MOZ_EXPORT void RecordReplayInterface_ReportCrash(const char* aMessage) {
|
||||
SendFatalErrorMessage(gForkId, aMessage);
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
} // extern "C"
|
||||
|
||||
void ReportUnhandledDivergence() {
|
||||
gChannel->SendMessage(UnhandledDivergenceMessage(gForkId));
|
||||
@ -840,8 +841,8 @@ void ManifestFinished(const js::CharBuffer& aBuffer) {
|
||||
});
|
||||
}
|
||||
|
||||
void SendExternalCallRequest(ExternalCallId aId,
|
||||
const char* aInputData, size_t aInputSize,
|
||||
void SendExternalCallRequest(ExternalCallId aId, const char* aInputData,
|
||||
size_t aInputSize,
|
||||
InfallibleVector<char>* aOutputData) {
|
||||
AutoPassThroughThreadEvents pt;
|
||||
MonitorAutoLock lock(*gMonitor);
|
||||
@ -851,8 +852,8 @@ void SendExternalCallRequest(ExternalCallId aId,
|
||||
}
|
||||
gWaitingForCallResponse = true;
|
||||
|
||||
UniquePtr<ExternalCallRequestMessage> msg(ExternalCallRequestMessage::New(
|
||||
gForkId, aId, aInputData, aInputSize));
|
||||
UniquePtr<ExternalCallRequestMessage> msg(
|
||||
ExternalCallRequestMessage::New(gForkId, aId, aInputData, aInputSize));
|
||||
gChannel->SendMessage(std::move(*msg));
|
||||
|
||||
while (!gCallResponseMessage) {
|
||||
@ -868,10 +869,10 @@ void SendExternalCallRequest(ExternalCallId aId,
|
||||
gMonitor->Notify();
|
||||
}
|
||||
|
||||
void SendExternalCallOutput(ExternalCallId aId,
|
||||
const char* aOutputData, size_t aOutputSize) {
|
||||
Message::UniquePtr msg(ExternalCallResponseMessage::New(
|
||||
gForkId, aId, aOutputData, aOutputSize));
|
||||
void SendExternalCallOutput(ExternalCallId aId, const char* aOutputData,
|
||||
size_t aOutputSize) {
|
||||
Message::UniquePtr msg(
|
||||
ExternalCallResponseMessage::New(gForkId, aId, aOutputData, aOutputSize));
|
||||
gChannel->SendMessage(std::move(*msg));
|
||||
}
|
||||
|
||||
|
@ -62,14 +62,14 @@ bool DebuggerRunsInMiddleman();
|
||||
void ManifestFinished(const js::CharBuffer& aResponse);
|
||||
|
||||
// Send messages operating on external calls.
|
||||
void SendExternalCallRequest(ExternalCallId aId,
|
||||
const char* aInputData, size_t aInputSize,
|
||||
void SendExternalCallRequest(ExternalCallId aId, const char* aInputData,
|
||||
size_t aInputSize,
|
||||
InfallibleVector<char>* aOutputData);
|
||||
|
||||
// Send the output from an external call to the root replaying process,
|
||||
// to fill in its external call cache.
|
||||
void SendExternalCallOutput(ExternalCallId aId,
|
||||
const char* aOutputData, size_t aOutputSize);
|
||||
void SendExternalCallOutput(ExternalCallId aId, const char* aOutputData,
|
||||
size_t aOutputSize);
|
||||
|
||||
// Return whether a repaint is in progress and is not allowed to trigger an
|
||||
// unhandled recording divergence per preferences.
|
||||
|
@ -27,11 +27,11 @@ ChildProcessInfo::ChildProcessInfo(
|
||||
: mRecording(aRecordingProcessData.isSome()) {
|
||||
MOZ_RELEASE_ASSERT(NS_IsMainThread());
|
||||
|
||||
Channel::Kind kind =
|
||||
IsRecording() ? Channel::Kind::MiddlemanRecord : Channel::Kind::MiddlemanReplay;
|
||||
Channel::Kind kind = IsRecording() ? Channel::Kind::MiddlemanRecord
|
||||
: Channel::Kind::MiddlemanReplay;
|
||||
mChannel = new Channel(aId, kind, [=](Message::UniquePtr aMsg) {
|
||||
ReceiveChildMessageOnMainThread(aId, std::move(aMsg));
|
||||
});
|
||||
ReceiveChildMessageOnMainThread(aId, std::move(aMsg));
|
||||
});
|
||||
|
||||
LaunchSubprocess(aId, aRecordingProcessData);
|
||||
}
|
||||
@ -297,7 +297,7 @@ void ChildProcessInfo::MaybeProcessPendingMessageRunnable() {
|
||||
// Execute a task that processes a message received from the child. This is
|
||||
// called on a channel thread, and the function executes asynchronously on
|
||||
// the main thread.
|
||||
/* static */ void ChildProcessInfo::ReceiveChildMessageOnMainThread(
|
||||
/* static */ void ChildProcessInfo::ReceiveChildMessageOnMainThread(
|
||||
size_t aChildId, Message::UniquePtr aMsg) {
|
||||
MOZ_RELEASE_ASSERT(!NS_IsMainThread());
|
||||
|
||||
|
@ -265,8 +265,8 @@ static bool Middleman_SendManifest(JSContext* aCx, unsigned aArgc, Value* aVp) {
|
||||
}
|
||||
|
||||
size_t forkId;
|
||||
parent::ChildProcessInfo* child = ToChildProcess(aCx, args.get(0),
|
||||
args.get(1), &forkId);
|
||||
parent::ChildProcessInfo* child =
|
||||
ToChildProcess(aCx, args.get(0), args.get(1), &forkId);
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
@ -284,8 +284,8 @@ static bool Middleman_Ping(JSContext* aCx, unsigned aArgc, Value* aVp) {
|
||||
CallArgs args = CallArgsFromVp(aArgc, aVp);
|
||||
|
||||
size_t forkId;
|
||||
parent::ChildProcessInfo* child = ToChildProcess(aCx, args.get(0),
|
||||
args.get(1), &forkId);
|
||||
parent::ChildProcessInfo* child =
|
||||
ToChildProcess(aCx, args.get(0), args.get(1), &forkId);
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
@ -428,8 +428,8 @@ static bool Middleman_Terminate(JSContext* aCx, unsigned aArgc, Value* aVp) {
|
||||
CallArgs args = CallArgsFromVp(aArgc, aVp);
|
||||
|
||||
size_t forkId;
|
||||
parent::ChildProcessInfo* child = ToChildProcess(aCx, args.get(0),
|
||||
args.get(1), &forkId);
|
||||
parent::ChildProcessInfo* child =
|
||||
ToChildProcess(aCx, args.get(0), args.get(1), &forkId);
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
@ -445,8 +445,8 @@ static bool Middleman_CrashHangedChild(JSContext* aCx, unsigned aArgc,
|
||||
CallArgs args = CallArgsFromVp(aArgc, aVp);
|
||||
|
||||
size_t forkId;
|
||||
parent::ChildProcessInfo* child = ToChildProcess(aCx, args.get(0),
|
||||
args.get(1), &forkId);
|
||||
parent::ChildProcessInfo* child =
|
||||
ToChildProcess(aCx, args.get(0), args.get(1), &forkId);
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
@ -472,8 +472,8 @@ static bool Middleman_UpdateRecording(JSContext* aCx, unsigned aArgc,
|
||||
CallArgs args = CallArgsFromVp(aArgc, aVp);
|
||||
|
||||
size_t forkId;
|
||||
parent::ChildProcessInfo* child = ToChildProcess(aCx, args.get(0),
|
||||
args.get(1), &forkId);
|
||||
parent::ChildProcessInfo* child =
|
||||
ToChildProcess(aCx, args.get(0), args.get(1), &forkId);
|
||||
if (!child) {
|
||||
return false;
|
||||
}
|
||||
@ -1087,8 +1087,7 @@ struct ScriptHitInfo {
|
||||
}
|
||||
};
|
||||
|
||||
typedef HashMap<ScriptHitKey, ScriptHitVector*, ScriptHitKey>
|
||||
ScriptHitMap;
|
||||
typedef HashMap<ScriptHitKey, ScriptHitVector*, ScriptHitKey> ScriptHitMap;
|
||||
|
||||
struct AnyScriptHit {
|
||||
uint32_t mScript;
|
||||
@ -1120,7 +1119,7 @@ struct ScriptHitInfo {
|
||||
}
|
||||
|
||||
ScriptHitVector* FindHits(uint32_t aCheckpoint, uint32_t aScript,
|
||||
uint32_t aOffset) {
|
||||
uint32_t aOffset) {
|
||||
CheckpointInfo* info = GetInfo(aCheckpoint);
|
||||
|
||||
ScriptHitKey key(aScript, aOffset);
|
||||
@ -1349,8 +1348,8 @@ static bool RecordReplay_FindScriptHits(JSContext* aCx, unsigned aArgc,
|
||||
for (const auto& hit : *hits) {
|
||||
RootedObject hitObject(aCx, JS_NewObject(aCx, nullptr));
|
||||
if (!hitObject ||
|
||||
!JS_DefineProperty(aCx, hitObject, "progress",
|
||||
(double)hit.mProgress, JSPROP_ENUMERATE) ||
|
||||
!JS_DefineProperty(aCx, hitObject, "progress", (double)hit.mProgress,
|
||||
JSPROP_ENUMERATE) ||
|
||||
!JS_DefineProperty(aCx, hitObject, "frameIndex", hit.mFrameIndex,
|
||||
JSPROP_ENUMERATE) ||
|
||||
!values.append(ObjectValue(*hitObject))) {
|
||||
|
@ -198,7 +198,8 @@ class SendMessageToCloudRunnable : public Runnable {
|
||||
|
||||
SendMessageToCloudRunnable(int32_t aConnectionId, Message::UniquePtr aMsg)
|
||||
: Runnable("SendMessageToCloudRunnable"),
|
||||
mConnectionId(aConnectionId), mMsg(std::move(aMsg)) {}
|
||||
mConnectionId(aConnectionId),
|
||||
mMsg(std::move(aMsg)) {}
|
||||
|
||||
NS_IMETHODIMP Run() {
|
||||
AutoSafeJSContext cx;
|
||||
@ -256,7 +257,7 @@ static bool ConnectionCallback(JSContext* aCx, unsigned aArgc, JS::Value* aVp) {
|
||||
|
||||
if (ptr) {
|
||||
Channel* channel = gConnectionChannels[id];
|
||||
channel->SendMessageData((const char*) ptr, length);
|
||||
channel->SendMessageData((const char*)ptr, length);
|
||||
sentData = true;
|
||||
}
|
||||
}
|
||||
@ -274,16 +275,16 @@ void CreateReplayingCloudProcess(base::ProcessId aProcessId,
|
||||
MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
if (!gConnection) {
|
||||
nsCOMPtr<rrIConnection> connection =
|
||||
do_ImportModule("resource://devtools/server/actors/replay/connection.js");
|
||||
nsCOMPtr<rrIConnection> connection = do_ImportModule(
|
||||
"resource://devtools/server/actors/replay/connection.js");
|
||||
gConnection = connection.forget();
|
||||
ClearOnShutdown(&gConnection);
|
||||
|
||||
AutoSafeJSContext cx;
|
||||
JSAutoRealm ar(cx, xpc::PrivilegedJunkScope());
|
||||
|
||||
JSFunction* fun = JS_NewFunction(cx, ConnectionCallback, 2, 0,
|
||||
"ConnectionCallback");
|
||||
JSFunction* fun =
|
||||
JS_NewFunction(cx, ConnectionCallback, 2, 0, "ConnectionCallback");
|
||||
MOZ_RELEASE_ASSERT(fun);
|
||||
JS::RootedValue callback(cx, JS::ObjectValue(*(JSObject*)fun));
|
||||
if (NS_FAILED(gConnection->Initialize(callback))) {
|
||||
@ -307,9 +308,10 @@ void CreateReplayingCloudProcess(base::ProcessId aProcessId,
|
||||
aChannelId, Channel::Kind::ParentCloud,
|
||||
[=](Message::UniquePtr aMsg) {
|
||||
RefPtr<SendMessageToCloudRunnable> runnable =
|
||||
new SendMessageToCloudRunnable(connectionId, std::move(aMsg));
|
||||
new SendMessageToCloudRunnable(connectionId, std::move(aMsg));
|
||||
NS_DispatchToMainThread(runnable);
|
||||
}, aProcessId);
|
||||
},
|
||||
aProcessId);
|
||||
while ((size_t)connectionId >= gConnectionChannels.length()) {
|
||||
gConnectionChannels.append(nullptr);
|
||||
}
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#ifdef MOZ_WAYLAND
|
||||
#include "nsAppRunner.h" // for IsWaylandDisabled
|
||||
#include "mozilla/widget/mozwayland.h"
|
||||
# include "nsAppRunner.h" // for IsWaylandDisabled
|
||||
# include "mozilla/widget/mozwayland.h"
|
||||
#endif
|
||||
|
||||
// stuff from glx.h
|
||||
@ -552,7 +552,8 @@ bool fire_glxtest_process() {
|
||||
write_end_of_the_pipe = pfd[1];
|
||||
close_logging();
|
||||
// TODO: --display command line argument is not properly handled
|
||||
// NOTE: prefers X for now because eglQueryRendererIntegerMESA does not exist yet
|
||||
// NOTE: prefers X for now because eglQueryRendererIntegerMESA does not
|
||||
// exist yet
|
||||
#ifdef MOZ_WAYLAND
|
||||
if (IsWaylandDisabled() || getenv("DISPLAY") || !wayland_egltest())
|
||||
#endif
|
||||
|
@ -948,8 +948,7 @@ void nsLookAndFeel::ConfigureContentGtkTheme() {
|
||||
mozilla::Preferences::GetCString("widget.content.gtk-theme-override",
|
||||
themeOverride);
|
||||
if (!themeOverride.IsEmpty()) {
|
||||
g_object_set(settings, "gtk-theme-name", themeOverride.get(),
|
||||
nullptr);
|
||||
g_object_set(settings, "gtk-theme-name", themeOverride.get(), nullptr);
|
||||
LOG(("ConfigureContentGtkTheme(%s)\n", themeOverride.get()));
|
||||
} else {
|
||||
LOG(("ConfigureContentGtkTheme(%s)\n", GetGtkTheme().get()));
|
||||
|
@ -221,8 +221,7 @@ nsresult nsWindowBase::ClearNativeTouchSequence(nsIObserver* aObserver) {
|
||||
// cancel all input points
|
||||
for (auto iter = mActivePointers.Iter(); !iter.Done(); iter.Next()) {
|
||||
auto info = iter.UserData();
|
||||
InjectTouchPoint(info->mPointerId, info->mPosition,
|
||||
POINTER_FLAG_CANCELED);
|
||||
InjectTouchPoint(info->mPointerId, info->mPosition, POINTER_FLAG_CANCELED);
|
||||
iter.Remove();
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,7 @@ CycleCollectedJSContext::~CycleCollectedJSContext() {
|
||||
return;
|
||||
}
|
||||
|
||||
JS::SetHostCleanupFinalizationGroupCallback(
|
||||
mJSContext, nullptr, nullptr);
|
||||
JS::SetHostCleanupFinalizationGroupCallback(mJSContext, nullptr, nullptr);
|
||||
mFinalizationGroupsToCleanUp.reset();
|
||||
|
||||
JS_SetContextPrivate(mJSContext, nullptr);
|
||||
@ -745,7 +744,8 @@ nsresult CycleCollectedJSContext::NotifyUnhandledRejections::Cancel() {
|
||||
class CleanupFinalizationGroupsRunnable : public CancelableRunnable {
|
||||
public:
|
||||
explicit CleanupFinalizationGroupsRunnable(CycleCollectedJSContext* aContext)
|
||||
: CancelableRunnable("CleanupFinalizationGroupsRunnable"), mContext(aContext) {}
|
||||
: CancelableRunnable("CleanupFinalizationGroupsRunnable"),
|
||||
mContext(aContext) {}
|
||||
NS_DECL_NSIRUNNABLE
|
||||
private:
|
||||
CycleCollectedJSContext* mContext;
|
||||
|
@ -85,9 +85,7 @@ class MicroTaskRunnable {
|
||||
virtual ~MicroTaskRunnable() = default;
|
||||
};
|
||||
|
||||
class CycleCollectedJSContext
|
||||
: dom::PerThreadAtomCache,
|
||||
private JS::JobQueue {
|
||||
class CycleCollectedJSContext : dom::PerThreadAtomCache, private JS::JobQueue {
|
||||
friend class CycleCollectedJSRuntime;
|
||||
|
||||
protected:
|
||||
|
@ -640,8 +640,8 @@ void LogModule::Printv(LogLevel aLevel, const char* aFmt, va_list aArgs) const {
|
||||
sLogModuleManager->Print(Name(), aLevel, aFmt, aArgs);
|
||||
}
|
||||
|
||||
void LogModule::Printv(LogLevel aLevel, const TimeStamp* aStart, const char* aFmt,
|
||||
va_list aArgs) const {
|
||||
void LogModule::Printv(LogLevel aLevel, const TimeStamp* aStart,
|
||||
const char* aFmt, va_list aArgs) const {
|
||||
MOZ_ASSERT(sLogModuleManager != nullptr);
|
||||
|
||||
// Forward to LogModule manager w/ level and name
|
||||
|
Loading…
x
Reference in New Issue
Block a user