Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D67574

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sylvestre Ledru 2020-04-05 13:34:58 +00:00
parent 06abb94ae1
commit 0aa6f03cf3
64 changed files with 257 additions and 271 deletions

View File

@ -1303,7 +1303,7 @@ static const nsRoleMapEntry sLandmarkRoleMap = {
nsRoleMapEntry aria::gEmptyRoleMap = {
nsGkAtoms::_empty, roles::TEXT_CONTAINER, kUseMapRole, eNoValue,
eNoAction, eNoLiveAttr, kGenericAccType, kNoReqStates};
eNoAction, eNoLiveAttr, kGenericAccType, kNoReqStates};
/**
* Universal (Global) states:

View File

@ -376,9 +376,9 @@ SHistoryChild::CreateEntry(nsISHEntry** aEntry) {
nsresult SHistoryChild::LoadURI(nsTArray<LoadSHEntryData>& aLoadData) {
for (LoadSHEntryData& l : aLoadData) {
if (l.browsingContext().IsNullOrDiscarded()) {
continue;
}
if (l.browsingContext().IsNullOrDiscarded()) {
continue;
}
nsCOMPtr<nsIDocShell> docShell = l.browsingContext().get()->GetDocShell();
if (!docShell) {

View File

@ -18,7 +18,7 @@
#include "mozilla/AnimationTarget.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/DeclarationBlock.h"
#include "mozilla/Maybe.h" // For Maybe
#include "mozilla/Maybe.h" // For Maybe
#include "mozilla/StaticPrefs_dom.h"
#include "nsAnimationManager.h" // For CSSAnimation
#include "nsComputedDOMStyle.h"

View File

@ -117,9 +117,7 @@ class nsNodeInfoManager final {
void Free(void* aPtr) { free(aPtr); }
bool HasAllocated() {
return mHasAllocated;
}
bool HasAllocated() { return mHasAllocated; }
void AddSizeOfIncludingThis(nsWindowSizes& aSizes) const;

View File

@ -26,7 +26,8 @@ delimiters inside of a comment, hence comments cannot be nested.
*/
std::string CommentsToSpaces(const std::string& src) {
constexpr auto flags = std::regex::ECMAScript | std::regex::nosubs | std::regex::optimize;
constexpr auto flags =
std::regex::ECMAScript | std::regex::nosubs | std::regex::optimize;
static const auto RE_COMMENT_BEGIN = std::regex("/[*/]", flags);
static const auto RE_LINE_COMMENT_END = std::regex(R"([^\\]\n)", flags);
@ -36,7 +37,8 @@ std::string CommentsToSpaces(const std::string& src) {
ret.reserve(src.size());
// Replace all comments with block comments with the right number of newlines.
// Line positions may be off, but line numbers will be accurate, which is more important.
// Line positions may be off, but line numbers will be accurate, which is more
// important.
auto itr = src.begin();
const auto end = src.end();

View File

@ -138,8 +138,8 @@ bool NumberInputType::HasBadInput() const {
return !value.IsEmpty() && mInputElement->GetValueAsDecimal().isNaN();
}
bool NumberInputType::ConvertNumberToString(
Decimal aValue, nsAString& aResultString) const {
bool NumberInputType::ConvertNumberToString(Decimal aValue,
nsAString& aResultString) const {
MOZ_ASSERT(aValue.isFinite(), "aValue must be a valid non-Infinite number.");
aResultString.Truncate();

View File

@ -1189,7 +1189,8 @@ nsresult ContentChild::ProvideWindowCommon(
return rv;
}
SendCreateWindow(aTabOpener, newChild, aChromeFlags, aCalledFromJS, aWidthSpecified, aURI, features, fullZoom,
SendCreateWindow(aTabOpener, newChild, aChromeFlags, aCalledFromJS,
aWidthSpecified, aURI, features, fullZoom,
Principal(triggeringPrincipal), csp, referrerInfo,
std::move(resolve), std::move(reject));
}

View File

@ -530,10 +530,9 @@ class ContentParent final
mozilla::ipc::IPCResult RecvCreateWindowInDifferentProcess(
PBrowserParent* aThisTab, const uint32_t& aChromeFlags,
const bool& aCalledFromJS, const bool& aWidthSpecified,
nsIURI* aURIToLoad, const nsCString& aFeatures,
const float& aFullZoom, const nsString& aName,
nsIPrincipal* aTriggeringPrincipal, nsIContentSecurityPolicy* aCsp,
nsIReferrerInfo* aReferrerInfo);
nsIURI* aURIToLoad, const nsCString& aFeatures, const float& aFullZoom,
const nsString& aName, nsIPrincipal* aTriggeringPrincipal,
nsIContentSecurityPolicy* aCsp, nsIReferrerInfo* aReferrerInfo);
static void BroadcastBlobURLRegistration(
const nsACString& aURI, BlobImpl* aBlobImpl, nsIPrincipal* aPrincipal,

View File

@ -4373,20 +4373,24 @@ void SourceListener::SetEnabledFor(MediaTrack* aTrack, bool aEnable) {
state.mDevice->GetRawGroupId(inputDeviceGroupId);
return MediaManager::PostTask<DeviceOperationPromise>(
__func__, [self, device = state.mDevice, aEnable, inputDeviceGroupId](
MozPromiseHolder<DeviceOperationPromise>& h) {
__func__,
[self, device = state.mDevice, aEnable, inputDeviceGroupId](
MozPromiseHolder<DeviceOperationPromise>& h) {
// Only take this branch when muting, to avoid muting, in case
// the default audio output device has changed and we need to
// really call `Start` on the source. The AudioInput source
// start/stop are idempotent, so this works.
if (device->mKind == dom::MediaDeviceKind::Audioinput && !aEnable) {
// Don't turn off the microphone of a device that is on the same
// physical device as the output.
CubebDeviceEnumerator* enumerator = CubebDeviceEnumerator::GetInstance();
if (device->mKind == dom::MediaDeviceKind::Audioinput &&
!aEnable) {
// Don't turn off the microphone of a device that is on the
// same physical device as the output.
CubebDeviceEnumerator* enumerator =
CubebDeviceEnumerator::GetInstance();
// Get the current graph's device info. This is always the
// default audio output device for now.
RefPtr<AudioDeviceInfo> outputDevice =
enumerator->DefaultDevice(CubebDeviceEnumerator::Side::OUTPUT);
enumerator->DefaultDevice(
CubebDeviceEnumerator::Side::OUTPUT);
if (outputDevice->GroupID().Equals(inputDeviceGroupId)) {
LOG("Device group id match when %s, "
"not turning the input device off (%s)",

View File

@ -122,8 +122,7 @@ nsresult SVGAnimatedTransformList::SetAnimValue(const SVGTransformList& aValue,
} else {
modType = MutationEvent_Binding::ADDITION;
}
mCreatedOrRemovedOnLastChange =
modType == MutationEvent_Binding::ADDITION;
mCreatedOrRemovedOnLastChange = modType == MutationEvent_Binding::ADDITION;
aElement->DidAnimateTransformList(modType);
return NS_OK;
}
@ -146,8 +145,7 @@ void SVGAnimatedTransformList::ClearAnimValue(SVGElement* aElement) {
} else {
modType = MutationEvent_Binding::REMOVAL;
}
mCreatedOrRemovedOnLastChange =
modType == MutationEvent_Binding::REMOVAL;
mCreatedOrRemovedOnLastChange = modType == MutationEvent_Binding::REMOVAL;
aElement->DidAnimateTransformList(modType);
}

View File

@ -310,8 +310,8 @@ class ConicGradientPattern : public Pattern {
PatternType GetType() const override { return PatternType::CONIC_GRADIENT; }
Point mCenter; //!< Center of the gradient
Float mAngle; //!< Start angle of gradient
Point mCenter; //!< Center of the gradient
Float mAngle; //!< Start angle of gradient
Float mStartOffset; // Offset of first stop
Float mEndOffset; // Offset of last stop
RefPtr<GradientStops>

View File

@ -193,7 +193,8 @@ void DrawTargetD2D1::DrawSurface(SourceSurface* aSurface, const Rect& aDest,
const Rect& aSource,
const DrawSurfaceOptions& aSurfOptions,
const DrawOptions& aOptions) {
if (!PrepareForDrawing(aOptions.mCompositionOp, ColorPattern(DeviceColor()))) {
if (!PrepareForDrawing(aOptions.mCompositionOp,
ColorPattern(DeviceColor()))) {
return;
}
@ -267,7 +268,8 @@ void DrawTargetD2D1::DrawFilter(FilterNode* aNode, const Rect& aSourceRect,
return;
}
if (!PrepareForDrawing(aOptions.mCompositionOp, ColorPattern(DeviceColor()))) {
if (!PrepareForDrawing(aOptions.mCompositionOp,
ColorPattern(DeviceColor()))) {
return;
}

View File

@ -12,8 +12,8 @@
//#define GFX_TILEDLAYER_PREF_WARNINGS
//#define GFX_TILEDLAYER_RETAINING_LOG
#include <stdint.h> // for uint16_t, uint32_t
#include <sys/types.h> // for int32_t
#include <stdint.h> // for uint16_t, uint32_t
#include <sys/types.h> // for int32_t
#include <type_traits>
#include "LayersLogging.h" // for print_stderr
#include "mozilla/gfx/gfxVars.h"

View File

@ -127,7 +127,8 @@ class EffectSolidColorTrivialBench : public BenchTest {
float tmp;
float red = modff(i * 0.03f, &tmp);
EffectChain effects;
return MakeAndAddRef<EffectSolidColor>(gfx::DeviceColor(red, 0.4f, 0.4f, 1.0f));
return MakeAndAddRef<EffectSolidColor>(
gfx::DeviceColor(red, 0.4f, 0.4f, 1.0f));
}
};
@ -149,7 +150,8 @@ class EffectSolidColorStressBench : public BenchTest {
float tmp;
float red = modff(i * 0.03f, &tmp);
EffectChain effects;
return MakeAndAddRef<EffectSolidColor>(gfx::DeviceColor(red, 0.4f, 0.4f, 1.0f));
return MakeAndAddRef<EffectSolidColor>(
gfx::DeviceColor(red, 0.4f, 0.4f, 1.0f));
}
};

View File

@ -18,7 +18,7 @@
#include "mozilla/Unused.h"
#include "Units.h"
#ifdef MOZ_WIDGET_ANDROID
#include "mozilla/jni/Utils.h"
# include "mozilla/jni/Utils.h"
#endif
static mozilla::LazyLogModule sApzRemoteLog("apz.cc.remote");

View File

@ -159,7 +159,8 @@ mozilla::ipc::IPCResult UiCompositorControllerParent::RecvDefaultClearColor(
Compositor* compositor = state->mLayerManager->GetCompositor();
if (compositor) {
// Android Color is ARGB which is apparently unusual.
compositor->SetDefaultClearColor(gfx::DeviceColor::UnusualFromARGB(aColor));
compositor->SetDefaultClearColor(
gfx::DeviceColor::UnusualFromARGB(aColor));
}
}

View File

@ -257,8 +257,7 @@ IpcResourceUpdateQueue::IpcResourceUpdateQueue(
IpcResourceUpdateQueue&& aOther) noexcept
: mWriter(std::move(aOther.mWriter)),
mUpdates(std::move(aOther.mUpdates)),
mRenderRoot(aOther.mRenderRoot) {
}
mRenderRoot(aOther.mRenderRoot) {}
IpcResourceUpdateQueue& IpcResourceUpdateQueue::operator=(
IpcResourceUpdateQueue&& aOther) noexcept {

View File

@ -101,9 +101,7 @@ class IpcResourceUpdateQueue {
return *this;
}
bool HasAnySubQueue() {
return false;
}
bool HasAnySubQueue() { return false; }
bool HasSubQueue(wr::RenderRoot aRenderRoot) {
return aRenderRoot == wr::RenderRoot::Default;

View File

@ -1811,7 +1811,7 @@ void gfxFontUtils::GetVariationData(
if (axisCount ==
0 || // no axes?
// https://www.microsoft.com/typography/otspec/fvar.htm#axisSize
axisSize != 20 || // required value for current table version
axisSize != 20 || // required value for current table version
// https://www.microsoft.com/typography/otspec/fvar.htm#instanceSize
(instanceSize != axisCount * sizeof(int32_t) + 4 &&
instanceSize != axisCount * sizeof(int32_t) + 6)) {

View File

@ -25,7 +25,7 @@ class gfxPattern final {
// gradients
gfxPattern(gfxFloat x0, gfxFloat y0, gfxFloat x1, gfxFloat y1); // linear
gfxPattern(gfxFloat cx0, gfxFloat cy0, gfxFloat radius0, gfxFloat cx1,
gfxFloat cy1, gfxFloat radius1); // radial
gfxFloat cy1, gfxFloat radius1); // radial
gfxPattern(gfxFloat cx, gfxFloat cy, gfxFloat angle, gfxFloat startOffset,
gfxFloat endOffset); // conic
gfxPattern(mozilla::gfx::SourceSurface* aSurface,

View File

@ -1217,18 +1217,18 @@ static bool IsFeatureSupported(long aFeature, bool aDefault) {
return status == nsIGfxInfo::FEATURE_STATUS_OK;
}
static void ApplyGfxInfoFeature(long aFeature, FeatureState &aFeatureState) {
static void ApplyGfxInfoFeature(long aFeature, FeatureState& aFeatureState) {
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString blockId;
int32_t status;
if (!NS_SUCCEEDED(gfxInfo->GetFeatureStatus(aFeature, blockId, &status))) {
aFeatureState.Disable(FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_GFX_INFO"));
aFeatureState.Disable(FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_GFX_INFO"));
} else {
if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
aFeatureState.Disable(FeatureStatus::Blacklisted, "Blacklisted by gfxInfo",
blockId);
aFeatureState.Disable(FeatureStatus::Blacklisted,
"Blacklisted by gfxInfo", blockId);
}
}
}

View File

@ -890,7 +890,8 @@ gfxUtils::CopySurfaceToDataSourceSurfaceWithFormat(SourceSurface* aSurface,
const uint32_t gfxUtils::sNumFrameColors = 8;
/* static */
const gfx::DeviceColor& gfxUtils::GetColorForFrameNumber(uint64_t aFrameNumber) {
const gfx::DeviceColor& gfxUtils::GetColorForFrameNumber(
uint64_t aFrameNumber) {
static bool initialized = false;
static gfx::DeviceColor colors[sNumFrameColors];

View File

@ -236,8 +236,7 @@ class WebRenderAPI final {
wr::WindowId GetId() const { return mId; }
/// Do a non-blocking hit-testing query on a shared hit-testing information.
bool HitTest(const wr::WorldPoint& aPoint,
wr::WrPipelineId& aOutPipelineId,
bool HitTest(const wr::WorldPoint& aPoint, wr::WrPipelineId& aOutPipelineId,
layers::ScrollableLayerGuid::ViewID& aOutScrollId,
gfx::CompositorHitTestInfo& aOutHitInfo, SideBits& aOutSideBits);
@ -429,9 +428,7 @@ class DisplayListBuilder final {
RenderRoot aRenderRoot);
DisplayListBuilder& SubBuilder(RenderRoot aRenderRoot);
bool GetSendSubBuilderDisplayList(RenderRoot aRenderRoot) {
return true;
}
bool GetSendSubBuilderDisplayList(RenderRoot aRenderRoot) { return true; }
Maybe<wr::WrSpatialId> PushStackingContext(
const StackingContextParams& aParams, const wr::LayoutRect& aBounds,

View File

@ -90,10 +90,10 @@ void apz_run_updater(mozilla::wr::WrWindowId aWindowId);
void apz_deregister_updater(mozilla::wr::WrWindowId aWindowId);
void apz_register_sampler(mozilla::wr::WrWindowId aWindowId);
void apz_sample_transforms(mozilla::wr::WrWindowId aWindowId,
mozilla::wr::Transaction* aTransaction,
mozilla::wr::DocumentId aRenderRootId,
const mozilla::wr::WrPipelineIdEpochs* aPipelineEpochs);
void apz_sample_transforms(
mozilla::wr::WrWindowId aWindowId, mozilla::wr::Transaction* aTransaction,
mozilla::wr::DocumentId aRenderRootId,
const mozilla::wr::WrPipelineIdEpochs* aPipelineEpochs);
void apz_deregister_sampler(mozilla::wr::WrWindowId aWindowId);
} // extern "C"

View File

@ -141,7 +141,7 @@ class SharedMemory {
// only if the memory was unmapped, but this is an implementation
// detail and shouldn't be relied on; for that use case Freeze()
// should be used instead.)
MOZ_MUST_USE bool ReadOnlyCopy(SharedMemory *ro_out);
MOZ_MUST_USE bool ReadOnlyCopy(SharedMemory* ro_out);
// Closes the open shared memory segment.
// It is safe to call Close repeatedly.

View File

@ -272,7 +272,8 @@ bool SharedMemory::ReadOnlyCopy(SharedMemory* ro_out) {
int ro_file = -1;
#ifdef ANDROID
if (mozilla::android::ashmem_setProt(mapped_file_, PROT_READ) != 0) {
CHROMIUM_LOG(WARNING) << "failed to set ashmem read-only: " << strerror(errno);
CHROMIUM_LOG(WARNING) << "failed to set ashmem read-only: "
<< strerror(errno);
return false;
}
ro_file = mapped_file_;

View File

@ -127,7 +127,7 @@ ForkServerLauncher::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
if (strcmp(aTopic, NS_XPCOM_STARTUP_CATEGORY) == 0) {
nsCOMPtr<nsIObserverService> obsSvc =
mozilla::services::GetObserverService();
mozilla::services::GetObserverService();
MOZ_ASSERT(obsSvc != nullptr);
// preferences are not available until final-ui-startup
obsSvc->AddObserver(this, "final-ui-startup", false);

View File

@ -538,7 +538,8 @@ inline static MOZ_MUST_USE bool WriteBarrierPostImpl(ObjectT* obj,
return false;
}
keyValue.toGCThing()->storeBuffer()->putGeneric(OrderedHashTableRef<ObjectT>(obj));
keyValue.toGCThing()->storeBuffer()->putGeneric(
OrderedHashTableRef<ObjectT>(obj));
}
return keys->append(keyValue);

View File

@ -7,13 +7,13 @@
#ifndef builtin_Promise_inl_h
#define builtin_Promise_inl_h
#include "js/Promise.h" // JS::PromiseState
#include "js/Promise.h" // JS::PromiseState
#include "mozilla/Assertions.h" // MOZ_ASSERT
#include "js/RootingAPI.h" // JS::Handle
#include "vm/JSContext.h" // JSContext
#include "vm/PromiseObject.h" // js::PromiseObject
#include "js/RootingAPI.h" // JS::Handle
#include "vm/JSContext.h" // JSContext
#include "vm/PromiseObject.h" // js::PromiseObject
namespace js {

View File

@ -11,11 +11,11 @@
#include "mozilla/Attributes.h" // MOZ_MUST_USE
#include "jstypes.h" // JS_PUBLIC_API
#include "js/CallArgs.h" // JS::CallArgs
#include "js/RootingAPI.h" // JS::{,Mutable}Handle
#include "js/Value.h" // JS::Value
#include "vm/JSObject.h" // JSObject
#include "jstypes.h" // JS_PUBLIC_API
#include "js/CallArgs.h" // JS::CallArgs
#include "js/RootingAPI.h" // JS::{,Mutable}Handle
#include "js/Value.h" // JS::Value
#include "vm/JSObject.h" // JSObject
#include "vm/PromiseObject.h" // js::PromiseObject
struct JS_PUBLIC_API JSContext;

View File

@ -16,9 +16,9 @@
#include "jsfriendapi.h" // js::GetErrorMessage, JSMSG_*
#include "builtin/Promise.h" // js::RejectPromiseWithPendingError
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
#include "builtin/streams/ReadableStreamReader.h" // js::CreateReadableStreamDefaultReader, js::ForAuthorCodeBool, js::ReadableStreamDefaultReader
#include "builtin/streams/WritableStream.h" // js::WritableStream
#include "builtin/streams/WritableStream.h" // js::WritableStream
#include "builtin/streams/WritableStreamDefaultWriter.h" // js::CreateWritableStreamDefaultWriter, js::WritableStreamDefaultWriter
#include "builtin/streams/WritableStreamOperations.h" // js::WritableStreamCloseQueuedOrInFlight
#include "js/CallArgs.h" // JS::CallArgsFromVp, JS::CallArgs

View File

@ -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, js::PromiseResolvedWithUndefined
#include "vm/Runtime.h" // JSAtomState
#include "vm/SavedFrame.h" // js::SavedFrame
#include "vm/SavedFrame.h" // js::SavedFrame
#include "builtin/streams/HandlerFunction-inl.h" // js::NewHandler
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::PromiseCall

View File

@ -15,10 +15,10 @@
#include "builtin/streams/MiscellaneousOperations.h" // js::ReturnPromiseRejectedWithPendingError
#include "builtin/streams/ReadableStream.h" // js::ReadableStream
#include "builtin/streams/ReadableStreamReader.h" // js::ForAuthorCodeBool, js::ReadableStream{,Default}Reader
#include "js/CallArgs.h" // JS::CallArgs{,FromVp}
#include "js/Class.h" // JSClass, JS_NULL_CLASS_OPS
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "vm/PromiseObject.h" // js::PromiseObject
#include "js/CallArgs.h" // JS::CallArgs{,FromVp}
#include "js/Class.h" // JSClass, JS_NULL_CLASS_OPS
#include "js/RootingAPI.h" // JS::Handle, JS::Rooted
#include "vm/PromiseObject.h" // js::PromiseObject
#include "vm/Compartment-inl.h" // js::UnwrapAndTypeCheckThis
#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto

View File

@ -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, js::PlainObject
#include "vm/ObjectGroup.h" // js::GenericObject
#include "vm/JSContext.h" // JSContext
#include "vm/JSFunction.h" // JSFunction, js::NewNativeFunction
#include "vm/NativeObject.h" // js::NativeObject, js::PlainObject
#include "vm/ObjectGroup.h" // js::GenericObject
#include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined
#include "vm/Realm.h" // JS::Realm
#include "vm/StringType.h" // js::PropertyName
#include "vm/StringType.h" // js::PropertyName
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
#include "builtin/streams/MiscellaneousOperations-inl.h" // js::{Reject,Resolve}UnwrappedPromiseWithUndefined

View File

@ -18,13 +18,13 @@
#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, js::PromiseResolvedWithUndefined
#include "vm/Runtime.h" // JSRuntime
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapInternalSlot
#include "vm/List-inl.h" // js::StoreNewListInFixedSlot
#include "vm/Realm-inl.h" // js::AutoRealm

View File

@ -22,10 +22,10 @@
#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, js::PromiseResolvedWithUndefined
#include "vm/Runtime.h" // JSAtomState

View File

@ -22,13 +22,13 @@
#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, js::PromiseResolvedWithUndefined
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled
#include "vm/Compartment-inl.h" // JS::Compartment::wrap, js::UnwrapAndTypeCheck{Argument,This}
#include "vm/JSObject-inl.h" // js::NewObjectWithClassProto
#include "vm/NativeObject-inl.h" // js::ThrowIfNotConstructing

View File

@ -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, js::PromiseResolvedWithUndefined
#include "builtin/Promise-inl.h" // js::SetSettledPromiseIsHandled

View File

@ -31,9 +31,7 @@ static const JSClass* getGlobalClass() {
static JSObject* jsfuzz_createGlobal(JSContext* cx, JSPrincipals* principals) {
/* Create the global object. */
JS::RealmOptions options;
options.creationOptions()
.setStreamsEnabled(true)
.setWeakRefsEnabled(true);
options.creationOptions().setStreamsEnabled(true).setWeakRefsEnabled(true);
return JS_NewGlobalObject(cx, getGlobalClass(), principals,
JS::FireOnNewGlobalHook, options);
}

View File

@ -17,7 +17,7 @@
#include <type_traits> // std::true_type
#include "gc/Allocator.h" // js::AllowGC, js::CanGC, js::NoGC
#include "gc/Allocator.h" // js::AllowGC, js::CanGC, js::NoGC
#include "js/ComparisonOperators.h" // JS::detail::DefineComparisonOps
#include "js/RootingAPI.h" // js::{Rooted,MutableHandle}Base, JS::SafelyInitialized, DECLARE_POINTER_{CONSTREF,ASSIGN}_OPS, DECLARE_NONPOINTER_{,MUTABLE_}ACCESSOR_METHODS, JS::Rooted, JS::{,Mutable}Handle

View File

@ -12,9 +12,9 @@
#include <stdint.h> // int32_t, uint64_t
#include "js/Class.h" // JSClass
#include "js/Promise.h" // JS::PromiseState
#include "js/RootingAPI.h" // JS::{,Mutable}Handle
#include "js/Class.h" // JSClass
#include "js/Promise.h" // JS::PromiseState
#include "js/RootingAPI.h" // JS::{,Mutable}Handle
#include "js/Value.h" // JS::Value, JS::Int32Value, JS::UndefinedHandleValue
#include "vm/NativeObject.h" // js::NativeObject

View File

@ -321,11 +321,13 @@ static void SubtractFromExposedRegion(nsRegion* aExposedRegion,
}
}
static nsIFrame* GetClosest(
nsIFrame* aRoot, const nsPoint& aPointRelativeToRootFrame,
const nsRect& aTargetRect, const EventRadiusPrefs* aPrefs,
nsIFrame* aRestrictToDescendants, nsIContent* aClickableAncestor,
nsTArray<nsIFrame*>& aCandidates) {
static nsIFrame* GetClosest(nsIFrame* aRoot,
const nsPoint& aPointRelativeToRootFrame,
const nsRect& aTargetRect,
const EventRadiusPrefs* aPrefs,
nsIFrame* aRestrictToDescendants,
nsIContent* aClickableAncestor,
nsTArray<nsIFrame*>& aCandidates) {
nsIFrame* bestTarget = nullptr;
// Lower is better; distance is in appunits
float bestDistance = 1e6f;
@ -460,9 +462,9 @@ nsIFrame* FindFrameTargetedByInputEvent(
return target;
}
nsIFrame* closestClickable = GetClosest(
aRootFrame, aPointRelativeToRootFrame, targetRect, prefs,
restrictToDescendants, clickableAncestor, candidates);
nsIFrame* closestClickable =
GetClosest(aRootFrame, aPointRelativeToRootFrame, targetRect, prefs,
restrictToDescendants, clickableAncestor, candidates);
if (closestClickable) {
target = closestClickable;
}

View File

@ -3928,9 +3928,9 @@ nsresult nsCSSFrameConstructor::GetAnonymousContent(
cachedStyles[i]->EqualForCachedAnonymousContentStyle(*cs),
"cached anonymous content styles should be identical to those we "
"would compute normally");
#ifdef ANDROID
# ifdef ANDROID
MOZ_ASSERT(cs->StyleUI()->mPointerEvents == StylePointerEvents::None);
#endif
# endif
#endif
Servo_SetExplicitStyle(elements[i], cachedStyles[i]);
}

View File

@ -2910,9 +2910,7 @@ void nsDocumentViewer::EmulateMediumInternal(nsAtom* aMedia) {
auto childFn = [&](nsDocumentViewer* aChild) {
aChild->EmulateMediumInternal(aMedia);
};
auto presContextFn = [&](nsPresContext* aPc) {
aPc->EmulateMedium(aMedia);
};
auto presContextFn = [&](nsPresContext* aPc) { aPc->EmulateMedium(aMedia); };
PropagateToPresContextsHelper(childFn, presContextFn);
}

View File

@ -6985,10 +6985,10 @@ void nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// backplates behind text. When backplating we consider consecutive
// runs of text as a whole, which requires we iterate through all lines
// to find our backplate size.
nsLineBox* cursor = (hasDescendantPlaceHolders || textOverflow.isSome() ||
backplateColor)
? nullptr
: GetFirstLineContaining(aBuilder->GetDirtyRect().y);
nsLineBox* cursor =
(hasDescendantPlaceHolders || textOverflow.isSome() || backplateColor)
? nullptr
: GetFirstLineContaining(aBuilder->GetDirtyRect().y);
LineIterator line_end = LinesEnd();
TextOverflow* textOverflowPtr = textOverflow.ptrOr(nullptr);

View File

@ -408,8 +408,8 @@ static nscoord GetScrollbarWidthNoTheme(nsIFrame* aBox) {
}
}
bool nsIFrame::AddXULMinSize(nsIFrame* aBox,
nsSize& aSize, bool& aWidthSet, bool& aHeightSet) {
bool nsIFrame::AddXULMinSize(nsIFrame* aBox, nsSize& aSize, bool& aWidthSet,
bool& aHeightSet) {
aWidthSet = false;
aHeightSet = false;
@ -423,8 +423,8 @@ bool nsIFrame::AddXULMinSize(nsIFrame* aBox,
nsITheme* theme = pc->Theme();
if (theme->ThemeSupportsWidget(pc, aBox, display->mAppearance)) {
LayoutDeviceIntSize size;
theme->GetMinimumWidgetSize(pc, aBox,
display->mAppearance, &size, &canOverride);
theme->GetMinimumWidgetSize(pc, aBox, display->mAppearance, &size,
&canOverride);
if (size.width) {
aSize.width = pc->DevPixelsToAppUnits(size.width);
aWidthSet = true;

View File

@ -487,7 +487,8 @@ void nsTextBoxFrame::DrawText(gfxContext& aRenderingContext,
CalculateUnderline(refDrawTarget, *fontMet);
DeviceColor color = ToDeviceColor(aOverrideColor ? *aOverrideColor : StyleText()->mColor.ToColor());
DeviceColor color = ToDeviceColor(
aOverrideColor ? *aOverrideColor : StyleText()->mColor.ToColor());
ColorPattern colorPattern(color);
aRenderingContext.SetDeviceColor(color);

View File

@ -95,7 +95,7 @@ TEST(PHC, TestPHCAllocations)
ASSERT_EQ(moz_malloc_usable_size(p), (a2)); \
free(p); \
p = (uint8_t*)moz_xmemalign((a1), 8); \
ASSERT_EQ(moz_malloc_usable_size(p), (a2)); \
ASSERT_EQ(moz_malloc_usable_size(p), (a2)); \
free(p);
// On Win64 the smallest possible allocation is 16 bytes. On other platforms

View File

@ -732,7 +732,7 @@ struct CastToCheckedIntImpl {
};
template <typename T>
struct CastToCheckedIntImpl<T, CheckedInt<T> > {
struct CastToCheckedIntImpl<T, CheckedInt<T>> {
typedef const CheckedInt<T>& ReturnType;
static constexpr const CheckedInt<T>& run(const CheckedInt<T>& aU) {
return aU;

View File

@ -39,48 +39,47 @@ extern "C" const char* __tsan_default_options() {
// These are default suppressions for external libraries that probably
// every application would want to include if it potentially loads external
// libraries like GTK/X and hence their dependencies.
#define MOZ_TSAN_DEFAULT_EXTLIB_SUPPRESSIONS \
"called_from_lib:libatk-1\n" \
"called_from_lib:libcairo.so\n" \
"called_from_lib:libcairo-gobject\n" \
"called_from_lib:libgdk-3\n" \
"called_from_lib:libgdk_pixbuf\n" \
"called_from_lib:libgdk-x11\n" \
"called_from_lib:libgio-2\n" \
"called_from_lib:libglib-1\n" \
"called_from_lib:libglib-2\n" \
"called_from_lib:libgobject\n" \
"called_from_lib:libgtk-3\n" \
"called_from_lib:libgtk-x11\n" \
"called_from_lib:libgvfscommon\n" \
"called_from_lib:libgvfsdbus\n" \
"called_from_lib:libibus-1\n" \
"called_from_lib:libogg.so\n" \
"called_from_lib:libpangocairo\n" \
"called_from_lib:libpangoft2\n" \
"called_from_lib:pango-basic-fc\n" \
"called_from_lib:libpixman-1\n" \
"called_from_lib:libpulse.so\n" \
"called_from_lib:libpulsecommon\n" \
"called_from_lib:libsecret-1\n" \
"called_from_lib:libunity-gtk3-parser\n" \
"called_from_lib:libvorbis.so\n" \
"called_from_lib:libvorbisfile\n" \
"called_from_lib:libX11.so\n" \
"called_from_lib:libX11-xcb\n" \
"called_from_lib:libXau\n" \
"called_from_lib:libxcb.so\n" \
"called_from_lib:libXcomposite\n" \
"called_from_lib:libXcursor\n" \
"called_from_lib:libXdamage\n" \
"called_from_lib:libXdmcp\n" \
"called_from_lib:libXext\n" \
"called_from_lib:libXfixes\n" \
"called_from_lib:libXi.so\n" \
"called_from_lib:libXrandr\n" \
"called_from_lib:libXrender\n" \
"called_from_lib:libXss\n"
# define MOZ_TSAN_DEFAULT_EXTLIB_SUPPRESSIONS \
"called_from_lib:libatk-1\n" \
"called_from_lib:libcairo.so\n" \
"called_from_lib:libcairo-gobject\n" \
"called_from_lib:libgdk-3\n" \
"called_from_lib:libgdk_pixbuf\n" \
"called_from_lib:libgdk-x11\n" \
"called_from_lib:libgio-2\n" \
"called_from_lib:libglib-1\n" \
"called_from_lib:libglib-2\n" \
"called_from_lib:libgobject\n" \
"called_from_lib:libgtk-3\n" \
"called_from_lib:libgtk-x11\n" \
"called_from_lib:libgvfscommon\n" \
"called_from_lib:libgvfsdbus\n" \
"called_from_lib:libibus-1\n" \
"called_from_lib:libogg.so\n" \
"called_from_lib:libpangocairo\n" \
"called_from_lib:libpangoft2\n" \
"called_from_lib:pango-basic-fc\n" \
"called_from_lib:libpixman-1\n" \
"called_from_lib:libpulse.so\n" \
"called_from_lib:libpulsecommon\n" \
"called_from_lib:libsecret-1\n" \
"called_from_lib:libunity-gtk3-parser\n" \
"called_from_lib:libvorbis.so\n" \
"called_from_lib:libvorbisfile\n" \
"called_from_lib:libX11.so\n" \
"called_from_lib:libX11-xcb\n" \
"called_from_lib:libXau\n" \
"called_from_lib:libxcb.so\n" \
"called_from_lib:libXcomposite\n" \
"called_from_lib:libXcursor\n" \
"called_from_lib:libXdamage\n" \
"called_from_lib:libXdmcp\n" \
"called_from_lib:libXext\n" \
"called_from_lib:libXfixes\n" \
"called_from_lib:libXi.so\n" \
"called_from_lib:libXrandr\n" \
"called_from_lib:libXrender\n" \
"called_from_lib:libXss\n"
#endif // _MSC_VER

View File

@ -30,6 +30,7 @@
// symbolize one of the two traces and this can cause suppressed races to
// show up intermittently.
//
// clang-format off
extern "C" const char* __tsan_default_suppressions() {
return "# Add your suppressions below\n"
@ -315,4 +316,5 @@ extern "C" const char* __tsan_default_suppressions() {
// End of suppressions.
; // Please keep this semicolon.
}
// clang-format on
#endif // _MSC_VER

View File

@ -233,9 +233,8 @@ nsresult Http3Session::ProcessSingleTransactionRead(Http3Stream* stream,
*countWritten += countWrittenSingle;
if (ASpdySession::SoftStreamError(rv)) {
CloseStream(stream, (rv == NS_BINDING_RETARGETED)
? NS_BINDING_RETARGETED
: NS_OK);
CloseStream(stream,
(rv == NS_BINDING_RETARGETED) ? NS_BINDING_RETARGETED : NS_OK);
return NS_OK;
}
@ -250,8 +249,10 @@ nsresult Http3Session::ProcessTransactionRead(uint64_t stream_id,
uint32_t* countWritten) {
RefPtr<Http3Stream> stream = mStreamIdHash.Get(stream_id);
if (!stream) {
LOG(("Http3Session::ProcessTransactionRead - stream not found stream_id=0x%"
PRIx64 " [this=%p].", stream_id, this));
LOG(
("Http3Session::ProcessTransactionRead - stream not found "
"stream_id=0x%" PRIx64 " [this=%p].",
stream_id, this));
return NS_OK;
}
@ -261,7 +262,6 @@ nsresult Http3Session::ProcessTransactionRead(uint64_t stream_id,
nsresult Http3Session::ProcessTransactionRead(Http3Stream* stream,
uint32_t count,
uint32_t* countWritten) {
nsresult rv = ProcessSingleTransactionRead(stream, count, countWritten);
if (NS_FAILED(rv)) {
@ -280,7 +280,8 @@ nsresult Http3Session::ProcessTransactionRead(Http3Stream* stream,
if (stream->Done()) {
LOG3(("Http3Session::ProcessTransactionRead session=%p stream=%p 0x%" PRIx64
" cleanup stream.\n", this, stream, stream->StreamId()));
" cleanup stream.\n",
this, stream, stream->StreamId()));
CloseStream(stream, NS_OK);
}
@ -311,8 +312,8 @@ nsresult Http3Session::ProcessEvents(uint32_t count) {
nsresult rv = ProcessTransactionRead(id, count, &read);
if (NS_FAILED(rv)) {
LOG(("Http3Session::ProcessEvents [this=%p] rv=%" PRIx32,
this, static_cast<uint32_t>(rv)));
LOG(("Http3Session::ProcessEvents [this=%p] rv=%" PRIx32, this,
static_cast<uint32_t>(rv)));
return rv;
}
@ -726,9 +727,8 @@ nsresult Http3Session::ReadSegmentsAgain(nsAHttpSegmentReader* reader,
// Step 1)
while (
(mState ==
CONNECTED) && // Do not send transaction data untill we are connected.
CONNECTED) && // Do not send transaction data untill we are connected.
(stream = static_cast<Http3Stream*>(mReadyForWrite.PopFront()))) {
LOG(
("Http3Session::ReadSegmentsAgain call ReadSegments from stream=%p "
"[this=%p]",
@ -808,8 +808,8 @@ nsresult Http3Session::ProcessSlowConsumers() {
mSlowConsumersReadyForRead.RemoveElementAt(0);
uint32_t countRead = 0;
nsresult rv = ProcessTransactionRead(slowConsumer,
nsIOService::gDefaultSegmentSize, &countRead);
nsresult rv = ProcessTransactionRead(
slowConsumer, nsIOService::gDefaultSegmentSize, &countRead);
if (NS_SUCCEEDED(rv) && (countRead > 0) && !slowConsumer->Done()) {
// There have been buffered bytes successfully fed into the

View File

@ -316,13 +316,11 @@ nsresult HttpConnectionUDP::OnHeadersAvailable(nsAHttpTransaction* trans,
return NS_OK;
}
bool HttpConnectionUDP::IsReused() {
return mIsReused;
}
bool HttpConnectionUDP::IsReused() { return mIsReused; }
nsresult HttpConnectionUDP::TakeTransport(nsISocketTransport** aTransport,
nsIAsyncInputStream** aInputStream,
nsIAsyncOutputStream** aOutputStream) {
nsresult HttpConnectionUDP::TakeTransport(
nsISocketTransport** aTransport, nsIAsyncInputStream** aInputStream,
nsIAsyncOutputStream** aOutputStream) {
return NS_ERROR_FAILURE;
}
@ -386,8 +384,7 @@ nsresult HttpConnectionUDP::ResumeSend() {
if (mSocketOut) {
nsresult rv = mSocketOut->AsyncWait(this, 0, 0, nullptr);
LOG(
("HttpConnectionUDP::ResumeSend [this=%p]\n", this));
LOG(("HttpConnectionUDP::ResumeSend [this=%p]\n", this));
return rv;
}
@ -438,10 +435,10 @@ nsresult HttpConnectionUDP::MaybeForceSendIO() {
}
MOZ_ASSERT(!mForceSendTimer);
mForceSendPending = true;
return NS_NewTimerWithFuncCallback(getter_AddRefs(mForceSendTimer),
HttpConnectionUDP::ForceSendIO, this,
kForceDelay, nsITimer::TYPE_ONE_SHOT,
"net::HttpConnectionUDP::MaybeForceSendIO");
return NS_NewTimerWithFuncCallback(
getter_AddRefs(mForceSendTimer), HttpConnectionUDP::ForceSendIO, this,
kForceDelay, nsITimer::TYPE_ONE_SHOT,
"net::HttpConnectionUDP::MaybeForceSendIO");
}
// trigger an asynchronous read
@ -449,8 +446,7 @@ nsresult HttpConnectionUDP::ForceRecv() {
LOG(("HttpConnectionUDP::ForceRecv [this=%p]\n", this));
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
return NS_DispatchToCurrentThread(
new HttpConnectionUDPForceIO(this, true));
return NS_DispatchToCurrentThread(new HttpConnectionUDPForceIO(this, true));
}
// trigger an asynchronous write
@ -461,9 +457,7 @@ nsresult HttpConnectionUDP::ForceSend() {
return MaybeForceSendIO();
}
HttpVersion HttpConnectionUDP::Version() {
return HttpVersion::v3_0;
}
HttpVersion HttpConnectionUDP::Version() { return HttpVersion::v3_0; }
//-----------------------------------------------------------------------------
// HttpConnectionUDP <private>
@ -487,7 +481,7 @@ void HttpConnectionUDP::CloseTransaction(nsAHttpTransaction* trans,
// in case any previously validated ones are now invalid
if (((reason == NS_ERROR_NET_RESET) ||
(NS_ERROR_GET_MODULE(reason) == NS_ERROR_MODULE_SECURITY)) &&
mConnInfo && !(mTransactionCaps & NS_HTTP_ERROR_SOFTLY)) {
mConnInfo && !(mTransactionCaps & NS_HTTP_ERROR_SOFTLY)) {
gHttpHandler->ClearHostMapping(mConnInfo);
}
@ -582,7 +576,7 @@ nsresult HttpConnectionUDP::OnWriteSegment(char* buf, uint32_t count,
}
if (*countWritten == 0) {
return NS_BASE_STREAM_CLOSED;
return NS_BASE_STREAM_CLOSED;
}
return NS_OK;
@ -768,9 +762,7 @@ void HttpConnectionUDP::SetEvent(nsresult aStatus) {
}
}
bool HttpConnectionUDP::IsProxyConnectInProgress() {
return false;
}
bool HttpConnectionUDP::IsProxyConnectInProgress() { return false; }
bool HttpConnectionUDP::LastTransactionExpectedNoContent() {
return mLastTransactionExpectedNoContent;
@ -780,9 +772,7 @@ void HttpConnectionUDP::SetLastTransactionExpectedNoContent(bool val) {
mLastTransactionExpectedNoContent = val;
}
bool HttpConnectionUDP::IsPersistent() {
return !mDontReuse;
}
bool HttpConnectionUDP::IsPersistent() { return !mDontReuse; }
nsAHttpTransaction* HttpConnectionUDP::Transaction() { return mHttp3Session; }

View File

@ -177,6 +177,7 @@ class nsHttpConnection final : public HttpConnectionBase,
bool NoClientCertAuth() const override;
bool CanAcceptWebsocket() override;
private:
// Value (set in mTCPKeepaliveConfig) indicates which set of prefs to use.
enum TCPKeepaliveConfig {

View File

@ -830,7 +830,8 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(
MOZ_ASSERT(ent);
MOZ_ASSERT(mCT.GetWeak(newConn->ConnectionInfo()->HashKey()) == ent);
HttpConnectionBase* existingConn = FindCoalescableConnection(ent, true, false);
HttpConnectionBase* existingConn =
FindCoalescableConnection(ent, true, false);
if (existingConn) {
LOG(
("UpdateCoalescingForNewConn() found existing active conn that could "
@ -1576,7 +1577,8 @@ nsresult nsHttpConnectionMgr::TryDispatchTransaction(
// essentially pipelining without head of line blocking
if (!(caps & NS_HTTP_DISALLOW_SPDY) && gHttpHandler->IsSpdyEnabled()) {
RefPtr<HttpConnectionBase> conn = GetH2orH3ActiveConn(ent,
RefPtr<HttpConnectionBase> conn = GetH2orH3ActiveConn(
ent,
(!gHttpHandler->IsHttp3Enabled() || (caps & NS_HTTP_DISALLOW_HTTP3)));
if (conn) {
if (trans->IsWebsocketUpgrade() && !conn->CanAcceptWebsocket()) {
@ -1966,9 +1968,8 @@ nsresult nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction* trans) {
nsHttpConnectionInfo* ci = trans->ConnectionInfo();
MOZ_ASSERT(ci);
nsConnectionEntry* ent =
GetOrCreateConnectionEntry(ci, !!trans->TunnelProvider(),
trans->Caps() & NS_HTTP_DISALLOW_HTTP3);
nsConnectionEntry* ent = GetOrCreateConnectionEntry(
ci, !!trans->TunnelProvider(), trans->Caps() & NS_HTTP_DISALLOW_HTTP3);
MOZ_ASSERT(ent);
ReportProxyTelemetry(ent);
@ -2274,8 +2275,8 @@ HttpConnectionBase* nsHttpConnectionMgr::GetH2orH3ActiveConn(
// there was no active spdy connection in the connection entry, but
// there might be one in the hash table for coalescing
HttpConnectionBase* existingConn = FindCoalescableConnection(ent, false,
aNoHttp3);
HttpConnectionBase* existingConn =
FindCoalescableConnection(ent, false, aNoHttp3);
if (existingConn) {
LOG(
("GetH2orH3ActiveConn() request for ent %p %s "
@ -2693,7 +2694,7 @@ void nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase*) {
if (ent->mUsingSpdy) {
for (uint32_t i = 0; i < ent->mActiveConns.Length(); ++i) {
RefPtr<nsHttpConnection> connTCP =
do_QueryObject( ent->mActiveConns[i]);
do_QueryObject(ent->mActiveConns[i]);
// Http3 has its own timers, it is not using this one.
if (connTCP && connTCP->UsingSpdy()) {
if (!connTCP->CanReuse()) {
@ -5675,7 +5676,8 @@ void nsHttpConnectionMgr::MoveToWildCardConnEntry(
return;
}
nsConnectionEntry* wcEnt = GetOrCreateConnectionEntry(wildCardCI, true, false);
nsConnectionEntry* wcEnt =
GetOrCreateConnectionEntry(wildCardCI, true, false);
if (wcEnt == ent) {
// nothing to do!
return;

View File

@ -351,9 +351,9 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
const nsACString& scheme, const nsACString& host, int32_t port, bool pb,
bool isolated, const nsACString& topWindowOrigin,
const OriginAttributes& originAttributes, bool aHttp3Allowed) {
return mAltSvcCache->GetAltServiceMapping(
scheme, host, port, pb, isolated, topWindowOrigin, originAttributes,
aHttp3Allowed);
return mAltSvcCache->GetAltServiceMapping(scheme, host, port, pb, isolated,
topWindowOrigin, originAttributes,
aHttp3Allowed);
}
//

View File

@ -46,7 +46,8 @@ class ContentBlockingAllowList final {
static bool Check(nsIPrincipal* aTopWinPrincipal, bool aIsPrivateBrowsing);
static bool Check(nsPIDOMWindowInner* aWindow);
static bool Check(nsICookieJarSettings* aCookieJarSettings);
static nsresult Check(mozilla::dom::BrowsingContext* aBrowsingContext, bool& aIsAllowListed);
static nsresult Check(mozilla::dom::BrowsingContext* aBrowsingContext,
bool& aIsAllowListed);
friend class ContentBlocking;
};

View File

@ -1166,26 +1166,23 @@ TelemetryImpl::GetIsOfficialTelemetry(bool* ret) {
// C functions with the "fog_" prefix.
// See toolkit/components/glean/*.
extern "C" {
nsresult fog_init(
const nsACString* dataPath,
const nsACString* buildId,
const nsACString* appDisplayVersion,
const char* channel,
const nsACString* osVersion,
const nsACString* architecture
);
nsresult fog_init(const nsACString* dataPath, const nsACString* buildId,
const nsACString* appDisplayVersion, const char* channel,
const nsACString* osVersion, const nsACString* architecture);
}
static void internal_initGlean() {
nsAutoCString dataPath;
nsresult rv = Preferences::GetCString("telemetry.fog.temporary_and_just_for_testing.data_path", dataPath);
nsresult rv = Preferences::GetCString(
"telemetry.fog.temporary_and_just_for_testing.data_path", dataPath);
if (NS_FAILED(rv)) {
NS_WARNING("Can't read data path preference. FOG will not be initialized");
return;
}
nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
if (!appInfo) {
NS_WARNING("Can't fetch app info. FOG will not be initialized.");
return;
@ -1205,36 +1202,32 @@ static void internal_initGlean() {
return;
}
nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
nsCOMPtr<nsIPropertyBag2> infoService =
do_GetService("@mozilla.org/system-info;1");
if (!appInfo) {
NS_WARNING("Can't fetch info service. FOG will not be initialized.");
return;
}
nsAutoCString osVersion;
rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("version"), osVersion);
rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("version"),
osVersion);
if (NS_FAILED(rv)) {
NS_WARNING("Can't get OS version. FOG will not be initialized.");
return;
}
nsAutoCString architecture;
rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("arch"), architecture);
rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("arch"),
architecture);
if (NS_FAILED(rv)) {
NS_WARNING("Can't get architecture. FOG will not be initialized.");
return;
}
Unused << NS_WARN_IF(NS_FAILED(
fog_init(
&dataPath,
&buildID,
&appVersion,
MOZ_STRINGIFY(MOZ_UPDATE_CHANNEL),
&osVersion,
&architecture
)
));
Unused << NS_WARN_IF(NS_FAILED(fog_init(&dataPath, &buildID, &appVersion,
MOZ_STRINGIFY(MOZ_UPDATE_CHANNEL),
&osVersion, &architecture)));
}
#endif // defined(MOZ_GLEAN)

View File

@ -180,7 +180,7 @@ HRESULT UpdateTask(const wchar_t* uniqueToken) {
RefPtr<ITaskService> scheduler;
HRESULT hr = S_OK;
ENSURE(CoCreateInstance(CLSID_TaskScheduler, nullptr, CLSCTX_INPROC_SERVER,
IID_ITaskService, getter_AddRefs(scheduler)));
IID_ITaskService, getter_AddRefs(scheduler)));
ENSURE(scheduler->Connect(VARIANT{}, VARIANT{}, VARIANT{}, VARIANT{}));

View File

@ -359,9 +359,9 @@ static mozilla::WindowsError SendPing(std::string defaultBrowser,
const wchar_t* pingsenderArgs[] = {pingsenderPath.c_str(), url.c_str(),
pingFilePath.c_str()};
mozilla::UniquePtr<wchar_t[]> pingsenderCmdLine(mozilla::MakeCommandLine(
mozilla::ArrayLength(pingsenderArgs),
const_cast<wchar_t**>(pingsenderArgs)));
mozilla::UniquePtr<wchar_t[]> pingsenderCmdLine(
mozilla::MakeCommandLine(mozilla::ArrayLength(pingsenderArgs),
const_cast<wchar_t**>(pingsenderArgs)));
PROCESS_INFORMATION pi;
STARTUPINFOW si = {sizeof(si)};
@ -407,7 +407,6 @@ HRESULT SendDefaultBrowserPing() {
}
std::string osLocale = osLocaleResult.unwrap();
return
SendPing(defaultBrowser, previousDefaultBrowser, osVersion, osLocale)
.AsHResult();
return SendPing(defaultBrowser, previousDefaultBrowser, osVersion, osLocale)
.AsHResult();
}

View File

@ -7,8 +7,7 @@
#ifndef __DEFAULT_BROWSER_AGENT_COMMON_H__
#define __DEFAULT_BROWSER_AGENT_COMMON_H__
#define AGENT_REGKEY_NAME \
L"SOFTWARE\\" MOZ_APP_VENDOR \
"\\" MOZ_APP_BASENAME "\\Default Browser Agent"
#define AGENT_REGKEY_NAME \
L"SOFTWARE\\" MOZ_APP_VENDOR "\\" MOZ_APP_BASENAME "\\Default Browser Agent"
#endif // __DEFAULT_BROWSER_AGENT_COMMON_H__

View File

@ -10,6 +10,7 @@
// See also mozglue/build/TsanOptions.cpp before modifying this
extern "C" const char* __tsan_default_suppressions() {
// clang-format off
return "# Add your suppressions below\n"
// External uninstrumented libraries
@ -21,5 +22,6 @@ extern "C" const char* __tsan_default_suppressions() {
// End of suppressions.
; // Please keep this semicolon.
// clang-format on
}
#endif // _MSC_VER

View File

@ -1383,11 +1383,8 @@ void nsDragService::SourceDataGet(GtkWidget* aWidget, GdkDragContext* aContext,
return;
}
MOZ_LOG(sDragLm, LogLevel::Debug, ("Type is %s\n", typeName));
auto freeTypeName = mozilla::MakeScopeExit([&] {
g_free(typeName);
});
auto freeTypeName = mozilla::MakeScopeExit([&] { g_free(typeName); });
// check to make sure that we have data items to return.
if (!mSourceDataItems) {
MOZ_LOG(sDragLm, LogLevel::Debug, ("Failed to get our data items\n"));

View File

@ -755,10 +755,8 @@ nsresult ShutdownXPCOM(nsIServiceManager* aServMgr) {
// of crashing.
#if defined(DEBUG) && !defined(ANDROID)
if (!getenv("MOZ_IGNORE_NSS_SHUTDOWN_LEAKS") &&
!getenv("XPCOM_MEM_BLOAT_LOG") &&
!getenv("XPCOM_MEM_LEAK_LOG") &&
!getenv("XPCOM_MEM_REFCNT_LOG") &&
!getenv("XPCOM_MEM_COMPTR_LOG")) {
!getenv("XPCOM_MEM_BLOAT_LOG") && !getenv("XPCOM_MEM_LEAK_LOG") &&
!getenv("XPCOM_MEM_REFCNT_LOG") && !getenv("XPCOM_MEM_COMPTR_LOG")) {
MOZ_CRASH("NSS_Shutdown failed");
} else {
# ifdef NS_BUILD_REFCNT_LOGGING