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

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90793
This commit is contained in:
Sylvestre Ledru 2020-09-20 10:14:09 +00:00
Родитель 41e9c935de
Коммит ec8859e69e
40 изменённых файлов: 146 добавлений и 153 удалений

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

@ -14,7 +14,7 @@
#include "jsapi.h"
#include "js/friend/DOMProxy.h" // JS::DOMProxyShadowsResult, JS::ExpandoAndGeneration, JS::SetDOMProxyInformation
#include "js/Object.h" // JS::GetCompartment
#include "js/Object.h" // JS::GetCompartment
using namespace JS;

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

@ -5178,7 +5178,7 @@ nsresult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner::
nsresult rv =
mDeleteRangesHandlerConst.ComputeRangesToDeleteRangesWithTransaction(
aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete);
aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete);
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"AutoDeleteRangesHandler::"
"ComputeRangesToDeleteRangesWithTransaction() failed");

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

@ -70,7 +70,6 @@ class AndroidSharedBlitGL final {
}
private:
static already_AddRefed<GLContextEGL> CreateContextImpl(bool aUseGles) {
sMutex.AssertCurrentThreadOwns();
MOZ_ASSERT(!sContext);

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

@ -880,15 +880,11 @@ struct ScrollMetadata {
return mIsRDMTouchSimulationActive;
}
bool DidContentGetPainted() const {
return mDidContentGetPainted;
}
bool DidContentGetPainted() const { return mDidContentGetPainted; }
private:
// For use in IPC only
void SetDidContentGetPainted(bool aValue) {
mDidContentGetPainted = aValue;
}
void SetDidContentGetPainted(bool aValue) { mDidContentGetPainted = aValue; }
public:
// For more details about the concept of a disregarded direction, refer to the

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

@ -100,8 +100,8 @@ std::pair<int32_t, int32_t> GetMouseWheelAnimationDurations();
* Calculate the physics parameters for smooth scroll animations for the
* given origin, based on pref values.
*/
ScrollAnimationBezierPhysicsSettings
ComputeBezierAnimationSettingsForOrigin(ScrollOrigin aOrigin);
ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin(
ScrollOrigin aOrigin);
} // namespace apz

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

@ -80,17 +80,18 @@ static int32_t GetNormalizedAppVersion() {
return std::make_pair(minMS, maxMS);
}
ScrollAnimationBezierPhysicsSettings
ComputeBezierAnimationSettingsForOrigin(ScrollOrigin aOrigin) {
ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin(
ScrollOrigin aOrigin) {
int32_t minMS = 0;
int32_t maxMS = 0;
bool isOriginSmoothnessEnabled = false;
#define READ_DURATIONS(prefbase) \
isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && StaticPrefs::general_smoothScroll_ ## prefbase (); \
if (isOriginSmoothnessEnabled) { \
minMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMinMS(); \
maxMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMaxMS(); \
#define READ_DURATIONS(prefbase) \
isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && \
StaticPrefs::general_smoothScroll_##prefbase(); \
if (isOriginSmoothnessEnabled) { \
minMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMinMS(); \
maxMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMaxMS(); \
}
switch (aOrigin) {

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

@ -216,31 +216,30 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
static bool Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult) {
return (
ReadParam(aMsg, aIter, &aResult->mScrollId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
ReadParam(aMsg, aIter, &aResult->mCompositionBounds) &&
ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&
ReadParam(aMsg, aIter, &aResult->mCriticalDisplayPort) &&
ReadParam(aMsg, aIter, &aResult->mScrollableRect) &&
ReadParam(aMsg, aIter, &aResult->mCumulativeResolution) &&
ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) &&
ReadParam(aMsg, aIter, &aResult->mScrollOffset) &&
ReadParam(aMsg, aIter, &aResult->mZoom) &&
ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
ReadParam(aMsg, aIter, &aResult->mRootCompositionSize) &&
ReadParam(aMsg, aIter, &aResult->mDisplayPortMargins) &&
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
ReadParam(aMsg, aIter, &aResult->mLayoutViewport) &&
ReadParam(aMsg, aIter, &aResult->mExtraResolution) &&
ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) &&
ReadParam(aMsg, aIter, &aResult->mVisualDestination) &&
ReadParam(aMsg, aIter, &aResult->mVisualScrollUpdateType) &&
ReadParam(aMsg, aIter, &aResult->mFixedLayerMargins) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetIsRootContent) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetIsScrollInfoLayer));
return (ReadParam(aMsg, aIter, &aResult->mScrollId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
ReadParam(aMsg, aIter, &aResult->mCompositionBounds) &&
ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&
ReadParam(aMsg, aIter, &aResult->mCriticalDisplayPort) &&
ReadParam(aMsg, aIter, &aResult->mScrollableRect) &&
ReadParam(aMsg, aIter, &aResult->mCumulativeResolution) &&
ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) &&
ReadParam(aMsg, aIter, &aResult->mScrollOffset) &&
ReadParam(aMsg, aIter, &aResult->mZoom) &&
ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
ReadParam(aMsg, aIter, &aResult->mRootCompositionSize) &&
ReadParam(aMsg, aIter, &aResult->mDisplayPortMargins) &&
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
ReadParam(aMsg, aIter, &aResult->mLayoutViewport) &&
ReadParam(aMsg, aIter, &aResult->mExtraResolution) &&
ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) &&
ReadParam(aMsg, aIter, &aResult->mVisualDestination) &&
ReadParam(aMsg, aIter, &aResult->mVisualScrollUpdateType) &&
ReadParam(aMsg, aIter, &aResult->mFixedLayerMargins) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetIsRootContent) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetIsScrollInfoLayer));
}
};
@ -449,8 +448,8 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
&paramType::SetResolutionUpdated) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetIsRDMTouchSimulationActive)) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetDidContentGetPainted) &&
ReadBoolForBitfield(aMsg, aIter, aResult,
&paramType::SetDidContentGetPainted) &&
ReadParam(aMsg, aIter, &aResult->mDisregardedDirection) &&
ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior) &&
ReadParam(aMsg, aIter, &aResult->mScrollUpdates);

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

@ -26,7 +26,7 @@
#include "js/Class.h"
#include "js/Conversions.h"
#include "js/experimental/JitInfo.h" // JSJitGetterOp, JSJitInfo
#include "js/friend/StackLimits.h" // js::CheckRecursionLimit
#include "js/friend/StackLimits.h" // js::CheckRecursionLimit
#include "js/PropertySpec.h"
#include "util/Poison.h"
#include "util/StringBuffer.h"

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

@ -14,7 +14,7 @@
#include "frontend/CompilationInfo.h"
#include "gc/HashUtil.h"
#include "js/friend/JSMEnvironment.h" // JS::NewJSMEnvironment, JS::ExecuteInJSMEnvironment, JS::GetJSMEnvironmentOfScriptedCaller, JS::IsJSMEnvironment
#include "js/friend/WindowProxy.h" // js::IsWindowProxy
#include "js/friend/WindowProxy.h" // js::IsWindowProxy
#include "js/SourceText.h"
#include "js/StableStringChars.h"
#include "vm/GlobalObject.h"

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

@ -16,7 +16,7 @@
#include "js/Debug.h"
#include "js/experimental/JitInfo.h" // JSJitGetterOp, JSJitInfo
#include "js/ForOfIterator.h" // JS::ForOfIterator
#include "js/ForOfIterator.h" // JS::ForOfIterator
#include "js/PropertySpec.h"
#include "vm/ArrayObject.h"
#include "vm/AsyncFunction.h"

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

@ -14,7 +14,7 @@
#include "gc/WeakMap.h"
#include "js/Conversions.h"
#include "js/experimental/JitInfo.h" // JSJitInfo
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/ScalarType.h" // js::Scalar::Type
#include "vm/ArrayBufferObject.h"
#include "vm/JSObject.h"

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

@ -21,18 +21,18 @@
#include "debugger/Script.h" // for DebuggerScript
#include "frontend/BytecodeCompiler.h" // for IsIdentifier
#include "gc/Rooting.h" // for RootedDebuggerEnvironment
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "js/HeapAPI.h" // for IsInsideNursery
#include "vm/Compartment.h" // for Compartment
#include "vm/JSAtom.h" // for Atomize, PinAtom
#include "vm/JSContext.h" // for JSContext
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
#include "vm/Realm.h" // for AutoRealm, ErrorCopier
#include "vm/Scope.h" // for ScopeKind, ScopeKindString
#include "vm/StringType.h" // for JSAtom
#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge
#include "js/HeapAPI.h" // for IsInsideNursery
#include "vm/Compartment.h" // for Compartment
#include "vm/JSAtom.h" // for Atomize, PinAtom
#include "vm/JSContext.h" // for JSContext
#include "vm/JSFunction.h" // for JSFunction
#include "vm/JSObject.h" // for JSObject, RequireObject
#include "vm/NativeObject.h" // for NativeObject, JSObject::is
#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind
#include "vm/Realm.h" // for AutoRealm, ErrorCopier
#include "vm/Scope.h" // for ScopeKind, ScopeKindString
#include "vm/StringType.h" // for JSAtom
#include "vm/Compartment-inl.h" // for Compartment::wrap
#include "vm/EnvironmentObject-inl.h" // for JSObject::enclosingEnvironment

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

@ -35,7 +35,7 @@
#include "js/HeapAPI.h" // for IsInsideNursery
#include "js/Promise.h" // for PromiseState
#include "js/Proxy.h" // for PropertyDescriptor
#include "js/SourceText.h" // for SourceText
#include "js/SourceText.h" // for SourceText
#include "js/StableStringChars.h" // for AutoStableStringChars
#include "js/String.h" // for JS::StringHasLatin1Chars
#include "proxy/ScriptedProxyHandler.h" // for ScriptedProxyHandler

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

@ -130,7 +130,6 @@ class GCParallelTask : public mozilla::LinkedListElement<GCParallelTask>,
return state_ == State::Dispatched;
}
protected:
// Override this method to provide the task's functionality.
virtual void run(AutoLockHelperThreadState& lock) = 0;

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

@ -27,7 +27,7 @@
#include "jit/SharedICRegisters.h"
#include "js/friend/DOMProxy.h" // JS::ExpandoAndGeneration
#include "js/friend/XrayJitInfo.h" // js::jit::GetXrayJitInfo
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/ScalarType.h" // js::Scalar::Type
#include "proxy/Proxy.h"
#include "vm/ArrayBufferObject.h"
#include "vm/ArrayBufferViewObject.h"

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

@ -24,8 +24,8 @@
#include "jit/MIRGraph.h"
#include "jit/TIOracle.h"
#include "js/experimental/JitInfo.h" // JSJitInfo
#include "js/ScalarType.h" // js::Scalar::Type
#include "vm/SharedStencil.h" // GCThingIndex
#include "js/ScalarType.h" // js::Scalar::Type
#include "vm/SharedStencil.h" // GCThingIndex
namespace js {

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

@ -21,8 +21,8 @@
#include "jit/MIR.h"
#include "jit/MIRGraph.h"
#include "js/experimental/JitInfo.h" // JSJitInfo
#include "js/RegExpFlags.h" // JS::RegExpFlag, JS::RegExpFlags
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/RegExpFlags.h" // JS::RegExpFlag, JS::RegExpFlags
#include "js/ScalarType.h" // js::Scalar::Type
#include "vm/ArgumentsObject.h"
#include "vm/ArrayBufferObject.h"
#include "vm/JSObject.h"

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

@ -26,7 +26,7 @@
#include "jit/RangeAnalysis.h"
#include "js/Conversions.h"
#include "js/experimental/JitInfo.h" // JSJitInfo, JSTypedMethodJitInfo
#include "js/ScalarType.h" // js::Scalar::Type
#include "js/ScalarType.h" // js::Scalar::Type
#include "util/Text.h"
#include "util/Unicode.h"
#include "vm/PlainObject.h" // js::PlainObject

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

@ -9,7 +9,7 @@
#include "builtin/Eval.h"
#include "builtin/ModuleObject.h" // js::GetOrCreateModuleMetaObject
#include "builtin/Promise.h" // js::AsyncFunctionAwait
#include "builtin/Promise.h" // js::AsyncFunctionAwait
#include "builtin/RegExp.h"
#include "builtin/String.h"
#include "jit/BaselineIC.h"

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

@ -5,7 +5,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "js/Array.h" // JS::GetArrayLength, JS::IsArrayObject
#include "js/Array.h" // JS::GetArrayLength, JS::IsArrayObject
#include "js/Object.h" // JS::GetClass
#include "jsapi-tests/tests.h"

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

@ -24,9 +24,9 @@
#include "js/RootingAPI.h" // JS::MutableHandle, JS::Rooted
#include "js/SourceText.h" // JS::SourceOwnership, JS::SourceText
#include "js/String.h" // JS::GetLatin1LinearStringChars, JS::GetTwoByteLinearStringChars, JS::StringHasLatin1Chars
#include "js/UniquePtr.h" // js::UniquePtr
#include "js/Utility.h" // JS::FreePolicy
#include "js/Value.h" // JS::NullValue, JS::ObjectValue, JS::Value
#include "js/UniquePtr.h" // js::UniquePtr
#include "js/Utility.h" // JS::FreePolicy
#include "js/Value.h" // JS::NullValue, JS::ObjectValue, JS::Value
#include "jsapi-tests/tests.h"
#include "vm/Compression.h" // js::Compressor::CHUNK_SIZE
#include "vm/JSFunction.h" // JSFunction::getOrCreateScript

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

@ -619,7 +619,6 @@ extern JS_FRIEND_API uint64_t GetSCOffset(JSStructuredCloneWriter* writer);
} // namespace js
namespace js {
static MOZ_ALWAYS_INLINE JS::shadow::Function* FunctionObjectToShadowFunction(

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

@ -33,8 +33,8 @@
#include "jit/Jit.h"
#include "js/CharacterEncoding.h"
#include "js/experimental/JitInfo.h" // JSJitInfo
#include "js/friend/StackLimits.h" // js::CheckRecursionLimit
#include "js/friend/WindowProxy.h" // js::IsWindowProxy
#include "js/friend/StackLimits.h" // js::CheckRecursionLimit
#include "js/friend/WindowProxy.h" // js::IsWindowProxy
#include "util/CheckedArithmetic.h"
#include "util/StringBuffer.h"
#include "vm/AsyncFunction.h"

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

@ -58,7 +58,7 @@
#include "vm/BytecodeLocation.h"
#include "vm/BytecodeUtil.h"
#include "vm/Compression.h"
#include "vm/FunctionFlags.h" // js::FunctionFlags
#include "vm/FunctionFlags.h" // js::FunctionFlags
#include "vm/HelperThreadState.h" // js::RunPendingSourceCompressions
#include "vm/JSAtom.h"
#include "vm/JSContext.h"

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

@ -12,10 +12,10 @@
#include "jsapi.h" // js::AssertHeapIsIdle
#include "vm/GlobalObject.h" // js::GlobalObject
#include "vm/JSContext.h" // JSContext, CHECK_THREAD
#include "vm/JSObject.h" // JSObject
#include "vm/Runtime.h" // JSRuntime
#include "vm/GlobalObject.h" // js::GlobalObject
#include "vm/JSContext.h" // JSContext, CHECK_THREAD
#include "vm/JSObject.h" // JSObject
#include "vm/Runtime.h" // JSRuntime
#include "vm/JSContext-inl.h" // JSContext::check
#include "vm/JSObject-inl.h" // JSObject::nonCCWGlobal

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

@ -40,8 +40,8 @@
#include "util/StringBuffer.h"
#include "util/Text.h"
#include "vm/ErrorObject.h"
#include "vm/FunctionFlags.h" // js::FunctionFlags
#include "vm/GlobalObject.h" // js::GlobalObject
#include "vm/FunctionFlags.h" // js::FunctionFlags
#include "vm/GlobalObject.h" // js::GlobalObject
#include "vm/HelperThreadState.h" // js::PromiseHelperTask
#include "vm/Interpreter.h"
#include "vm/PlainObject.h" // js::PlainObject

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

@ -27,7 +27,7 @@
#include "js/experimental/TypedData.h" // JS_NewUint8Array
#include "threading/LockGuard.h"
#include "vm/HelperThreadState.h" // Tier2GeneratorTask
#include "vm/PlainObject.h" // js::PlainObject
#include "vm/PlainObject.h" // js::PlainObject
#include "wasm/WasmBaselineCompile.h"
#include "wasm/WasmCompile.h"
#include "wasm/WasmInstance.h"

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

@ -14,7 +14,7 @@
#include "XPCWrapper.h"
#include "jsfriendapi.h"
#include "js/AllocationLogging.h" // JS::SetLogCtorDtorFunctions
#include "js/Object.h" // JS::GetClass
#include "js/Object.h" // JS::GetClass
#include "js/ProfilingStack.h"
#include "GeckoProfiler.h"
#include "nsJSEnvironment.h"

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

@ -8509,7 +8509,8 @@ void PresShell::EventHandler::RecordEventHandlingResponsePerformance(
GetDocument()->GetReadyStateEnum() != Document::READYSTATE_COMPLETE) {
Telemetry::Accumulate(Telemetry::LOAD_INPUT_EVENT_RESPONSE_MS, millis);
if (GetDocument()->ShouldIncludeInTelemetry(/* aAllowExtensionURIs = */ false) &&
if (GetDocument()->ShouldIncludeInTelemetry(
/* aAllowExtensionURIs = */ false) &&
GetDocument()->IsTopLevelContentDocument()) {
if (auto* wgc = GetDocument()->GetWindowGlobalChild()) {
Unused << wgc->SendSubmitLoadInputEventResponsePreloadTelemetry(millis);

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

@ -423,7 +423,7 @@ class nsDocumentViewer final : public nsIContentViewer,
// (ie, non owning) references. If you add any members to this
// class, please make the ownership explicit (pinkerton, scc).
WeakPtr<nsDocShell> mContainer; // it owns me!
WeakPtr<nsDocShell> mContainer; // it owns me!
RefPtr<nsDeviceContext> mDeviceContext; // We create and own this baby
// the following six items are explicitly in this order

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

@ -3077,7 +3077,8 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
// inconsistencies from querying a stale value.
if (mIsRoot && nsLayoutUtils::CanScrollOriginClobberApz(mLastScrollOrigin)) {
AutoWeakFrame weakFrame(mOuter);
AutoScrollbarRepaintSuppression repaintSuppression(this, weakFrame, !schedulePaint);
AutoScrollbarRepaintSuppression repaintSuppression(this, weakFrame,
!schedulePaint);
nsPoint relativeOffset =
presContext->PresShell()->GetVisualViewportOffset() - curPos;
@ -3088,7 +3089,6 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
}
}
if (schedulePaint) {
mOuter->SchedulePaint();

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

@ -261,14 +261,11 @@ AltSvcMapping::AltSvcMapping(
}
}
void AltSvcMapping::MakeHashKey(nsCString& outKey,
const nsACString& originScheme,
const nsACString& originHost,
int32_t originPort, bool privateBrowsing,
bool isolated,
const nsACString& topWindowOrigin,
const OriginAttributes& originAttributes,
bool aHttp3) {
void AltSvcMapping::MakeHashKey(
nsCString& outKey, const nsACString& originScheme,
const nsACString& originHost, int32_t originPort, bool privateBrowsing,
bool isolated, const nsACString& topWindowOrigin,
const OriginAttributes& originAttributes, bool aHttp3) {
outKey.Truncate();
if (originPort == -1) {
@ -1154,8 +1151,9 @@ already_AddRefed<AltSvcMapping> AltSvcCache::GetAltServiceMapping(
// First look for HTTP3
if (aHttp3Allowed) {
nsAutoCString key;
AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, isolated,
topWindowOrigin, originAttributes, true);
AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing,
isolated, topWindowOrigin, originAttributes,
true);
RefPtr<AltSvcMapping> existing = LookupMapping(key, privateBrowsing);
LOG(
("AltSvcCache::GetAltServiceMapping %p key=%s "
@ -1170,8 +1168,9 @@ already_AddRefed<AltSvcMapping> AltSvcCache::GetAltServiceMapping(
// Now look for HTTP2.
if (aHttp2Allowed) {
nsAutoCString key;
AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, isolated,
topWindowOrigin, originAttributes, false);
AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing,
isolated, topWindowOrigin, originAttributes,
false);
RefPtr<AltSvcMapping> existing = LookupMapping(key, privateBrowsing);
LOG(
("AltSvcCache::GetAltServiceMapping %p key=%s "

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

@ -102,7 +102,8 @@ class AltSvcMapping {
const nsACString& originHost, int32_t originPort,
bool privateBrowsing, bool isolated,
const nsACString& topWindowOrigin,
const OriginAttributes& originAttributes, bool aIsHttp3);
const OriginAttributes& originAttributes,
bool aIsHttp3);
bool IsHttp3() { return mIsHttp3; }
const nsCString& NPNToken() const { return mNPNToken; }

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

@ -143,10 +143,11 @@ nsresult Http3Session::Init(const nsACString& aOrigin,
gHttpHandler->DefaultQpackTableSize(),
gHttpHandler->DefaultHttp3MaxBlockedStreams(), this));
nsresult rv = NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr,
gHttpHandler->DefaultQpackTableSize(),
gHttpHandler->DefaultHttp3MaxBlockedStreams(),
getter_AddRefs(mHttp3Connection));
nsresult rv =
NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr,
gHttpHandler->DefaultQpackTableSize(),
gHttpHandler->DefaultHttp3MaxBlockedStreams(),
getter_AddRefs(mHttp3Connection));
if (NS_FAILED(rv)) {
return rv;
}
@ -168,12 +169,11 @@ nsresult Http3Session::Init(const nsACString& aOrigin,
// Http3Session is still being initialized and ReportHttp3Connection
// will try to dispatch transaction on this session therefore it
// needs to be executed after the initializationg is done.
DebugOnly<nsresult> rv = NS_DispatchToCurrentThread(NS_NewRunnableFunction(
"Http3Session::ReportHttp3Connection",
[self]() {
self->ReportHttp3Connection();
}));
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "NS_DispatchToCurrentThread failed");
DebugOnly<nsresult> rv = NS_DispatchToCurrentThread(
NS_NewRunnableFunction("Http3Session::ReportHttp3Connection",
[self]() { self->ReportHttp3Connection(); }));
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
"NS_DispatchToCurrentThread failed");
}
}
return NS_OK;
@ -438,36 +438,35 @@ nsresult Http3Session::ProcessEvents(uint32_t count) {
case Http3Event::Tag::ZeroRttRejected:
LOG(("Http3Session::ProcessEvents - ZeroRttRejected"));
if (mState == ZERORTT) {
mState = INITIALIZING;
Finish0Rtt(true);
mState = INITIALIZING;
Finish0Rtt(true);
}
break;
case Http3Event::Tag::ConnectionConnected:
{
LOG(("Http3Session::ProcessEvents - ConnectionConnected"));
bool was0RTT = mState == ZERORTT;
mState = CONNECTED;
SetSecInfo();
mSocketControl->HandshakeCompleted();
if (was0RTT) {
Finish0Rtt(false);
}
nsTArray<uint8_t> token;
mHttp3Connection->GetResumptionToken(token);
if (!token.IsEmpty()) {
LOG(("Got a resumption token"));
nsAutoCString peerId;
mSocketControl->GetPeerId(peerId);
if (NS_FAILED(
// Bug 1660080 tto get the proper expiration time for a token.
SSLTokensCache::Put(peerId, token.Elements(), token.Length(), mSocketControl, 1))) {
LOG(("Adding resumption token failed"));
}
case Http3Event::Tag::ConnectionConnected: {
LOG(("Http3Session::ProcessEvents - ConnectionConnected"));
bool was0RTT = mState == ZERORTT;
mState = CONNECTED;
SetSecInfo();
mSocketControl->HandshakeCompleted();
if (was0RTT) {
Finish0Rtt(false);
}
nsTArray<uint8_t> token;
mHttp3Connection->GetResumptionToken(token);
if (!token.IsEmpty()) {
LOG(("Got a resumption token"));
nsAutoCString peerId;
mSocketControl->GetPeerId(peerId);
if (NS_FAILED(
// Bug 1660080 tto get the proper expiration time for a token.
SSLTokensCache::Put(peerId, token.Elements(), token.Length(),
mSocketControl, 1))) {
LOG(("Adding resumption token failed"));
}
}
ReportHttp3Connection();
}
break;
ReportHttp3Connection();
} break;
case Http3Event::Tag::GoawayReceived:
LOG(("Http3Session::ProcessEvents - GoawayReceived"));
MOZ_ASSERT(!mGoawayReceived);
@ -649,8 +648,8 @@ bool Http3Session::AddStream(nsAHttpTransaction* aHttpTransaction,
if (mState == ZERORTT) {
if (!stream->Do0RTT()) {
LOG(("Http3Session %p will not get early data from Http3Stream %p",
this, stream));
LOG(("Http3Session %p will not get early data from Http3Stream %p", this,
stream));
if (!mCannotDo0RTTStreams.Contains(stream)) {
mCannotDo0RTTStreams.AppendElement(stream);
}
@ -1334,8 +1333,7 @@ bool Http3Session::JoinConnection(const nsACString& hostname, int32_t port) {
bool Http3Session::RealJoinConnection(const nsACString& hostname, int32_t port,
bool justKidding) {
MOZ_ASSERT(OnSocketThread(), "not on socket thread");
if (!mConnection || !CanSandData() || mShouldClose ||
mGoawayReceived) {
if (!mConnection || !CanSandData() || mShouldClose || mGoawayReceived) {
return false;
}

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

@ -51,7 +51,9 @@ class Http3Session final : public nsAHttpTransaction,
HttpConnectionUDP* readerWriter);
bool IsConnected() const { return mState == CONNECTED; }
bool CanSandData() const { return (mState == CONNECTED) || (mState == ZERORTT); }
bool CanSandData() const {
return (mState == CONNECTED) || (mState == ZERORTT);
}
bool IsClosing() const { return (mState == CLOSING || mState == CLOSED); }
bool IsClosed() const { return mState == CLOSED; }

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

@ -44,6 +44,7 @@ class QuicSocketControl final : public CommonSocketControl {
void SetCertVerificationResult(PRErrorCode errorCode) override;
NS_IMETHOD GetPeerId(nsACString& aResult) override;
private:
~QuicSocketControl() = default;

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

@ -400,13 +400,13 @@ nsresult TRRServiceChannel::BeginConnect() {
RefPtr<AltSvcMapping> mapping;
if (!mConnectionInfo && mAllowAltSvc && // per channel
(http2Allowed || http3Allowed) &&
!(mLoadFlags & LOAD_FRESH_CONNECTION) &&
(http2Allowed || http3Allowed) && !(mLoadFlags & LOAD_FRESH_CONNECTION) &&
AltSvcMapping::AcceptableProxy(proxyInfo) &&
(scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) &&
(mapping = gHttpHandler->GetAltServiceMapping(
scheme, host, port, mPrivateBrowsing, IsIsolated(),
GetTopWindowOrigin(), OriginAttributes(), http2Allowed, http3Allowed))) {
GetTopWindowOrigin(), OriginAttributes(), http2Allowed,
http3Allowed))) {
LOG(("TRRServiceChannel %p Alt Service Mapping Found %s://%s:%d [%s]\n",
this, scheme.get(), mapping->AlternateHost().get(),
mapping->AlternatePort(), mapping->HashKey().get()));

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

@ -88,9 +88,7 @@ class NeqoHttp3Conn final {
neqo_http3conn_set_resumption_token(this, &aToken);
}
bool IsZeroRtt() {
return neqo_http3conn_is_zero_rtt(this);
}
bool IsZeroRtt() { return neqo_http3conn_is_zero_rtt(this); }
nsrefcnt AddRef() { return neqo_http3conn_addref(this); }
nsrefcnt Release() { return neqo_http3conn_release(this); }

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

@ -36,7 +36,6 @@ void AssertRoundTrips(const nsHttpResponseHead& aHead) {
}
}
TEST(TestHttpResponseHead, Bug1636930)
{
// Only create atom table when it's not already created.
@ -79,7 +78,8 @@ TEST(TestHttpResponseHead, bug1649807)
Unused << head.ParseHeaderLine("pragma: no-cache"_ns);
Unused << head.ParseHeaderLine("date: Tue, 12 May 2020 09:24:23 GMT"_ns);
ASSERT_FALSE(head.NoCache()) << "Cache-Control wins over Pragma: no-cache";
ASSERT_FALSE(head.NoCache())
<< "Cache-Control wins over Pragma: no-cache";
AssertRoundTrips(head);
}

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

@ -151,7 +151,7 @@ inline NS_HIDDEN_(void)
bool aAlwaysProxy = false) {
RefPtr<T> doomed = aDoomed;
if (!doomed) {
return; // Nothing to do.
return; // Nothing to do.
}
// NS_ProxyRelease treats a null event target as "the current thread". So a