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

Unified Diff: base/message_loop/message_loop.cc

Issue 863253002: Update from https://crrev.com/312600 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
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,

Powered by Google App Engine
This is Rietveld 408576698