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

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

Issue 2386653002: Replace base::Callback with base::OnceCallback in base::PendingTask (Closed)
Patch Set: move UnsafeConvertOnceClosureToRepeating Created 4 years, 2 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 | « base/debug/task_annotator_unittest.cc ('k') | 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bool HasHighResolutionTasks(); 307 bool HasHighResolutionTasks();
308 308
309 // Returns true if the message loop is "idle". Provided for testing. 309 // Returns true if the message loop is "idle". Provided for testing.
310 bool IsIdleForTesting(); 310 bool IsIdleForTesting();
311 311
312 // Returns the TaskAnnotator which is used to add debug information to posted 312 // Returns the TaskAnnotator which is used to add debug information to posted
313 // tasks. 313 // tasks.
314 debug::TaskAnnotator* task_annotator() { return &task_annotator_; } 314 debug::TaskAnnotator* task_annotator() { return &task_annotator_; }
315 315
316 // Runs the specified PendingTask. 316 // Runs the specified PendingTask.
317 void RunTask(const PendingTask& pending_task); 317 void RunTask(PendingTask* pending_task);
318 318
319 // Disallow nesting. After this is called, running a nested RunLoop or calling 319 // Disallow nesting. After this is called, running a nested RunLoop or calling
320 // Add/RemoveNestingObserver() on this MessageLoop will crash. 320 // Add/RemoveNestingObserver() on this MessageLoop will crash.
321 void DisallowNesting() { allow_nesting_ = false; } 321 void DisallowNesting() { allow_nesting_ = false; }
322 322
323 //---------------------------------------------------------------------------- 323 //----------------------------------------------------------------------------
324 protected: 324 protected:
325 std::unique_ptr<MessagePump> pump_; 325 std::unique_ptr<MessagePump> pump_;
326 326
327 using MessagePumpFactoryCallback = Callback<std::unique_ptr<MessagePump>()>; 327 using MessagePumpFactoryCallback = Callback<std::unique_ptr<MessagePump>()>;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 // Do not add any member variables to MessageLoopForIO! This is important b/c 599 // Do not add any member variables to MessageLoopForIO! This is important b/c
600 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 600 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
601 // data that you need should be stored on the MessageLoop's pump_ instance. 601 // data that you need should be stored on the MessageLoop's pump_ instance.
602 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 602 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
603 "MessageLoopForIO should not have extra member variables"); 603 "MessageLoopForIO should not have extra member variables");
604 604
605 } // namespace base 605 } // namespace base
606 606
607 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 607 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « base/debug/task_annotator_unittest.cc ('k') | base/message_loop/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698