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

Side by Side Diff: base/task_scheduler/scheduler_single_thread_task_runner_manager.cc

Issue 2859053006: Use constexpr TaskTraits constructor in base (part 2). (Closed)
Patch Set: self-review Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/task_scheduler/scheduler_single_thread_task_runner_manager.h" 5 #include "base/task_scheduler/scheduler_single_thread_task_runner_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 MSG msg; 207 MSG msg;
208 if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE) { 208 if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE) {
209 auto pump_message_task = 209 auto pump_message_task =
210 MakeUnique<Task>(FROM_HERE, 210 MakeUnique<Task>(FROM_HERE,
211 Bind( 211 Bind(
212 [](MSG msg) { 212 [](MSG msg) {
213 TranslateMessage(&msg); 213 TranslateMessage(&msg);
214 DispatchMessage(&msg); 214 DispatchMessage(&msg);
215 }, 215 },
216 std::move(msg)), 216 std::move(msg)),
217 TaskTraits().MayBlock(), TimeDelta()); 217 TaskTraits(MayBlock()), TimeDelta());
218 if (task_tracker_->WillPostTask(pump_message_task.get())) { 218 if (task_tracker_->WillPostTask(pump_message_task.get())) {
219 bool was_empty = 219 bool was_empty =
220 message_pump_sequence_->PushTask(std::move(pump_message_task)); 220 message_pump_sequence_->PushTask(std::move(pump_message_task));
221 DCHECK(was_empty) << "GetWorkFromWindowsMessageQueue() does not expect " 221 DCHECK(was_empty) << "GetWorkFromWindowsMessageQueue() does not expect "
222 "queueing of pump tasks."; 222 "queueing of pump tasks.";
223 return message_pump_sequence_; 223 return message_pump_sequence_;
224 } 224 }
225 } 225 }
226 return nullptr; 226 return nullptr;
227 } 227 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 }); 487 });
488 DCHECK(worker_iter != workers_.end()); 488 DCHECK(worker_iter != workers_.end());
489 worker_to_destroy = std::move(*worker_iter); 489 worker_to_destroy = std::move(*worker_iter);
490 workers_.erase(worker_iter); 490 workers_.erase(worker_iter);
491 } 491 }
492 worker_to_destroy->Cleanup(); 492 worker_to_destroy->Cleanup();
493 } 493 }
494 494
495 } // namespace internal 495 } // namespace internal
496 } // namespace base 496 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698