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

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

Issue 22911026: Add instrumentation to the MessagePumpMac family of classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 4 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
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 #include "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 bool MessageLoop::DoIdleWork() { 649 bool MessageLoop::DoIdleWork() {
650 if (ProcessNextDelayedNonNestableTask()) 650 if (ProcessNextDelayedNonNestableTask())
651 return true; 651 return true;
652 652
653 if (run_loop_->quit_when_idle_received_) 653 if (run_loop_->quit_when_idle_received_)
654 pump_->Quit(); 654 pump_->Quit();
655 655
656 return false; 656 return false;
657 } 657 }
658 658
659 void MessageLoop::GetQueueingInformation(size_t* queue_size,
660 TimeDelta* queueing_delay) {
661 size_t size = work_queue_.size();
662 if (queue_size)
Mark Mentovai 2013/08/22 18:00:12 Since nobody needs to call this with NULL argument
Robert Sesek 2013/08/22 19:12:21 Done.
663 *queue_size = size + delayed_work_queue_.size();
664
665 if (size == 0 || !queueing_delay) {
666 if (queueing_delay)
667 *queueing_delay = TimeDelta();
668 return;
669 }
670
671 const PendingTask& next_to_run = work_queue_.front();
672 tracked_objects::Duration duration =
673 tracked_objects::TrackedTime::Now() - next_to_run.EffectiveTimePosted();
674 *queueing_delay = TimeDelta::FromMilliseconds(duration.InMilliseconds());
675 }
676
659 void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here, 677 void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here,
660 void(*deleter)(const void*), 678 void(*deleter)(const void*),
661 const void* object) { 679 const void* object) {
662 PostNonNestableTask(from_here, Bind(deleter, object)); 680 PostNonNestableTask(from_here, Bind(deleter, object));
663 } 681 }
664 682
665 void MessageLoop::ReleaseSoonInternal( 683 void MessageLoop::ReleaseSoonInternal(
666 const tracked_objects::Location& from_here, 684 const tracked_objects::Location& from_here,
667 void(*releaser)(const void*), 685 void(*releaser)(const void*),
668 const void* object) { 686 const void* object) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 fd, 763 fd,
746 persistent, 764 persistent,
747 mode, 765 mode,
748 controller, 766 controller,
749 delegate); 767 delegate);
750 } 768 }
751 769
752 #endif 770 #endif
753 771
754 } // namespace base 772 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698