Bug 1619165 - Reformat recent changes to the Google coding style r=andi

First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
This commit is contained in:
Sylvestre Ledru 2020-04-25 09:40:08 +00:00
Родитель 0eb02fa8dd
Коммит 34acbb653a
55 изменённых файлов: 165 добавлений и 174 удалений

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

@ -40,7 +40,9 @@ DEF(data)
DEF(relocation)
DEF(sections)
DEF(are)
// clang-format off
DEF(not)
// clang-format on
DEF(sufficiently)
DEF(large)
DEF(and)

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

@ -248,7 +248,8 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
void PrepareForProcessChange();
// Triggers a load in the process which currently owns this BrowsingContext.
nsresult LoadURI(nsDocShellLoadState* aLoadState, bool aSetNavigating = false);
nsresult LoadURI(nsDocShellLoadState* aLoadState,
bool aSetNavigating = false);
nsresult InternalLoad(nsDocShellLoadState* aLoadState,
nsIDocShell** aDocShell, nsIRequest** aRequest);

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

@ -28,10 +28,9 @@ inline void Element::UnregisterActivityObserver() {
inline mozilla::dom::Element* nsINode::GetFlattenedTreeParentElement() const {
nsINode* parentNode = GetFlattenedTreeParentNode();
if
MOZ_LIKELY(parentNode && parentNode->IsElement()) {
return parentNode->AsElement();
}
if MOZ_LIKELY (parentNode && parentNode->IsElement()) {
return parentNode->AsElement();
}
return nullptr;
}

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

@ -170,40 +170,39 @@ inline const char* NS_CP_ContentTypeName(uint32_t contentType) {
*
* Note: requestOrigin is scoped outside the PR_BEGIN_MACRO/PR_END_MACRO on
* purpose */
#define CHECK_PRINCIPAL_CSP_AND_DATA(action) \
PR_BEGIN_MACRO \
if (loadingPrincipal && loadingPrincipal->IsSystemPrincipal()) { \
/* We exempt most loads into any document with the system principal \
* from content policy (except CSP) checks, mostly as an optimization. \
* Which means that we need to apply this check to the loading principal, \
* not the principal that triggered the load. */ \
/* Check CSP for System Privileged pages */ \
CSPService::ConsultCSP(contentLocation, loadInfo, mimeType, decision); \
if (NS_CP_REJECTED(*decision)) { \
return NS_OK; \
} \
if (contentType != nsIContentPolicy::TYPE_DOCUMENT) { \
*decision = nsIContentPolicy::ACCEPT; \
nsCOMPtr<nsINode> n = do_QueryInterface(context); \
if (!n) { \
nsCOMPtr<nsPIDOMWindowOuter> win = do_QueryInterface(context); \
n = win ? win->GetExtantDoc() : nullptr; \
} \
if (n) { \
mozilla::dom::Document* d = n->OwnerDoc(); \
if (d->IsLoadedAsData() || d->IsBeingUsedAsImage() || \
d->IsResourceDoc()) { \
nsCOMPtr<nsIContentPolicy> dataPolicy = \
do_GetService("@mozilla.org/data-document-content-policy;1"); \
if (dataPolicy) { \
dataPolicy->action(contentLocation, loadInfo, mimeType, \
decision); \
} \
} \
} \
} \
return NS_OK; \
} \
#define CHECK_PRINCIPAL_CSP_AND_DATA(action) \
PR_BEGIN_MACRO \
if (loadingPrincipal && loadingPrincipal->IsSystemPrincipal()) { \
/* We exempt most loads into any document with the system principal \
* from content policy (except CSP) checks, mostly as an optimization. \
* Which means that we need to apply this check to the loading principal, \
* not the principal that triggered the load. */ \
/* Check CSP for System Privileged pages */ \
CSPService::ConsultCSP(contentLocation, loadInfo, mimeType, decision); \
if (NS_CP_REJECTED(*decision)) { \
return NS_OK; \
} \
if (contentType != nsIContentPolicy::TYPE_DOCUMENT) { \
*decision = nsIContentPolicy::ACCEPT; \
nsCOMPtr<nsINode> n = do_QueryInterface(context); \
if (!n) { \
nsCOMPtr<nsPIDOMWindowOuter> win = do_QueryInterface(context); \
n = win ? win->GetExtantDoc() : nullptr; \
} \
if (n) { \
mozilla::dom::Document* d = n->OwnerDoc(); \
if (d->IsLoadedAsData() || d->IsBeingUsedAsImage() || \
d->IsResourceDoc()) { \
nsCOMPtr<nsIContentPolicy> dataPolicy = \
do_GetService("@mozilla.org/data-document-content-policy;1"); \
if (dataPolicy) { \
dataPolicy->action(contentLocation, loadInfo, mimeType, decision); \
} \
} \
} \
} \
return NS_OK; \
} \
PR_END_MACRO
/**

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

@ -2151,11 +2151,11 @@ void nsJSContext::MaybePokeCC() {
nsCycleCollector_dispatchDeferredDeletion();
ActivateCCRunner();
sCCRunner = IdleTaskRunner::Create(
CCRunnerFired, "MaybePokeCC::CCRunnerFired",
kCCSkippableDelay.ToMilliseconds(),
kForgetSkippableSliceDuration.ToMilliseconds(), true,
[] { return sShuttingDown; });
sCCRunner =
IdleTaskRunner::Create(CCRunnerFired, "MaybePokeCC::CCRunnerFired",
kCCSkippableDelay.ToMilliseconds(),
kForgetSkippableSliceDuration.ToMilliseconds(),
true, [] { return sShuttingDown; });
}
}

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

@ -283,7 +283,8 @@ void ImageDocument::ShrinkToFit() {
if (imageHeight > mVisibleHeight) {
classList->Add(NS_LITERAL_STRING("overflowingVertical"), IgnoreErrors());
} else {
classList->Remove(NS_LITERAL_STRING("overflowingVertical"), IgnoreErrors());
classList->Remove(NS_LITERAL_STRING("overflowingVertical"),
IgnoreErrors());
}
return;
}

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

@ -31,8 +31,7 @@ class ImageDocument final : public MediaDocument,
nsresult Init() override;
nsresult StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
nsILoadGroup* aLoadGroup,
nsISupports* aContainer,
nsILoadGroup* aLoadGroup, nsISupports* aContainer,
nsIStreamListener** aDocListener,
bool aReset = true,
nsIContentSink* aSink = nullptr) override;

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

@ -12659,7 +12659,7 @@ void ConnectionPool::ScheduleQueuedTransactions(ThreadInfo aThreadInfo) {
const auto foundIt = std::find_if(
mQueuedTransactions.begin(), mQueuedTransactions.end(),
[& me = *this](const auto& queuedTransaction) {
[&me = *this](const auto& queuedTransaction) {
return !me.ScheduleTransaction(queuedTransaction,
/* aFromQueuedTransactions */ true);
});
@ -12785,7 +12785,7 @@ void ConnectionPool::NoteClosedDatabase(DatabaseInfo* aDatabaseInfo) {
// finished.
mCompleteCallbacks.RemoveElementsAt(
std::remove_if(mCompleteCallbacks.begin(), mCompleteCallbacks.end(),
[& me = *this](const auto& completeCallback) {
[&me = *this](const auto& completeCallback) {
return me.MaybeFireCallback(completeCallback.get());
}),
mCompleteCallbacks.end());
@ -25840,7 +25840,7 @@ ObjectStoreGetRequestOp::GetPreprocessParams() {
std::make_move_iterator(mResponse.end()),
MakeBackInserter(preprocessInfos),
[](const auto& info) { return info.HasPreprocessInfo(); },
[& self = *this](StructuredCloneReadInfoParent&& info) {
[&self = *this](StructuredCloneReadInfoParent&& info) {
return self.ConvertResponse<PreprocessInfo>(std::move(info));
});

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

@ -298,10 +298,10 @@ class MOZ_IS_REFPTR MOZ_TRIVIAL_ABI SafeRefPtr {
};
template <typename T>
SafeRefPtr(RefPtr<T> &&)->SafeRefPtr<T>;
SafeRefPtr(RefPtr<T> &&) -> SafeRefPtr<T>;
template <typename T>
SafeRefPtr(already_AddRefed<T> &&)->SafeRefPtr<T>;
SafeRefPtr(already_AddRefed<T> &&) -> SafeRefPtr<T>;
template <typename T>
SafeRefPtr<T>::SafeRefPtr(T* aRawPtr, detail::InitialConstructionTag)

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

@ -312,7 +312,6 @@ bool AudioBuffer::RestoreJSChannelData(JSContext* aJSContext) {
void AudioBuffer::CopyFromChannel(const Float32Array& aDestination,
uint32_t aChannelNumber,
uint32_t aStartInChannel, ErrorResult& aRv) {
if (aChannelNumber >= NumberOfChannels()) {
aRv.ThrowIndexSizeError(
nsPrintfCString("Channel number (%u) is out of range", aChannelNumber));
@ -363,7 +362,6 @@ void AudioBuffer::CopyToChannel(JSContext* aJSContext,
const Float32Array& aSource,
uint32_t aChannelNumber,
uint32_t aStartInChannel, ErrorResult& aRv) {
if (aChannelNumber >= NumberOfChannels()) {
aRv.ThrowIndexSizeError(
nsPrintfCString("Channel number (%u) is out of range", aChannelNumber));

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

@ -87,7 +87,7 @@ void MediaElementAudioSourceNode::ListenForAllowedToPlay(
// static analysis. We capture a non-owning reference so as to allow
// cycle collection of the node. The reference is cleared via
// DisconnectIfExists() from Destroy() when the node is collected.
[& self = *this]() {
[&self = *this]() {
self.Context()->StartBlockedAudioContextIfAllowed();
self.mAllowedToPlayRequest.Complete();
})

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

@ -6304,7 +6304,7 @@ nsresult QuotaManager::EnsureStorageIsInitialized() {
const auto autoRecord = mInitializationInfo.RecordFirstInitializationAttempt(
Initialization::Storage,
[& self = *this] { return static_cast<bool>(self.mStorageConnection); });
[&self = *this] { return static_cast<bool>(self.mStorageConnection); });
auto storageFileOrErr = QM_NewLocalFile(mBasePath);
if (NS_WARN_IF(storageFileOrErr.isErr())) {
@ -7006,7 +7006,7 @@ nsresult QuotaManager::EnsureTemporaryStorageIsInitialized() {
const auto autoRecord = mInitializationInfo.RecordFirstInitializationAttempt(
Initialization::TemporaryStorage,
[& self = *this] { return self.mTemporaryStorageInitialized; });
[&self = *this] { return self.mTemporaryStorageInitialized; });
nsresult rv;

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

@ -339,7 +339,7 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI,
aOriginalURI, // Original nsIURI
true, // aSendViolationReports
cspNonce, // nonce
parserCreatedScript, &decision);
parserCreatedScript, &decision);
// if the preload policy already denied the load, then there
// is no point in checking the real policy
@ -361,7 +361,7 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI,
aOriginalURI, // Original nsIURI
true, // aSendViolationReports
cspNonce, // nonce
parserCreatedScript, &decision);
parserCreatedScript, &decision);
if (NS_CP_REJECTED(decision)) {
aCancelCode = Some(NS_ERROR_DOM_BAD_URI);
return NS_BINDING_FAILED;

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

@ -159,7 +159,7 @@ SVGElement* SVGTransformableElement::GetFarthestViewportElement() {
}
static already_AddRefed<SVGRect> ZeroBBox(SVGTransformableElement& aOwner) {
return MakeAndAddRef<SVGRect>(&aOwner, Rect {0, 0, 0, 0});
return MakeAndAddRef<SVGRect>(&aOwner, Rect{0, 0, 0, 0});
}
already_AddRefed<SVGRect> SVGTransformableElement::GetBBox(

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

@ -42,8 +42,8 @@ class XRInputSourceArray final : public nsISupports, public nsWrapperCache {
virtual ~XRInputSourceArray() = default;
private:
void DispatchInputSourceRemovedEvent(const nsTArray<RefPtr<XRInputSource>>& aInputs,
XRSession* aSession);
void DispatchInputSourceRemovedEvent(
const nsTArray<RefPtr<XRInputSource>>& aInputs, XRSession* aSession);
nsCOMPtr<nsISupports> mParent;
nsTArray<RefPtr<XRInputSource>> mInputSources;

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

@ -16,17 +16,17 @@ XRNativeOriginTracker::XRNativeOriginTracker(const gfx::VRPose* aPose)
gfx::PointDouble3D XRNativeOriginTracker::GetPosition() {
MOZ_ASSERT(mPose);
return gfx::PointDouble3D(mPose->position[0],
mPose->position[1],
return gfx::PointDouble3D(mPose->position[0], mPose->position[1],
mPose->position[2]);
}
gfx::QuaternionDouble XRNativeOriginTracker::GetOrientation() {
MOZ_ASSERT(mPose);
gfx::QuaternionDouble orientation(mPose->orientation[0],
mPose->orientation[1], mPose->orientation[2], mPose->orientation[3]);
// Quaternion was inverted for WebVR in XXXVRSession when handling controller poses.
// We need to re-invert it here again.
gfx::QuaternionDouble orientation(
mPose->orientation[0], mPose->orientation[1], mPose->orientation[2],
mPose->orientation[3]);
// Quaternion was inverted for WebVR in XXXVRSession when handling controller
// poses. We need to re-invert it here again.
// TODO: Remove those extra inverts when WebVR support is disabled.
orientation.Invert();
return orientation;

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

@ -31,8 +31,7 @@ static const uint8_t kPolyDegree = kDegree + 1;
// Maximum size of position history.
static const uint8_t kHistorySize = 20;
AndroidVelocityTracker::AndroidVelocityTracker()
: mLastEventTime(0) {}
AndroidVelocityTracker::AndroidVelocityTracker() : mLastEventTime(0) {}
void AndroidVelocityTracker::StartTracking(ParentLayerCoord aPos,
uint32_t aTimestampMs) {
@ -275,9 +274,7 @@ Maybe<float> AndroidVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) {
return Nothing{};
}
void AndroidVelocityTracker::Clear() {
mHistory.Clear();
}
void AndroidVelocityTracker::Clear() { mHistory.Clear(); }
} // namespace layers
} // namespace mozilla

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

@ -1045,7 +1045,6 @@ bool AsyncCompositionManager::ApplyAsyncContentTransformToTree(
Compositor* compositor = mLayerManager->GetCompositor();
if (CompositorBridgeParent* bridge =
compositor->GetCompositorBridgeParent()) {
LayersId rootLayerTreeId = bridge->RootLayerTreeId();
if (mIsFirstPaint || FrameMetricsHaveUpdated(metrics)) {
if (RefPtr<UiCompositorControllerParent> uiController =

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

@ -18,7 +18,7 @@
//#include "gfxSharedImageSurface.h" // for gfxSharedImageSurface
#include "ipc/IPCMessageUtils.h" // for gfxContentType, null_t
#include "IPDLActor.h"
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/CompositableClient.h" // for CompositableClient, etc
#include "mozilla/layers/CompositorBridgeChild.h"

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

@ -552,8 +552,8 @@ void WebRenderBridgeChild::SetWebRenderLayerManager(
mManager = aManager;
MOZ_ASSERT(NS_IsMainThread() || !XRE_IsContentProcess());
mActiveResourceTracker = MakeUnique<ActiveResourceTracker>(
1000, "CompositableForwarder", nullptr);
mActiveResourceTracker =
MakeUnique<ActiveResourceTracker>(1000, "CompositableForwarder", nullptr);
}
ipc::IShmemAllocator* WebRenderBridgeChild::GetShmemAllocator() {

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

@ -834,7 +834,7 @@ bool WebRenderBridgeParent::AddSharedExternalImage(
mSharedSurfaceIds.insert(std::make_pair(key, aExtId));
wr::ImageDescriptor descriptor(dSurf->GetSize(), dSurf->Stride(),
dSurf->GetFormat());
dSurf->GetFormat());
aResources.AddExternalImage(aKey, descriptor, aExtId,
wr::ExternalImageType::Buffer(), 0);
return true;
@ -859,10 +859,10 @@ bool WebRenderBridgeParent::PushExternalImageForTexture(
WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost();
if (wrTexture) {
wrTexture->PushResourceUpdates(aResources, op, keys,
wrTexture->GetExternalImageKey());
wrTexture->GetExternalImageKey());
auto it = mTextureHosts.find(wr::AsUint64(aKey));
MOZ_ASSERT((it == mTextureHosts.end() && !aIsUpdate) ||
(it != mTextureHosts.end() && aIsUpdate));
(it != mTextureHosts.end() && aIsUpdate));
if (it != mTextureHosts.end()) {
// Release Texture if it exists.
ReleaseTextureOfImage(aKey);
@ -945,7 +945,7 @@ bool WebRenderBridgeParent::UpdateSharedExternalImage(
}
wr::ImageDescriptor descriptor(dSurf->GetSize(), dSurf->Stride(),
dSurf->GetFormat());
dSurf->GetFormat());
aResources.UpdateExternalImageWithDirtyRect(
aKey, descriptor, aExtId, wr::ExternalImageType::Buffer(),
wr::ToDeviceIntRect(aDirtyRect), 0);

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

@ -5,17 +5,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gfxCrashReporterUtils.h"
#include <string.h> // for strcmp
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include <string.h> // for strcmp
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/SchedulerGroup.h" // for SchedulerGroup
#include "mozilla/Services.h" // for GetObserverService
#include "mozilla/Services.h" // for GetObserverService
#include "mozilla/StaticMutex.h"
#include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/RefPtr.h" // for RefPtr
#include "MainThreadUtils.h" // for NS_IsMainThread
#include "nsCOMPtr.h" // for nsCOMPtr
#include "nsError.h" // for NS_OK, NS_FAILED, nsresult
#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport
#include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/RefPtr.h" // for RefPtr
#include "MainThreadUtils.h" // for NS_IsMainThread
#include "nsCOMPtr.h" // for nsCOMPtr
#include "nsError.h" // for NS_OK, NS_FAILED, nsresult
#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport
#include "nsID.h"
#include "nsIObserver.h" // for nsIObserver, etc
#include "nsIObserverService.h" // for nsIObserverService

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

@ -415,7 +415,7 @@ CGFontRef MacOSFontEntry::CreateOrCopyFontRef() {
ref = CTFontCopyGraphicsFont((CTFontRef)font, nullptr);
}
}
return ref; // Not saved in mFontRef; caller will own the reference
return ref; // Not saved in mFontRef; caller will own the reference
}
// For a logging build, we wrap the CFDataRef in a FontTableRec so that we can

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

@ -2894,9 +2894,9 @@ static FeatureState& WebRenderHardwareQualificationStatus(
bool hasBattery = false;
gfxInfo->GetHasBattery(&hasBattery);
if (hasBattery && !gfxConfig::IsEnabled(Feature::WEBRENDER_COMPOSITOR)) {
featureWebRenderQualified.Disable(FeatureStatus::Blocked,
"Battery Intel requires os compositor",
NS_LITERAL_CSTRING("INTEL_BATTERY_REQUIRES_DCOMP"));
featureWebRenderQualified.Disable(
FeatureStatus::Blocked, "Battery Intel requires os compositor",
NS_LITERAL_CSTRING("INTEL_BATTERY_REQUIRES_DCOMP"));
}
}
#endif
@ -3033,7 +3033,8 @@ void gfxPlatform::InitWebRenderConfig() {
}
if (StaticPrefs::gfx_webrender_use_optimized_shaders_AtStartup()) {
gfxVars::SetUseWebRenderOptimizedShaders(gfxConfig::IsEnabled(Feature::WEBRENDER));
gfxVars::SetUseWebRenderOptimizedShaders(
gfxConfig::IsEnabled(Feature::WEBRENDER));
}
if (Preferences::GetBool("gfx.webrender.software", false)) {

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

@ -263,9 +263,9 @@ class gfxPlatformFontList : public gfxFontInfoLoader {
// because (on Windows) we cannot include the proper headers, as they
// result in build failure due to (indirect) inclusion of windows.h
// in generated bindings code.
void ShareFontListShmBlockToProcess(
uint32_t aGeneration, uint32_t aIndex, base::ProcessId aPid,
base::SharedMemoryHandle* aOut);
void ShareFontListShmBlockToProcess(uint32_t aGeneration, uint32_t aIndex,
base::ProcessId aPid,
base::SharedMemoryHandle* aOut);
void SetCharacterMap(uint32_t aGeneration,
const mozilla::fontlist::Pointer& aFacePtr,

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

@ -28,7 +28,7 @@ enum class GamepadMappingType : uint8_t;
enum class GamepadHand : uint8_t;
} // namespace dom
namespace gfx {
enum class VRAPIMode : uint8_t {WebXR, WebVR, NumVRAPIModes};
enum class VRAPIMode : uint8_t { WebXR, WebVR, NumVRAPIModes };
class VRLayerParent;
class VRDisplayHost;

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

@ -167,25 +167,25 @@ void VRSession::UpdateTrigger(VRControllerState& aState, uint32_t aButtonIndex,
}
}
void VRSession::SetControllerSelectionAndSqueezeFrameId(VRControllerState& controllerState,
uint64_t aFrameId) {
void VRSession::SetControllerSelectionAndSqueezeFrameId(
VRControllerState& controllerState, uint64_t aFrameId) {
// The 1st button, trigger, is its selection action.
const bool selectionPressed = controllerState.buttonPressed & 1ULL;
if (selectionPressed && controllerState.selectActionStopFrameId
>= controllerState.selectActionStartFrameId) {
controllerState.selectActionStartFrameId = aFrameId;
} else if (!selectionPressed && controllerState.selectActionStartFrameId
> controllerState.selectActionStopFrameId) {
controllerState.selectActionStopFrameId = aFrameId;
if (selectionPressed && controllerState.selectActionStopFrameId >=
controllerState.selectActionStartFrameId) {
controllerState.selectActionStartFrameId = aFrameId;
} else if (!selectionPressed && controllerState.selectActionStartFrameId >
controllerState.selectActionStopFrameId) {
controllerState.selectActionStopFrameId = aFrameId;
}
// The 2nd button, squeeze, is its squeeze action.
const bool squeezePressed = controllerState.buttonPressed & (1ULL << 1);
if (squeezePressed && controllerState.squeezeActionStopFrameId
>= controllerState.squeezeActionStartFrameId) {
controllerState.squeezeActionStartFrameId = aFrameId;
} else if (!squeezePressed && controllerState.squeezeActionStartFrameId
> controllerState.squeezeActionStopFrameId) {
controllerState.squeezeActionStopFrameId = aFrameId;
if (squeezePressed && controllerState.squeezeActionStopFrameId >=
controllerState.squeezeActionStartFrameId) {
controllerState.squeezeActionStartFrameId = aFrameId;
} else if (!squeezePressed && controllerState.squeezeActionStartFrameId >
controllerState.squeezeActionStopFrameId) {
controllerState.squeezeActionStopFrameId = aFrameId;
}
}

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

@ -84,7 +84,8 @@ class VRSession {
virtual bool SubmitFrame(const mozilla::gfx::VRLayer_Stereo_Immersive& aLayer,
const VRLayerTextureHandle& aTexture) = 0;
#endif
void SetControllerSelectionAndSqueezeFrameId(VRControllerState& controllerState, uint64_t aFrameId);
void SetControllerSelectionAndSqueezeFrameId(
VRControllerState& controllerState, uint64_t aFrameId);
};
} // namespace gfx

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

@ -343,7 +343,7 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
const mozilla::wr::DeviceIntRect* aVisibleRect,
const mozilla::wr::LayoutIntRect* aRenderRect,
const uint16_t aTileSize,
const mozilla::wr::TileOffset *aTileOffset,
const mozilla::wr::TileOffset* aTileOffset,
const mozilla::wr::LayoutIntRect* aDirtyRect,
Range<uint8_t> aOutput) {
IntSize size(aRenderRect->size.width, aRenderRect->size.height);

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

@ -365,8 +365,7 @@ class imgLoader final : public imgILoader,
// aURI may be different from imgRequest's URI in the case of blob URIs, as we
// can share requests with different URIs.
nsresult CreateNewProxyForRequest(imgRequest* aRequest,
nsIURI* aURI,
nsresult CreateNewProxyForRequest(imgRequest* aRequest, nsIURI* aURI,
nsILoadGroup* aLoadGroup,
mozilla::dom::Document* aLoadingDocument,
imgINotificationObserver* aObserver,

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

@ -23,7 +23,7 @@
#include "js/PropertySpec.h"
#include "vm/Interpreter.h"
#include "vm/JSContext.h"
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
#include "vm/SelfHosting.h"

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

@ -27,7 +27,7 @@
#include "unicode/utypes.h"
#include "vm/JSContext.h"
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/Runtime.h" // js::ReportAllocationOverflow
#include "vm/Runtime.h" // js::ReportAllocationOverflow
#include "vm/SelfHosting.h"
#include "vm/StringType.h"

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

@ -29,7 +29,7 @@
#include "js/PropertySpec.h"
#include "vm/Interpreter.h"
#include "vm/JSContext.h"
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
#include "vm/SelfHosting.h"

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

@ -40,7 +40,7 @@
#include "vm/JSContext-inl.h" // JSContext::check
#include "vm/List-inl.h" // js::ListObject, js::AppendToListInFixedSlot, js::StoreNewListInFixedSlot
#include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate
#include "vm/Realm-inl.h" // JS::Realm
#include "vm/Realm-inl.h" // JS::Realm
using JS::BooleanValue;
using JS::CallArgs;

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

@ -37,8 +37,8 @@
#include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/EnvironmentObject-inl.h" // for JSObject::enclosingEnvironment
#include "vm/JSObject-inl.h" // for IsInternalFunctionObject, NewObjectWithGivenProtoAndKind
#include "vm/ObjectOperations-inl.h" // for HasProperty, GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
#include "vm/ObjectOperations-inl.h" // for HasProperty, GetProperty
#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm
namespace js {
class GlobalObject;

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

@ -67,8 +67,8 @@
#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
#include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/JSAtom-inl.h" // for ValueToId
#include "vm/JSObject-inl.h" // for GetObjectClassName, InitClass, NewObjectWithGivenProtoAndKind
#include "vm/NativeObject-inl.h" // for NativeObject::global
#include "vm/ObjectOperations-inl.h" // for DeleteProperty, GetProperty

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

@ -4001,7 +4001,8 @@ JS_FRIEND_API bool JS::UnmarkGrayGCThingRecursively(JS::GCCellPtr thing) {
JSRuntime* rt = thing.asCell()->runtimeFromMainThread();
gcstats::AutoPhase outerPhase(rt->gc.stats(), gcstats::PhaseKind::BARRIER);
gcstats::AutoPhase innerPhase(rt->gc.stats(), gcstats::PhaseKind::UNMARK_GRAY);
gcstats::AutoPhase innerPhase(rt->gc.stats(),
gcstats::PhaseKind::UNMARK_GRAY);
return UnmarkGrayGCThingUnchecked(rt, thing);
}

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

@ -1913,7 +1913,7 @@ class ReservedRooted : public RootedBase<T, ReservedRooted<T>> {
void set(const T& p) const { *savedRoot = p; }
operator Handle<T>() { return *savedRoot; }
operator Rooted<T> &() { return *savedRoot; }
operator Rooted<T>&() { return *savedRoot; }
MutableHandle<T> operator&() { return &*savedRoot; }
DECLARE_NONPOINTER_ACCESSOR_METHODS(savedRoot->get())

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

@ -409,8 +409,9 @@ JSObject* NewObjectWithGivenTaggedProto(JSContext* cx, const JSClass* clasp,
uint32_t initialShapeFlags = 0);
template <NewObjectKind NewKind>
inline JSObject* NewObjectWithGivenTaggedProto(
JSContext* cx, const JSClass* clasp, Handle<TaggedProto> proto) {
inline JSObject* NewObjectWithGivenTaggedProto(JSContext* cx,
const JSClass* clasp,
Handle<TaggedProto> proto) {
gc::AllocKind allocKind = gc::GetGCObjectKind(clasp);
return NewObjectWithGivenTaggedProto(cx, clasp, proto, allocKind, NewKind, 0);
}
@ -420,8 +421,7 @@ namespace detail {
template <typename T, NewObjectKind NewKind>
inline T* NewObjectWithGivenTaggedProtoForKind(JSContext* cx,
Handle<TaggedProto> proto) {
JSObject* obj =
NewObjectWithGivenTaggedProto<NewKind>(cx, &T::class_, proto);
JSObject* obj = NewObjectWithGivenTaggedProto<NewKind>(cx, &T::class_, proto);
return obj ? &obj->as<T>() : nullptr;
}
@ -430,7 +430,6 @@ inline T* NewObjectWithGivenTaggedProtoForKind(JSContext* cx,
template <typename T>
inline T* NewObjectWithGivenTaggedProto(JSContext* cx,
Handle<TaggedProto> proto) {
return detail::NewObjectWithGivenTaggedProtoForKind<T, GenericObject>(cx,
proto);
}

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

@ -18,7 +18,7 @@
#include "vm/JSFunction.h" // JSFunction
#include "vm/NativeObject.h" // js::NativeObject::create
#include "vm/ObjectGroup.h" // js::ObjectGroup, js::GenericObject, js::NewObjectKind
#include "vm/Shape.h" // js::Shape
#include "vm/Shape.h" // js::Shape
#include "gc/ObjectKind-inl.h" // js::gc::GetGCObjectKind
#include "vm/JSObject-inl.h" // js::GetInitialHeap, js::NewBuiltinClassInstance

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

@ -710,9 +710,9 @@ class BaseShape : public gc::TenuredCell {
private:
using HeaderWithJSClass = gc::CellHeaderWithNonGCPointer<const JSClass>;
HeaderWithJSClass headerAndClasp_; /* Class of referring object. */
uint32_t flags; /* Vector of above flags. */
uint32_t slotSpan_; /* Object slot span for BaseShapes at
* dictionary last properties. */
uint32_t flags; /* Vector of above flags. */
uint32_t slotSpan_; /* Object slot span for BaseShapes at
* dictionary last properties. */
/* For owned BaseShapes, the canonical unowned BaseShape. */
GCPtrUnownedBaseShape unowned_;

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

@ -559,7 +559,7 @@ class JSString : public js::gc::Cell {
*
* Returns mozilla::Nothing on OOM.
*/
mozilla::Maybe<mozilla::Tuple<size_t, size_t> > encodeUTF8Partial(
mozilla::Maybe<mozilla::Tuple<size_t, size_t>> encodeUTF8Partial(
const JS::AutoRequireNoGC& nogc, mozilla::Span<char> buffer) const;
private:

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

@ -1302,8 +1302,7 @@ bool nsLayoutUtils::SetDisplayPortMargins(nsIContent* aContent,
// nothing if aContent does not have a frame. So getting the displayport is
// useless if the content has no frame, so we avoid calling this to avoid
// triggering a warning about not having a frame.
hadDisplayPort =
GetHighResolutionDisplayPort(aContent, &oldDisplayPort);
hadDisplayPort = GetHighResolutionDisplayPort(aContent, &oldDisplayPort);
}
aContent->SetProperty(

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

@ -526,7 +526,6 @@ class nsPresContext : public nsISupports,
void SetFullZoom(float aZoom);
public:
float GetFullZoom() { return mFullZoom; }
/**
* Device full zoom differs from full zoom because it gets the zoom from

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

@ -1343,9 +1343,9 @@ nscoord ScrollFrameHelper::GetNondisappearingScrollbarWidth(
StyleAppearance::ScrollbarNonDisappearing)) {
LayoutDeviceIntSize size;
bool canOverride = true;
theme->GetMinimumWidgetSize(
aState->PresContext(), box,
StyleAppearance::ScrollbarNonDisappearing, &size, &canOverride);
theme->GetMinimumWidgetSize(aState->PresContext(), box,
StyleAppearance::ScrollbarNonDisappearing,
&size, &canOverride);
return aState->PresContext()->DevPixelsToAppUnits(
verticalWM ? size.height : size.width);
}

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

@ -537,7 +537,6 @@ void nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState,
}
prefSize = XULBoundsCheck(minSize, prefSize, maxSize);
bool sizeChanged = (mPrefSize != prefSize);
// if the size changed then set the bounds to be the preferred size
if (sizeChanged) {

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

@ -52,7 +52,7 @@ MOZALLOC_EXPORT_NEW void operator delete(void* ptr) noexcept(true) {
}
MOZALLOC_EXPORT_NEW void operator delete(void* ptr,
const std::nothrow_t&)noexcept(true) {
const std::nothrow_t&) noexcept(true) {
return free_impl(ptr);
}

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

@ -28,7 +28,7 @@ class OriginAttributes;
namespace dom {
class BrowsingContext;
class ContentParent;
}
} // namespace dom
class ContentBlocking final {
public:

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

@ -745,7 +745,8 @@ nsresult nsWebBrowserFind::OnFind(nsPIDOMWindowOuter* aFoundWindow) {
if (nsFocusManager* fm = nsFocusManager::GetFocusManager()) {
// get the containing frame and focus it. For top-level windows, the right
// window should already be focused.
if (RefPtr<Element> frameElement = aFoundWindow->GetFrameElementInternal()) {
if (RefPtr<Element> frameElement =
aFoundWindow->GetFrameElementInternal()) {
fm->SetFocus(frameElement, 0);
}

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

@ -201,10 +201,10 @@ nsresult PageIconProtocolHandler::NewChannelInternal(nsIURI* aURI,
// We override the channel's loadinfo below anyway, so using a null
// principal here is alright.
nsCOMPtr<nsIPrincipal> loadingPrincipal =
NullPrincipal::CreateWithoutOriginAttributes();
NullPrincipal::CreateWithoutOriginAttributes();
rv = NS_NewInputStreamChannel(
getter_AddRefs(channel), aURI, pipeIn.forget(),
loadingPrincipal, nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
getter_AddRefs(channel), aURI, pipeIn.forget(), loadingPrincipal,
nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
nsIContentPolicy::TYPE_INTERNAL_IMAGE);
NS_ENSURE_SUCCESS(rv, rv);
}

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

@ -341,6 +341,5 @@ void TelemetryIPCAccumulator::DeInitializeGlobalState() {
void TelemetryIPCAccumulator::DispatchToMainThread(
already_AddRefed<nsIRunnable>&& aEvent) {
SchedulerGroup::Dispatch(TaskCategory::Other,
std::move(aEvent));
SchedulerGroup::Dispatch(TaskCategory::Other, std::move(aEvent));
}

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

@ -28,7 +28,7 @@
// Workaround for mingw32
#ifndef TS_SD_INPUTPANEMANUALDISPLAYENABLE
#define TS_SD_INPUTPANEMANUALDISPLAYENABLE 0x40
# define TS_SD_INPUTPANEMANUALDISPLAYENABLE 0x40
#endif
namespace mozilla {

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

@ -942,21 +942,21 @@ void CycleCollectedJSRuntime::TraverseNativeRoots(
// would hurt to do this after the JS holders.
TraverseAdditionalNativeRoots(aCb);
mJSHolders.ForEach([&aCb](void* holder, nsScriptObjectTracer* tracer,
JS::Zone* zone) {
bool noteRoot = false;
if (MOZ_UNLIKELY(aCb.WantAllTraces())) {
noteRoot = true;
} else {
tracer->Trace(holder,
TraceCallbackFunc(CheckParticipatesInCycleCollection),
&noteRoot);
}
mJSHolders.ForEach(
[&aCb](void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) {
bool noteRoot = false;
if (MOZ_UNLIKELY(aCb.WantAllTraces())) {
noteRoot = true;
} else {
tracer->Trace(holder,
TraceCallbackFunc(CheckParticipatesInCycleCollection),
&noteRoot);
}
if (noteRoot) {
aCb.NoteNativeRoot(holder, tracer);
}
});
if (noteRoot) {
aCb.NoteNativeRoot(holder, tracer);
}
});
}
/* static */
@ -1286,7 +1286,7 @@ static inline bool ShouldCheckSingleZoneHolders() {
return rand() % 256 == 0;
#else
return false;
# endif
#endif
}
void CycleCollectedJSRuntime::TraceNativeGrayRoots(
@ -1298,13 +1298,13 @@ void CycleCollectedJSRuntime::TraceNativeGrayRoots(
bool checkSingleZoneHolders = ShouldCheckSingleZoneHolders();
mJSHolders.ForEach(
[aTracer, checkSingleZoneHolders](
void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) {
void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) {
#ifdef CHECK_SINGLE_ZONE_JS_HOLDERS
if (checkSingleZoneHolders && !tracer->IsMultiZoneJSHolder()) {
CheckHolderIsSingleZone(holder, tracer, zone);
}
#else
Unused << checkSingleZoneHolders;
Unused << checkSingleZoneHolders;
#endif
tracer->Trace(holder, JsGcTracer(), aTracer);
},

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

@ -206,7 +206,7 @@ class MOZ_RAII BaseAutoLock {
};
template <typename MutexType>
BaseAutoLock(MutexType&)->BaseAutoLock<MutexType&>;
BaseAutoLock(MutexType&) -> BaseAutoLock<MutexType&>;
} // namespace detail
typedef detail::BaseAutoLock<Mutex&> MutexAutoLock;
@ -250,7 +250,7 @@ class MOZ_RAII BaseAutoUnlock {
};
template <typename MutexType>
BaseAutoUnlock(MutexType&)->BaseAutoUnlock<MutexType&>;
BaseAutoUnlock(MutexType&) -> BaseAutoUnlock<MutexType&>;
} // namespace detail
typedef detail::BaseAutoUnlock<Mutex&> MutexAutoUnlock;

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

@ -82,7 +82,6 @@ class SchedulerGroup {
static nsresult Dispatch(TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable);
static nsresult UnlabeledDispatch(TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable);
@ -98,7 +97,6 @@ class SchedulerGroup {
static nsresult InternalUnlabeledDispatch(
TaskCategory aCategory, already_AddRefed<Runnable>&& aRunnable);
static nsresult LabeledDispatch(TaskCategory aCategory,
already_AddRefed<nsIRunnable>&& aRunnable,
dom::DocGroup* aDocGroup);