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

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

Issue 1173193002: Don't peek messages in the MessagePumpForUI class when we receive our kMsgHaveWork message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/incoming_task_queue.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_INCOMING_TASK_QUEUE_H_ 5 #ifndef BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_
6 #define BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ 6 #define BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/pending_task.h" 10 #include "base/pending_task.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // require high resolution timers. 50 // require high resolution timers.
51 int ReloadWorkQueue(TaskQueue* work_queue); 51 int ReloadWorkQueue(TaskQueue* work_queue);
52 52
53 // Disconnects |this| from the parent message loop. 53 // Disconnects |this| from the parent message loop.
54 void WillDestroyCurrentMessageLoop(); 54 void WillDestroyCurrentMessageLoop();
55 55
56 // This should be called when the message loop becomes ready for 56 // This should be called when the message loop becomes ready for
57 // scheduling work. 57 // scheduling work.
58 void StartScheduling(); 58 void StartScheduling();
59 59
60 // Returns the delay for the most recently added task.
61 TimeTicks GetNewlyAddedTaskDelay();
62
60 private: 63 private:
61 friend class RefCountedThreadSafe<IncomingTaskQueue>; 64 friend class RefCountedThreadSafe<IncomingTaskQueue>;
62 virtual ~IncomingTaskQueue(); 65 virtual ~IncomingTaskQueue();
63 66
64 // Calculates the time at which a PendingTask should run. 67 // Calculates the time at which a PendingTask should run.
65 TimeTicks CalculateDelayedRuntime(TimeDelta delay); 68 TimeTicks CalculateDelayedRuntime(TimeDelta delay);
66 69
67 // Adds a task to |incoming_queue_|. The caller retains ownership of 70 // Adds a task to |incoming_queue_|. The caller retains ownership of
68 // |pending_task|, but this function will reset the value of 71 // |pending_task|, but this function will reset the value of
69 // |pending_task->task|. This is needed to ensure that the posting call stack 72 // |pending_task->task|. This is needed to ensure that the posting call stack
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // False until StartScheduling() is called. 105 // False until StartScheduling() is called.
103 bool is_ready_for_scheduling_; 106 bool is_ready_for_scheduling_;
104 107
105 DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue); 108 DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue);
106 }; 109 };
107 110
108 } // namespace internal 111 } // namespace internal
109 } // namespace base 112 } // namespace base
110 113
111 #endif // BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ 114 #endif // BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop/incoming_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698