зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1519636 - Reformat recent changes to the Google coding style r=necko-reviewers,valentin
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA) # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D106920
This commit is contained in:
Родитель
4d02027b4d
Коммит
4edd85cc9b
|
@ -39,7 +39,7 @@
|
|||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
#define NOTIFY_PRESSHELL(notify_) \
|
||||
#define NOTIFY_PRESSHELL(notify_) \
|
||||
if (PresShell* presShell = doc->GetObservingPresShell()) { \
|
||||
notify_(presShell); \
|
||||
}
|
||||
|
|
|
@ -2115,8 +2115,7 @@ void HTMLMediaElement::SetDecodeError(const nsAString& aError,
|
|||
{"NS_ERROR_DOM_MEDIA_DEMUXER_ERR", NS_ERROR_DOM_MEDIA_DEMUXER_ERR},
|
||||
{"NS_ERROR_DOM_MEDIA_CDM_ERR", NS_ERROR_DOM_MEDIA_CDM_ERR},
|
||||
{"NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR",
|
||||
NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR}
|
||||
};
|
||||
NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR}};
|
||||
for (auto& error : kSupportedErrorList) {
|
||||
if (strcmp(error.mName, NS_ConvertUTF16toUTF8(aError).get()) == 0) {
|
||||
DecoderDoctorDiagnostics diagnostics;
|
||||
|
|
|
@ -1243,8 +1243,8 @@ EventStates HTMLSelectElement::IntrinsicState() const {
|
|||
// 3. The element has already been modified or the user tried to submit the
|
||||
// form owner while invalid.
|
||||
if (mCanShowValidUI && ShouldShowValidityUI() &&
|
||||
(IsValid() || (state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
|
||||
!mCanShowInvalidUI))) {
|
||||
(IsValid() || (state.HasState(NS_EVENT_STATE_MOZ_UI_INVALID) &&
|
||||
!mCanShowInvalidUI))) {
|
||||
state |= NS_EVENT_STATE_MOZ_UI_VALID;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -666,11 +666,11 @@ TEST(Jemalloc, GuardRegion)
|
|||
jemalloc_stats_t stats;
|
||||
jemalloc_stats(&stats);
|
||||
|
||||
# ifdef HAS_GDB_SLEEP_DURATION
|
||||
#ifdef HAS_GDB_SLEEP_DURATION
|
||||
// Avoid death tests adding some unnecessary (long) delays.
|
||||
unsigned int old_gdb_sleep_duration = _gdb_sleep_duration;
|
||||
_gdb_sleep_duration = 0;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
arena_id_t arena = moz_create_arena();
|
||||
ASSERT_TRUE(arena != 0);
|
||||
|
@ -703,9 +703,9 @@ TEST(Jemalloc, GuardRegion)
|
|||
|
||||
moz_dispose_arena(arena);
|
||||
|
||||
# ifdef HAS_GDB_SLEEP_DURATION
|
||||
#ifdef HAS_GDB_SLEEP_DURATION
|
||||
_gdb_sleep_duration = old_gdb_sleep_duration;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(Jemalloc, DisposeArena)
|
||||
|
@ -713,11 +713,11 @@ TEST(Jemalloc, DisposeArena)
|
|||
jemalloc_stats_t stats;
|
||||
jemalloc_stats(&stats);
|
||||
|
||||
# ifdef HAS_GDB_SLEEP_DURATION
|
||||
#ifdef HAS_GDB_SLEEP_DURATION
|
||||
// Avoid death tests adding some unnecessary (long) delays.
|
||||
unsigned int old_gdb_sleep_duration = _gdb_sleep_duration;
|
||||
_gdb_sleep_duration = 0;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
arena_id_t arena = moz_create_arena();
|
||||
void* ptr = moz_arena_malloc(arena, 42);
|
||||
|
@ -735,12 +735,12 @@ TEST(Jemalloc, DisposeArena)
|
|||
|
||||
arena = moz_create_arena();
|
||||
ptr = moz_arena_malloc(arena, stats.chunksize * 2);
|
||||
# ifdef MOZ_DEBUG
|
||||
#ifdef MOZ_DEBUG
|
||||
// On debug builds, we do the expensive check that arenas are empty.
|
||||
ASSERT_DEATH_WRAP(moz_dispose_arena(arena), "");
|
||||
moz_arena_free(arena, ptr);
|
||||
moz_dispose_arena(arena);
|
||||
# else
|
||||
#else
|
||||
// Currently, the allocator can't trivially check whether the arena is empty
|
||||
// of huge allocations, so disposing of it works.
|
||||
moz_dispose_arena(arena);
|
||||
|
@ -748,12 +748,12 @@ TEST(Jemalloc, DisposeArena)
|
|||
ASSERT_DEATH_WRAP(free(ptr), "");
|
||||
// Likewise for realloc
|
||||
ASSERT_DEATH_WRAP(ptr = realloc(ptr, stats.chunksize * 3), "");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Using the arena after it's been disposed of is MOZ_CRASH-worthy.
|
||||
ASSERT_DEATH_WRAP(moz_arena_malloc(arena, 42), "");
|
||||
|
||||
# ifdef HAS_GDB_SLEEP_DURATION
|
||||
#ifdef HAS_GDB_SLEEP_DURATION
|
||||
_gdb_sleep_duration = old_gdb_sleep_duration;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -214,8 +214,8 @@ nsresult DnsAndConnectSocket::SetupDnsFlags() {
|
|||
mBackupTransport.mDnsFlags |= nsISocketTransport::DISABLE_IPV6;
|
||||
}
|
||||
NS_ASSERTION(
|
||||
!( mBackupTransport.mDnsFlags & nsIDNSService::RESOLVE_DISABLE_IPV6) ||
|
||||
!( mBackupTransport.mDnsFlags & nsIDNSService::RESOLVE_DISABLE_IPV4),
|
||||
!(mBackupTransport.mDnsFlags & nsIDNSService::RESOLVE_DISABLE_IPV6) ||
|
||||
!(mBackupTransport.mDnsFlags & nsIDNSService::RESOLVE_DISABLE_IPV4),
|
||||
"Setting both RESOLVE_DISABLE_IPV6 and RESOLVE_DISABLE_IPV4");
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -488,8 +488,7 @@ nsresult Http3Session::ProcessEvents() {
|
|||
break;
|
||||
case Http3Event::Tag::ResumptionToken: {
|
||||
LOG(("Http3Session::ProcessEvents - ResumptionToken"));
|
||||
if (StaticPrefs::network_http_http3_enable_0rtt() &&
|
||||
!data.IsEmpty()) {
|
||||
if (StaticPrefs::network_http_http3_enable_0rtt() && !data.IsEmpty()) {
|
||||
LOG(("Got a resumption token"));
|
||||
nsAutoCString peerId;
|
||||
mSocketControl->GetPeerId(peerId);
|
||||
|
@ -588,7 +587,8 @@ nsresult Http3Session::ProcessOutput(nsIUDPSocket* socket) {
|
|||
break;
|
||||
}
|
||||
MOZ_ASSERT(packetToSend.Length());
|
||||
LOG(("Http3Session::ProcessOutput sending packet with %u bytes to %s "
|
||||
LOG(
|
||||
("Http3Session::ProcessOutput sending packet with %u bytes to %s "
|
||||
"port=%d [this=%p].",
|
||||
(uint32_t)packetToSend.Length(),
|
||||
PromiseFlatCString(remoteAddrStr).get(), port, this));
|
||||
|
|
|
@ -138,7 +138,6 @@ class HttpConnectionBase : public nsSupportsWeakReference {
|
|||
virtual bool GetEchConfigUsed() = 0;
|
||||
|
||||
protected:
|
||||
|
||||
// The capabailities associated with the most recent transaction
|
||||
uint32_t mTransactionCaps;
|
||||
|
||||
|
|
|
@ -670,9 +670,7 @@ nsresult HttpConnectionUDP::GetPeerAddr(NetAddr* addr) {
|
|||
}
|
||||
}
|
||||
|
||||
bool HttpConnectionUDP::ResolvedByTRR() {
|
||||
return mResolvedByTRR;
|
||||
}
|
||||
bool HttpConnectionUDP::ResolvedByTRR() { return mResolvedByTRR; }
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -116,6 +116,7 @@ class HttpConnectionUDP final : public HttpConnectionBase,
|
|||
nsCOMPtr<nsINetAddr> mSelfAddr;
|
||||
nsCOMPtr<nsINetAddr> mPeerAddr;
|
||||
bool mResolvedByTRR = false;
|
||||
|
||||
private:
|
||||
// Http3
|
||||
RefPtr<Http3Session> mHttp3Session;
|
||||
|
|
|
@ -257,7 +257,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpConnection, NS_AHTTPCONNECTION_IID)
|
|||
} \
|
||||
bool GetEchConfigUsed() override { \
|
||||
return (!fwdObject) ? false : (fwdObject)->GetEchConfigUsed(); \
|
||||
} \
|
||||
}
|
||||
|
||||
// ThrottleResponse deliberately ommited since we want different implementation
|
||||
// for h1 and h2 connections.
|
||||
|
|
|
@ -141,7 +141,6 @@ void nsNetworkLinkService::GetDnsSuffixListInternal() {
|
|||
[self]() { self->NotifyObservers(NS_DNS_SUFFIX_LIST_UPDATED_TOPIC, nullptr); }));
|
||||
});
|
||||
|
||||
|
||||
nsTArray<nsCString> result;
|
||||
|
||||
struct __res_state res;
|
||||
|
@ -676,13 +675,14 @@ void nsNetworkLinkService::DNSConfigChanged(uint32_t aDelayMs) {
|
|||
return;
|
||||
}
|
||||
if (aDelayMs) {
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
target->DelayedDispatch(NS_NewRunnableFunction("nsNetworkLinkService::GetDnsSuffixListInternal",
|
||||
[self = RefPtr{this}]() { self->GetDnsSuffixListInternal(); }), aDelayMs));
|
||||
MOZ_ALWAYS_SUCCEEDS(target->DelayedDispatch(
|
||||
NS_NewRunnableFunction("nsNetworkLinkService::GetDnsSuffixListInternal",
|
||||
[self = RefPtr{this}]() { self->GetDnsSuffixListInternal(); }),
|
||||
aDelayMs));
|
||||
} else {
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
target->Dispatch(NS_NewRunnableFunction("nsNetworkLinkService::GetDnsSuffixListInternal",
|
||||
[self = RefPtr{this}]() { self->GetDnsSuffixListInternal(); })));
|
||||
MOZ_ALWAYS_SUCCEEDS(target->Dispatch(
|
||||
NS_NewRunnableFunction("nsNetworkLinkService::GetDnsSuffixListInternal",
|
||||
[self = RefPtr{this}]() { self->GetDnsSuffixListInternal(); })));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -983,9 +983,9 @@ void nsNativeBasicTheme::PaintMenulistArrowButton(nsIFrame* aFrame,
|
|||
DrawTarget& aDrawTarget,
|
||||
const LayoutDeviceRect& aRect,
|
||||
const EventStates& aState) {
|
||||
const float kPolygonX[] = {-4.0f, -0.5f, 0.5f, 4.0f, 4.0f,
|
||||
const float kPolygonX[] = {-4.0f, -0.5f, 0.5f, 4.0f, 4.0f,
|
||||
3.0f, 0.0f, 0.0f, -3.0f, -4.0f};
|
||||
const float kPolygonY[] = {-1, 3.0f, 3.0f, -1.0f, -2.0f,
|
||||
const float kPolygonY[] = {-1, 3.0f, 3.0f, -1.0f, -2.0f,
|
||||
-2.0f, 1.5f, 1.5f, -2.0f, -2.0f};
|
||||
|
||||
const float kPolygonSize = kMinimumDropdownArrowButtonWidth;
|
||||
|
@ -1006,7 +1006,7 @@ void nsNativeBasicTheme::PaintSpinnerButton(nsIFrame* aFrame,
|
|||
aDrawTarget.FillRect(aRect.ToUnknownRect(),
|
||||
ColorPattern(ToDeviceColor(backgroundColor)));
|
||||
|
||||
const float kPolygonX[] = {-3.5f, -0.5f, 0.5f, 3.5f, 3.5f,
|
||||
const float kPolygonX[] = {-3.5f, -0.5f, 0.5f, 3.5f, 3.5f,
|
||||
2.5f, 0.0f, 0.0f, -2.5f, -3.5f};
|
||||
float polygonY[] = {-1.5f, 1.5f, 1.5f, -1.5f, -2.5f,
|
||||
-2.5f, 0.0f, 0.0f, -2.5f, -2.5f};
|
||||
|
|
Загрузка…
Ссылка в новой задаче