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

Side by Side Diff: base/message_loop.h

Issue 12161002: MessageLoop's RUN method will pass a const ref to PendingTask when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef BASE_MESSAGE_LOOP_H_
6 #define BASE_MESSAGE_LOOP_H_ 6 #define BASE_MESSAGE_LOOP_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // A TaskObserver is an object that receives task notifications from the 333 // A TaskObserver is an object that receives task notifications from the
334 // MessageLoop. 334 // MessageLoop.
335 // 335 //
336 // NOTE: A TaskObserver implementation should be extremely fast! 336 // NOTE: A TaskObserver implementation should be extremely fast!
337 class BASE_EXPORT TaskObserver { 337 class BASE_EXPORT TaskObserver {
338 public: 338 public:
339 TaskObserver(); 339 TaskObserver();
340 340
341 // This method is called before processing a task. 341 // This method is called before processing a task.
342 virtual void WillProcessTask(base::TimeTicks time_posted) = 0; 342 virtual void WillProcessTask(const base::PendingTask& pending_task) = 0;
343 343
344 // This method is called after processing a task. 344 // This method is called after processing a task.
345 virtual void DidProcessTask(base::TimeTicks time_posted) = 0; 345 virtual void DidProcessTask(const base::PendingTask& pending_task) = 0;
346 346
347 protected: 347 protected:
348 virtual ~TaskObserver(); 348 virtual ~TaskObserver();
349 }; 349 };
350 350
351 // These functions can only be called on the same thread that |this| is 351 // These functions can only be called on the same thread that |this| is
352 // running on. 352 // running on.
353 void AddTaskObserver(TaskObserver* task_observer); 353 void AddTaskObserver(TaskObserver* task_observer);
354 void RemoveTaskObserver(TaskObserver* task_observer); 354 void RemoveTaskObserver(TaskObserver* task_observer);
355 355
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 #endif // defined(OS_POSIX) 699 #endif // defined(OS_POSIX)
700 }; 700 };
701 701
702 // Do not add any member variables to MessageLoopForIO! This is important b/c 702 // Do not add any member variables to MessageLoopForIO! This is important b/c
703 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 703 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
704 // data that you need should be stored on the MessageLoop's pump_ instance. 704 // data that you need should be stored on the MessageLoop's pump_ instance.
705 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 705 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
706 MessageLoopForIO_should_not_have_extra_member_variables); 706 MessageLoopForIO_should_not_have_extra_member_variables);
707 707
708 #endif // BASE_MESSAGE_LOOP_H_ 708 #endif // BASE_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | base/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698