Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2021)

Unified Diff: base/message_loop/message_loop.cc

Issue 853903003: Cleanup dead code in base/ as found by Scythe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix MessageLoop::ReloadWorkQueue() Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/process/process_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 818073367bdf2698a233a9aa46a79b878d3fbe7b..86771e43ae6c5075e5ab2c9dd76bfdb750e52dc2 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -117,8 +117,10 @@ MessageLoop::DestructionObserver::~DestructionObserver() {
MessageLoop::MessageLoop(Type type)
: type_(type),
+#if defined(OS_WIN)
pending_high_res_tasks_(0),
in_high_res_mode_(false),
+#endif
nestable_tasks_allowed_(true),
#if defined(OS_WIN)
os_modal_loop_(false),
@@ -133,8 +135,10 @@ MessageLoop::MessageLoop(Type type)
MessageLoop::MessageLoop(scoped_ptr<MessagePump> pump)
: pump_(pump.Pass()),
type_(TYPE_CUSTOM),
+#if defined(OS_WIN)
pending_high_res_tasks_(0),
in_high_res_mode_(false),
+#endif
nestable_tasks_allowed_(true),
#if defined(OS_WIN)
os_modal_loop_(false),
@@ -422,10 +426,13 @@ bool MessageLoop::ProcessNextDelayedNonNestableTask() {
void MessageLoop::RunTask(const PendingTask& pending_task) {
DCHECK(nestable_tasks_allowed_);
+#if defined(OS_WIN)
if (pending_task.is_high_res) {
pending_high_res_tasks_--;
- CHECK(pending_high_res_tasks_ >= 0);
+ CHECK_GE(pending_high_res_tasks_, 0);
}
+#endif
+
// Execute the task and assume the worst: It is probably not reentrant.
nestable_tasks_allowed_ = false;
@@ -495,8 +502,12 @@ void MessageLoop::ReloadWorkQueue() {
// load. That reduces the number of locks-per-task significantly when our
// queues get large.
if (work_queue_.empty()) {
+#if defined(OS_WIN)
pending_high_res_tasks_ +=
incoming_task_queue_->ReloadWorkQueue(&work_queue_);
+#else
+ incoming_task_queue_->ReloadWorkQueue(&work_queue_);
+#endif
}
}
@@ -692,8 +703,8 @@ bool MessageLoopForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) {
bool MessageLoopForIO::WatchFileDescriptor(int fd,
bool persistent,
Mode mode,
- FileDescriptorWatcher *controller,
- Watcher *delegate) {
+ FileDescriptorWatcher* controller,
+ Watcher* delegate) {
return ToPumpIO(pump_.get())->WatchFileDescriptor(
fd,
persistent,
« no previous file with comments | « base/message_loop/message_loop.h ('k') | base/process/process_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698