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 удалений

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

@ -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 (); \
isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && \
StaticPrefs::general_smoothScroll_##prefbase(); \
if (isOriginSmoothnessEnabled) { \
minMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMinMS(); \
maxMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMaxMS(); \
minMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMinMS(); \
maxMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMaxMS(); \
}
switch (aOrigin) {

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

@ -216,8 +216,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
static bool Read(const Message* aMsg, PickleIterator* aIter,
paramType* aResult) {
return (
ReadParam(aMsg, aIter, &aResult->mScrollId) &&
return (ReadParam(aMsg, aIter, &aResult->mScrollId) &&
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
ReadParam(aMsg, aIter, &aResult->mCompositionBounds) &&
ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&

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

@ -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;

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

@ -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(

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

@ -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);

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

@ -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,7 +143,8 @@ nsresult Http3Session::Init(const nsACString& aOrigin,
gHttpHandler->DefaultQpackTableSize(),
gHttpHandler->DefaultHttp3MaxBlockedStreams(), this));
nsresult rv = NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr,
nsresult rv =
NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr,
gHttpHandler->DefaultQpackTableSize(),
gHttpHandler->DefaultHttp3MaxBlockedStreams(),
getter_AddRefs(mHttp3Connection));
@ -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;
@ -442,8 +442,7 @@ nsresult Http3Session::ProcessEvents(uint32_t count) {
Finish0Rtt(true);
}
break;
case Http3Event::Tag::ConnectionConnected:
{
case Http3Event::Tag::ConnectionConnected: {
LOG(("Http3Session::ProcessEvents - ConnectionConnected"));
bool was0RTT = mState == ZERORTT;
mState = CONNECTED;
@ -460,14 +459,14 @@ nsresult Http3Session::ProcessEvents(uint32_t count) {
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))) {
SSLTokensCache::Put(peerId, token.Elements(), token.Length(),
mSocketControl, 1))) {
LOG(("Adding resumption token failed"));
}
}
ReportHttp3Connection();
}
break;
} 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);
}