Commit 1b269e7e authored by fdoray's avatar fdoray Committed by Commit bot

Remove calls to IsRunningSequenceOnCurrentThread() from crash_handler_host_linux.cc

SequencedWorkerPool is being migrated to base/task_scheduler and there
is no equivalent to IsRunningSequenceOnCurrentThread() in
base/task_scheduler.

Developers should use SequenceChecker to verify that tasks run
sequentially. Unlike
SequencedWorkerPool::IsRunningSequenceOnCurrentThread(),
SequenceChecker works everywhere in Chrome (MessageLoop,
SequencedWorkerPool, base/task_scheduler...).

BUG=622400

Review-Url: https://codereview.chromium.org/2318123002
Cr-Commit-Position: refs/heads/master@{#417388}
parent b29cf98d
......@@ -101,6 +101,8 @@ CrashHandlerHostLinux::CrashHandlerHostLinux(const std::string& process_type,
#endif
shutting_down_(false),
worker_pool_token_(base::SequencedWorkerPool::GetSequenceToken()) {
write_dump_file_sequence_checker_.DetachFromSequence();
int fds[2];
// We use SOCK_SEQPACKET rather than SOCK_DGRAM to prevent the process from
// sending datagrams to other sockets on the system. The sandbox may prevent
......@@ -401,8 +403,7 @@ void CrashHandlerHostLinux::WriteDumpFile(std::unique_ptr<BreakpadInfo> info,
std::unique_ptr<char[]> crash_context,
pid_t crashing_pid,
int signal_fd) {
DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread(
worker_pool_token_));
DCHECK(write_dump_file_sequence_checker_.CalledOnValidSequence());
// Set |info->distro| here because base::GetLinuxDistro() needs to run on a
// blocking thread.
......
......@@ -14,6 +14,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/sequence_checker.h"
#include "base/threading/sequenced_worker_pool.h"
#include "components/crash/content/app/breakpad_linux_impl.h"
......@@ -102,6 +103,9 @@ class CrashHandlerHostLinux : public base::MessageLoopForIO::Watcher,
// by other tasks.
base::SequencedWorkerPool::SequenceToken worker_pool_token_;
// Used to verify that calls to WriteDumpFile() are sequenced.
base::SequenceChecker write_dump_file_sequence_checker_;
DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux);
};
......
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