Bug 1060419 - make log_print use Printf.h, r=froydnj

MozReview-Commit-ID: BIZ1GQEZ1vs
This commit is contained in:
Tom Tromey
2016-12-15 20:16:31 -07:00
parent c8c2308188
commit a4b717ab39
216 changed files with 1550 additions and 1236 deletions

View File

@@ -152,7 +152,7 @@ public:
// but multiply by 1.5 instead of 2 to be more gradual.
mNextDelay = static_cast<uint32_t>(
std::min<double>(kWSReconnectMaxDelay, mNextDelay * 1.5));
LOG(("WebSocket: FailedAgain: host=%s, port=%d: incremented delay to %lu",
LOG(("WebSocket: FailedAgain: host=%s, port=%d: incremented delay to %" PRIu32,
mAddress.get(), mPort, mNextDelay));
}
@@ -405,8 +405,8 @@ public:
// w/o ever successfully creating a connection)
static void OnStopSession(WebSocketChannel *aChannel, nsresult aReason)
{
LOG(("Websocket: OnStopSession: [this=%p, reason=0x%08x]", aChannel,
aReason));
LOG(("Websocket: OnStopSession: [this=%p, reason=0x%08" PRIx32 "]", aChannel,
static_cast<uint32_t>(aReason)));
StaticMutexAutoLock lock(sLock);
if (!sManager) {
@@ -605,7 +605,7 @@ public:
}
if (NS_FAILED(rv)) {
LOG(("OnMessageAvailable or OnBinaryMessageAvailable "
"failed with 0x%08x", rv));
"failed with 0x%08" PRIx32, static_cast<uint32_t>(rv)));
}
}
@@ -646,7 +646,7 @@ public:
nsresult rv = mListenerMT->mListener->OnStop(mListenerMT->mContext, mReason);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::CallOnStop "
"OnStop failed (%08x)\n", rv));
"OnStop failed (%08" PRIx32 ")\n", static_cast<uint32_t>(rv)));
}
mChannel->mListenerMT = nullptr;
}
@@ -690,7 +690,7 @@ public:
mReason);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::CallOnServerClose "
"OnServerClose failed (%08x)\n", rv));
"OnServerClose failed (%08" PRIx32 ")\n", static_cast<uint32_t>(rv)));
}
}
return NS_OK;
@@ -727,7 +727,8 @@ public:
if (mListenerMT) {
nsresult rv = mListenerMT->mListener->OnAcknowledge(mListenerMT->mContext, mSize);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::CallAcknowledge: Acknowledge failed (%08x)\n", rv));
LOG(("WebSocketChannel::CallAcknowledge: Acknowledge failed (%08" PRIx32 ")\n",
static_cast<uint32_t>(rv)));
}
}
return NS_OK;
@@ -1089,7 +1090,7 @@ public:
rv = aCompressor->Deflate(BeginReading(), mLength, *temp);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::OutboundMessage: Deflating payload failed "
"[rv=0x%08x]\n", rv));
"[rv=0x%08" PRIx32 "]\n", static_cast<uint32_t>(rv)));
return false;
}
@@ -1271,7 +1272,8 @@ WebSocketChannel::Observe(nsISupports *subject,
} else {
nsresult rv = OnNetworkChanged();
if (NS_FAILED(rv)) {
LOG(("WebSocket: OnNetworkChanged failed (%08x)", rv));
LOG(("WebSocket: OnNetworkChanged failed (%08" PRIx32 ")",
static_cast<uint32_t>(rv)));
}
}
}
@@ -1569,7 +1571,7 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
payload = mFramePtr + framingLength;
avail -= framingLength;
LOG(("WebSocketChannel::ProcessInput: payload %lld avail %lu\n",
LOG(("WebSocketChannel::ProcessInput: payload %" PRId64 " avail %" PRIu32 "\n",
payloadLength64, avail));
CheckedInt<int64_t> payloadLengthChecked(payloadLength64);
@@ -1644,7 +1646,7 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
return NS_ERROR_ILLEGAL_VALUE;
}
LOG(("WebSocketChannel:: Accumulating Fragment %ld\n", payloadLength));
LOG(("WebSocketChannel:: Accumulating Fragment %" PRIu32 "\n", payloadLength));
if (opcode == nsIWebSocketFrame::OPCODE_CONTINUATION) {
@@ -2191,7 +2193,7 @@ WebSocketChannel::PrimeNewOutgoingMessage()
&buffer);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::PrimeNewOutgoingMessage(): "
"GenerateRandomBytes failure %x\n", rv));
"GenerateRandomBytes failure %" PRIx32 "\n", static_cast<uint32_t>(rv)));
StopSession(rv);
return;
}
@@ -2342,7 +2344,8 @@ WebSocketChannel::CleanupConnection()
void
WebSocketChannel::StopSession(nsresult reason)
{
LOG(("WebSocketChannel::StopSession() %p [%x]\n", this, reason));
LOG(("WebSocketChannel::StopSession() %p [%" PRIx32 "]\n",
this, static_cast<uint32_t>(reason)));
// normally this should be called on socket thread, but it is ok to call it
// from OnStartRequest before the socket thread machine has gotten underway
@@ -2447,8 +2450,8 @@ WebSocketChannel::StopSession(nsresult reason)
void
WebSocketChannel::AbortSession(nsresult reason)
{
LOG(("WebSocketChannel::AbortSession() %p [reason %x] stopped = %d\n",
this, reason, !!mStopped));
LOG(("WebSocketChannel::AbortSession() %p [reason %" PRIx32 "] stopped = %d\n",
this, static_cast<uint32_t>(reason), !!mStopped));
// normally this should be called on socket thread, but it is ok to call it
// from the main thread before StartWebsocketData() has completed
@@ -2927,7 +2930,7 @@ WebSocketChannel::StartWebsocketData()
rv = mSocketIn->AsyncWait(this, 0, 0, mSocketThread);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::StartWebsocketData mSocketIn->AsyncWait() failed "
"with error 0x%08x", rv));
"with error 0x%08" PRIx32, static_cast<uint32_t>(rv)));
return mSocketThread->Dispatch(
NewRunnableMethod<nsresult>(this,
&WebSocketChannel::AbortSession,
@@ -2941,7 +2944,7 @@ WebSocketChannel::StartWebsocketData()
NS_DISPATCH_NORMAL);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::StartWebsocketData Could not start pinging, "
"rv=0x%08x", rv));
"rv=0x%08" PRIx32, static_cast<uint32_t>(rv)));
return rv;
}
}
@@ -2953,7 +2956,8 @@ WebSocketChannel::StartWebsocketData()
rv = mListenerMT->mListener->OnStart(mListenerMT->mContext);
if (NS_FAILED(rv)) {
LOG(("WebSocketChannel::StartWebsocketData "
"mListenerMT->mListener->OnStart() failed with error 0x%08x", rv));
"mListenerMT->mListener->OnStart() failed with error 0x%08" PRIx32,
static_cast<uint32_t>(rv)));
}
}
@@ -3019,8 +3023,8 @@ WebSocketChannel::OnLookupComplete(nsICancelable *aRequest,
nsIDNSRecord *aRecord,
nsresult aStatus)
{
LOG(("WebSocketChannel::OnLookupComplete() %p [%p %p %x]\n",
this, aRequest, aRecord, aStatus));
LOG(("WebSocketChannel::OnLookupComplete() %p [%p %p %" PRIx32 "]\n",
this, aRequest, aRecord, static_cast<uint32_t>(aStatus)));
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
@@ -3888,8 +3892,8 @@ WebSocketChannel::OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aStatusCode)
{
LOG(("WebSocketChannel::OnStopRequest() %p [%p %p %x]\n",
this, aRequest, mHttpChannel.get(), aStatusCode));
LOG(("WebSocketChannel::OnStopRequest() %p [%p %p %" PRIx32 "]\n",
this, aRequest, mHttpChannel.get(), static_cast<uint32_t>(aStatusCode)));
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
ReportConnectionTelemetry();
@@ -3923,7 +3927,8 @@ WebSocketChannel::OnInputStreamReady(nsIAsyncInputStream *aStream)
do {
rv = mSocketIn->Read((char *)buffer, 2048, &count);
LOG(("WebSocketChannel::OnInputStreamReady: read %u rv %x\n", count, rv));
LOG(("WebSocketChannel::OnInputStreamReady: read %u rv %" PRIx32 "\n",
count, static_cast<uint32_t>(rv)));
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
mSocketIn->AsyncWait(this, 0, 0, mSocketThread);
@@ -3992,8 +3997,8 @@ WebSocketChannel::OnOutputStreamReady(nsIAsyncOutputStream *aStream)
amtSent = 0;
} else {
rv = mSocketOut->Write(sndBuf, toSend, &amtSent);
LOG(("WebSocketChannel::OnOutputStreamReady: write %u rv %x\n",
amtSent, rv));
LOG(("WebSocketChannel::OnOutputStreamReady: write %u rv %" PRIx32 "\n",
amtSent, static_cast<uint32_t>(rv)));
if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
mSocketOut->AsyncWait(this, 0, 0, mSocketThread);
@@ -4045,7 +4050,7 @@ WebSocketChannel::OnDataAvailable(nsIRequest *aRequest,
uint64_t aOffset,
uint32_t aCount)
{
LOG(("WebSocketChannel::OnDataAvailable() %p [%p %p %p %llu %u]\n",
LOG(("WebSocketChannel::OnDataAvailable() %p [%p %p %p %" PRIu64 " %u]\n",
this, aRequest, mHttpChannel.get(), aInputStream, aOffset, aCount));
// This is the HTTP OnDataAvailable Method, which means this is http data in