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

Side by Side Diff: base/message_loop/message_loop.h

Issue 1886453003: Make PendingTask move-only and pass it by value on retaining params (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mac test fix Created 4 years, 5 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
« no previous file with comments | « no previous file | base/message_loop/message_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 void SetThreadTaskRunnerHandle(); 443 void SetThreadTaskRunnerHandle();
444 444
445 // Invokes the actual run loop using the message pump. 445 // Invokes the actual run loop using the message pump.
446 void RunHandler(); 446 void RunHandler();
447 447
448 // Called to process any delayed non-nestable tasks. 448 // Called to process any delayed non-nestable tasks.
449 bool ProcessNextDelayedNonNestableTask(); 449 bool ProcessNextDelayedNonNestableTask();
450 450
451 // Calls RunTask or queues the pending_task on the deferred task list if it 451 // Calls RunTask or queues the pending_task on the deferred task list if it
452 // cannot be run right now. Returns true if the task was run. 452 // cannot be run right now. Returns true if the task was run.
453 bool DeferOrRunPendingTask(const PendingTask& pending_task); 453 bool DeferOrRunPendingTask(PendingTask pending_task);
454 454
455 // Adds the pending task to delayed_work_queue_. 455 // Adds the pending task to delayed_work_queue_.
456 void AddToDelayedWorkQueue(const PendingTask& pending_task); 456 void AddToDelayedWorkQueue(PendingTask pending_task);
457 457
458 // Delete tasks that haven't run yet without running them. Used in the 458 // Delete tasks that haven't run yet without running them. Used in the
459 // destructor to make sure all the task's destructors get called. Returns 459 // destructor to make sure all the task's destructors get called. Returns
460 // true if some work was done. 460 // true if some work was done.
461 bool DeletePendingTasks(); 461 bool DeletePendingTasks();
462 462
463 // Loads tasks from the incoming queue to |work_queue_| if the latter is 463 // Loads tasks from the incoming queue to |work_queue_| if the latter is
464 // empty. 464 // empty.
465 void ReloadWorkQueue(); 465 void ReloadWorkQueue();
466 466
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 690
691 // Do not add any member variables to MessageLoopForIO! This is important b/c 691 // Do not add any member variables to MessageLoopForIO! This is important b/c
692 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 692 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
693 // data that you need should be stored on the MessageLoop's pump_ instance. 693 // data that you need should be stored on the MessageLoop's pump_ instance.
694 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 694 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
695 "MessageLoopForIO should not have extra member variables"); 695 "MessageLoopForIO should not have extra member variables");
696 696
697 } // namespace base 697 } // namespace base
698 698
699 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 699 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698