Backed out 4 changesets (bug 1638925) for build bustages at ipc_channel_posix.cc. CLOSED TREE

Backed out changeset e0fe5351fdf7 (bug 1638925)
Backed out changeset 2c8b67413cd6 (bug 1638925)
Backed out changeset 4ea2c9ceb540 (bug 1638925)
Backed out changeset 84236f1b9064 (bug 1638925)
This commit is contained in:
Brindusan Cristian 2020-06-17 20:28:41 +03:00
parent 0c2287c77b
commit 35fe5d64b2
8 changed files with 3 additions and 93 deletions

View File

@ -36,7 +36,6 @@
#endif
#include "MessagePump.h"
#include "nsThreadUtils.h"
using base::Time;
using base::TimeDelta;
@ -357,7 +356,6 @@ void MessageLoop::PostIdleTask(already_AddRefed<nsIRunnable> task) {
MOZ_ASSERT(NS_IsMainThread());
PendingTask pending_task(std::move(task), false);
mozilla::LogRunnable::LogDispatch(pending_task.task.get());
deferred_non_nestable_work_queue_.push(std::move(pending_task));
}
@ -404,7 +402,6 @@ void MessageLoop::PostTask_Helper(already_AddRefed<nsIRunnable> task,
RefPtr<base::MessagePump> pump;
{
mozilla::MutexAutoLock locked(incoming_queue_lock_);
mozilla::LogRunnable::LogDispatch(pending_task.task.get());
incoming_queue_.push(std::move(pending_task));
pump = pump_;
}
@ -442,8 +439,6 @@ void MessageLoop::RunTask(already_AddRefed<nsIRunnable> aTask) {
nestable_tasks_allowed_ = false;
nsCOMPtr<nsIRunnable> task = aTask;
mozilla::LogRunnable::Run log(task.get());
task->Run();
task = nullptr;
@ -460,7 +455,6 @@ bool MessageLoop::DeferOrRunPendingTask(PendingTask&& pending_task) {
// We couldn't run the task now because we're in a nested message loop
// and the task isn't nestable.
mozilla::LogRunnable::LogDispatch(pending_task.task.get());
deferred_non_nestable_work_queue_.push(std::move(pending_task));
return false;
}
@ -472,7 +466,6 @@ void MessageLoop::AddToDelayedWorkQueue(const PendingTask& pending_task) {
// delayed_run_time value.
PendingTask new_pending_task(pending_task);
new_pending_task.sequence_num = next_sequence_num_++;
mozilla::LogRunnable::LogDispatch(new_pending_task.task.get());
delayed_work_queue_.push(std::move(new_pending_task));
}

View File

@ -566,8 +566,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {
if (m.routing_id() == MSG_ROUTING_NONE &&
m.type() == HELLO_MESSAGE_TYPE) {
// The Hello message contains only the process id.
other_pid_ = MessageIterator(m).NextInt();
listener_->OnChannelConnected(other_pid_);
listener_->OnChannelConnected(MessageIterator(m).NextInt());
#if defined(OS_MACOSX)
} else if (m.routing_id() == MSG_ROUTING_NONE &&
m.type() == RECEIVED_FDS_MESSAGE_TYPE) {
@ -575,7 +574,6 @@ bool Channel::ChannelImpl::ProcessIncomingMessages() {
CloseDescriptors(m.fd_cookie());
#endif
} else {
mozilla::LogIPCMessage::Run run(&m);
listener_->OnMessageReceived(std::move(m));
}
@ -862,8 +860,6 @@ void Channel::ChannelImpl::OutputQueuePush(mozilla::UniquePtr<Message> msg) {
msg->AssertAsLargeAsHeader();
output_queue_.push(std::move(msg));
output_queue_length_++;
mozilla::LogIPCMessage::LogDispatchWithPid(msg, other_pid_);
}
void Channel::ChannelImpl::OutputQueuePop() {

View File

@ -143,10 +143,6 @@ class Channel::ChannelImpl : public MessageLoopForIO::Watcher {
// This flag is set after we've closed the channel.
bool closed_;
// We keep track of the PID of the other side of this channel so that we can
// record this when generating logs of IPC messages.
int32_t other_pid_ = -1;
#if defined(OS_MACOSX)
struct PendingDescriptors {
uint32_t id;

View File

@ -18,7 +18,6 @@
#include "chrome/common/ipc_message_utils.h"
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/LateWriteChecks.h"
#include "nsThreadUtils.h"
#ifdef FUZZING
# include "mozilla/ipc/Faulty.h"
@ -106,8 +105,6 @@ void Channel::ChannelImpl::Init(Mode mode, Listener* listener) {
void Channel::ChannelImpl::OutputQueuePush(mozilla::UniquePtr<Message> msg) {
output_queue_.push(std::move(msg));
output_queue_length_++;
mozilla::LogIPCMessage::LogDispatchWithPid(msg, other_pid_);
}
void Channel::ChannelImpl::OutputQueuePop() {
@ -431,7 +428,7 @@ bool Channel::ChannelImpl::ProcessIncomingMessages(
// The Hello message contains the process id and must include the
// shared secret, if we are waiting for it.
MessageIterator it = MessageIterator(m);
other_pid_ = it.NextInt();
int32_t claimed_pid = it.NextInt();
if (waiting_for_shared_secret_ && (it.NextInt() != shared_secret_)) {
NOTREACHED();
// Something went wrong. Abort connection.
@ -440,9 +437,8 @@ bool Channel::ChannelImpl::ProcessIncomingMessages(
return false;
}
waiting_for_shared_secret_ = false;
listener_->OnChannelConnected(other_pid_);
listener_->OnChannelConnected(claimed_pid);
} else {
mozilla::LogIPCMessage::Run run(&m);
listener_->OnMessageReceived(std::move(m));
}

View File

@ -112,10 +112,6 @@ class Channel::ChannelImpl : public MessageLoopForIO::IOHandler {
// This flag is set after Close() is run on the channel.
bool closed_;
// We keep track of the PID of the other side of this channel so that we can
// record this when generating logs of IPC messages.
int32_t other_pid_ = -1;
// This variable is updated so it matches output_queue_.size(), except we can
// read output_queue_length_ from any thread (if we're OK getting an
// occasional out-of-date or bogus value). We use output_queue_length_ to

View File

@ -559,8 +559,6 @@ void CycleCollectedJSContext::DispatchToMicroTask(
MOZ_ASSERT(runnable);
JS::JobQueueMayNotBeEmpty(Context());
LogMicroTaskRunnable::LogDispatch(runnable.get());
mPendingMicroTaskRunnables.push(std::move(runnable));
}
@ -639,10 +637,7 @@ bool CycleCollectedJSContext::PerformMicroTaskCheckPoint(bool aForce) {
JS::JobQueueIsEmpty(Context());
}
didProcess = true;
LogMicroTaskRunnable::Run log(runnable.get());
runnable->Run(aso);
runnable = nullptr;
}
}
@ -675,8 +670,6 @@ void CycleCollectedJSContext::PerformDebuggerMicroTaskCheckpoint() {
RefPtr<MicroTaskRunnable> runnable = std::move(microtaskQueue->front());
MOZ_ASSERT(runnable);
LogMicroTaskRunnable::Run log(runnable.get());
// This function can re-enter, so we remove the element before calling.
microtaskQueue->pop();
@ -684,7 +677,6 @@ void CycleCollectedJSContext::PerformDebuggerMicroTaskCheckpoint() {
JS::JobQueueIsEmpty(Context());
}
runnable->Run(aso);
runnable = nullptr;
}
AfterProcessMicrotasks();

View File

@ -6,7 +6,6 @@
#include "nsThreadUtils.h"
#include "chrome/common/ipc_message.h" // for IPC::Message
#include "LeakRefPtr.h"
#include "mozilla/Attributes.h"
#include "mozilla/Likely.h"
@ -40,8 +39,6 @@ static LazyLogModule sEventDispatchAndRunLog("events");
#endif
#define LOG1(args) \
MOZ_LOG(sEventDispatchAndRunLog, mozilla::LogLevel::Error, args)
#define LOG1_ENABLED() \
MOZ_LOG_TEST(sEventDispatchAndRunLog, mozilla::LogLevel::Error)
using namespace mozilla;
@ -616,52 +613,18 @@ void LogTaskBase<T>::LogDispatch(T* aEvent) {
LOG1(("DISP %p", aEvent));
}
template <>
void LogTaskBase<IPC::Message>::LogDispatchWithPid(IPC::Message* aEvent,
int32_t aPid) {
if (aEvent->seqno() && aPid > 0) {
LOG1(("SEND %p %d %d", aEvent, aEvent->seqno(), aPid));
}
}
template <typename T>
LogTaskBase<T>::Run::Run(T* aEvent, bool aWillRunAgain)
: mEvent(aEvent), mWillRunAgain(aWillRunAgain) {
LOG1(("EXEC %p", mEvent));
}
template <>
LogTaskBase<nsIRunnable>::Run::Run(nsIRunnable* aEvent, bool aWillRunAgain)
: mEvent(aEvent), mWillRunAgain(aWillRunAgain) {
if (!LOG1_ENABLED()) {
return;
}
nsCOMPtr<nsINamed> named(do_QueryInterface(aEvent));
if (!named) {
LOG1(("EXEC %p", mEvent));
return;
}
nsAutoCString name;
named->GetName(name);
LOG1(("EXEC %p [%s]", aEvent, name.BeginReading()));
}
template <>
LogTaskBase<IPC::Message>::Run::Run(IPC::Message* aMessage, bool aWillRunAgain)
: mEvent(aMessage), mWillRunAgain(aWillRunAgain) {
LOG1(("RECV %p %d [%s]", aMessage, aMessage->seqno(), aMessage->name()));
}
template <typename T>
LogTaskBase<T>::Run::~Run() {
LOG1((mWillRunAgain ? "INTERRUPTED %p" : "DONE %p", mEvent));
}
template class LogTaskBase<nsIRunnable>;
template class LogTaskBase<MicroTaskRunnable>;
template class LogTaskBase<IPC::Message>;
} // namespace mozilla

View File

@ -1779,11 +1779,6 @@ extern "C" nsresult NS_DispatchBackgroundTask(
extern "C" nsresult NS_CreateBackgroundTaskQueue(
const char* aName, nsISerialEventTarget** aTarget);
// Predeclaration for logging function below
namespace IPC {
class Message;
}
namespace mozilla {
// These functions return event targets that can be used to dispatch to the
@ -1890,10 +1885,6 @@ class LogTaskBase {
// Adds a simple log about dispatch of this runnable.
static void LogDispatch(T* aEvent);
// Logs dispatch of the message and along that also the PID of the target
// proccess, purposed for uniquely identifying IPC messages.
static void LogDispatchWithPid(T* aEvent, int32_t aPid);
// This is designed to surround a call to `Run()` or any code representing
// execution of the task body.
// The constructor adds a simple log about start of the runnable execution and
@ -1914,20 +1905,7 @@ class LogTaskBase {
};
};
class MicroTaskRunnable;
// Specialized methods must be explicitly predeclared.
template <>
LogTaskBase<nsIRunnable>::Run::Run(nsIRunnable* aEvent, bool aWillRunAgain);
template <>
void LogTaskBase<IPC::Message>::LogDispatchWithPid(IPC::Message* aEvent,
int32_t aPid);
template <>
LogTaskBase<IPC::Message>::Run::Run(IPC::Message* aMessage, bool aWillRunAgain);
typedef LogTaskBase<nsIRunnable> LogRunnable;
typedef LogTaskBase<MicroTaskRunnable> LogMicroTaskRunnable;
typedef LogTaskBase<IPC::Message> LogIPCMessage;
// If you add new types don't forget to add:
// `template class LogTaskBase<YourType>;` to nsThreadUtils.cpp