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

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

Issue 583043005: Pending tasks in a message loop should be deleted before shutting down Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 protected: 365 protected:
366 virtual ~TaskObserver(); 366 virtual ~TaskObserver();
367 }; 367 };
368 368
369 // These functions can only be called on the same thread that |this| is 369 // These functions can only be called on the same thread that |this| is
370 // running on. 370 // running on.
371 void AddTaskObserver(TaskObserver* task_observer); 371 void AddTaskObserver(TaskObserver* task_observer);
372 void RemoveTaskObserver(TaskObserver* task_observer); 372 void RemoveTaskObserver(TaskObserver* task_observer);
373 373
374 // Flushes all pending tasks in this message loop.
jamesr 2014/09/24 04:57:26 i really think if we need to patch base/ for this
375 void FlushPendingTasks();
376
374 #if defined(OS_WIN) 377 #if defined(OS_WIN)
375 void set_os_modal_loop(bool os_modal_loop) { 378 void set_os_modal_loop(bool os_modal_loop) {
376 os_modal_loop_ = os_modal_loop; 379 os_modal_loop_ = os_modal_loop;
377 } 380 }
378 381
379 bool os_modal_loop() const { 382 bool os_modal_loop() const {
380 return os_modal_loop_; 383 return os_modal_loop_;
381 } 384 }
382 #endif // OS_WIN 385 #endif // OS_WIN
383 386
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 653
651 // Do not add any member variables to MessageLoopForIO! This is important b/c 654 // Do not add any member variables to MessageLoopForIO! This is important b/c
652 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 655 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
653 // data that you need should be stored on the MessageLoop's pump_ instance. 656 // data that you need should be stored on the MessageLoop's pump_ instance.
654 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 657 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
655 MessageLoopForIO_should_not_have_extra_member_variables); 658 MessageLoopForIO_should_not_have_extra_member_variables);
656 659
657 } // namespace base 660 } // namespace base
658 661
659 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 662 #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