Commit a3889aa7 authored by morrita's avatar morrita Committed by Commit bot

ChannelMojo: Turn DLOG to LOG for ERROR and WARNING

It'd be useful to diagnose IPC related issues, especially
Chrome OS builds where Release build is the norm.
This shouldn't be noisy as these won't happen in normal use.

R=viettrungluu@chromium.org
TEST=466814
BUG=

Review URL: https://codereview.chromium.org/1003483004

Cr-Commit-Position: refs/heads/master@{#320810}
parent e0f2b8f0
......@@ -141,7 +141,7 @@ void ServerChannelMojo::OnPipeAvailable(
MojoResult create_result =
mojo::CreateMessagePipe(nullptr, &message_pipe_, &peer);
if (create_result != MOJO_RESULT_OK) {
DLOG(WARNING) << "mojo::CreateMessagePipe failed: " << create_result;
LOG(WARNING) << "mojo::CreateMessagePipe failed: " << create_result;
listener()->OnChannelError();
return;
}
......@@ -392,8 +392,8 @@ MojoResult ChannelMojo::ReadFromMessageAttachmentSet(
mojo::embedder::PlatformHandle(file.release())),
&wrapped_handle);
if (MOJO_RESULT_OK != wrap_result) {
DLOG(WARNING) << "Pipe failed to wrap handles. Closing: "
<< wrap_result;
LOG(WARNING) << "Pipe failed to wrap handles. Closing: "
<< wrap_result;
set->CommitAll();
return wrap_result;
}
......@@ -429,7 +429,7 @@ MojoResult ChannelMojo::WriteToMessageAttachmentSet(
mojo::MakeScopedHandle(mojo::Handle(handle_buffer[i]))));
DCHECK(ok);
if (!ok) {
DLOG(ERROR) << "Failed to add new Mojo handle.";
LOG(ERROR) << "Failed to add new Mojo handle.";
return MOJO_RESULT_UNKNOWN;
}
}
......
......@@ -168,7 +168,7 @@ void MessagePipeReader::ReadMessagesThenWait() {
// We have to consume then and retry in that case.
if (result != MOJO_RESULT_ALREADY_EXISTS) {
if (result != MOJO_RESULT_OK) {
DLOG(ERROR) << "Result is " << result;
LOG(ERROR) << "Failed to wait on the pipe. Result is " << result;
OnPipeError(result);
Close();
}
......@@ -183,7 +183,7 @@ void MessagePipeReader::PipeIsReady(MojoResult wait_result) {
if (wait_result != MOJO_RESULT_ABORTED) {
// FAILED_PRECONDITION happens every time the peer is dead so
// it isn't worth polluting the log message.
DLOG_IF(WARNING, wait_result != MOJO_RESULT_FAILED_PRECONDITION)
LOG_IF(WARNING, wait_result != MOJO_RESULT_FAILED_PRECONDITION)
<< "Pipe got error from the waiter. Closing: " << wait_result;
OnPipeError(wait_result);
}
......
......@@ -61,7 +61,7 @@ void MojoServerBootstrap::SendClientPipe() {
// GetFileHandleForProcess() only fails on Windows.
NOTREACHED();
#endif
DLOG(WARNING) << "Failed to translate file handle for client process.";
LOG(WARNING) << "Failed to translate file handle for client process.";
Fail();
return;
}
......@@ -143,7 +143,7 @@ bool MojoClientBootstrap::OnMessageReceived(const Message& message) {
PlatformFileForTransit pipe;
PickleIterator iter(message);
if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) {
DLOG(WARNING) << "Failed to read a file handle from bootstrap channel.";
LOG(WARNING) << "Failed to read a file handle from bootstrap channel.";
message.set_dispatch_error();
return false;
}
......
......@@ -27,7 +27,7 @@ base::PlatformFile MojoHandleAttachment::TakePlatformFile() {
MojoResult unwrap_result = mojo::embedder::PassWrappedPlatformHandle(
handle_.release().value(), &platform_handle);
if (unwrap_result != MOJO_RESULT_OK) {
DLOG(ERROR) << "Pipe failed to covert handles. Closing: " << unwrap_result;
LOG(ERROR) << "Pipe failed to covert handles. Closing: " << unwrap_result;
return -1;
}
......
......@@ -24,12 +24,12 @@ bool MojoMessageHelper::ReadMessagePipeFrom(
mojo::ScopedMessagePipeHandle* handle) {
scoped_refptr<MessageAttachment> attachment;
if (!message->ReadAttachment(iter, &attachment)) {
DLOG(ERROR) << "Failed to read attachment for message pipe.";
LOG(ERROR) << "Failed to read attachment for message pipe.";
return false;
}
if (attachment->GetType() != MessageAttachment::TYPE_MOJO_HANDLE) {
DLOG(ERROR) << "Unxpected attachment type:" << attachment->GetType();
LOG(ERROR) << "Unxpected attachment type:" << attachment->GetType();
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment