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

Side by Side Diff: base/message_loop.cc

Issue 11342060: Histogram type support in HistogramBase and remove SetRangeDescription function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/metrics/histogram.h » ('j') | base/metrics/histogram.h » ('J')
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 #include "base/message_loop.h" 5 #include "base/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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 //------------------------------------------------------------------------------ 618 //------------------------------------------------------------------------------
619 // Method and data for histogramming events and actions taken by each instance 619 // Method and data for histogramming events and actions taken by each instance
620 // on each thread. 620 // on each thread.
621 621
622 void MessageLoop::StartHistogrammer() { 622 void MessageLoop::StartHistogrammer() {
623 #if !defined(OS_NACL) // NaCl build has no metrics code. 623 #if !defined(OS_NACL) // NaCl build has no metrics code.
624 if (enable_histogrammer_ && !message_histogram_ 624 if (enable_histogrammer_ && !message_histogram_
625 && base::StatisticsRecorder::IsActive()) { 625 && base::StatisticsRecorder::IsActive()) {
626 DCHECK(!thread_name_.empty()); 626 DCHECK(!thread_name_.empty());
627 message_histogram_ = base::LinearHistogram::FactoryGet( 627 message_histogram_ = base::LinearHistogram::FactoryGetWithRangeDescription(
628 "MsgLoop:" + thread_name_, 628 "MsgLoop:" + thread_name_,
629 kLeastNonZeroMessageId, kMaxMessageId, 629 kLeastNonZeroMessageId, kMaxMessageId,
630 kNumberOfDistinctMessagesDisplayed, 630 kNumberOfDistinctMessagesDisplayed,
631 message_histogram_->kHexRangePrintingFlag); 631 message_histogram_->kHexRangePrintingFlag,
632 message_histogram_->SetRangeDescriptions(event_descriptions_); 632 event_descriptions_);
633 } 633 }
634 #endif 634 #endif
635 } 635 }
636 636
637 void MessageLoop::HistogramEvent(int event) { 637 void MessageLoop::HistogramEvent(int event) {
638 #if !defined(OS_NACL) 638 #if !defined(OS_NACL)
639 if (message_histogram_) 639 if (message_histogram_)
640 message_histogram_->Add(event); 640 message_histogram_->Add(event);
641 #endif 641 #endif
642 } 642 }
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 Watcher *delegate) { 785 Watcher *delegate) {
786 return pump_libevent()->WatchFileDescriptor( 786 return pump_libevent()->WatchFileDescriptor(
787 fd, 787 fd,
788 persistent, 788 persistent,
789 static_cast<base::MessagePumpLibevent::Mode>(mode), 789 static_cast<base::MessagePumpLibevent::Mode>(mode),
790 controller, 790 controller,
791 delegate); 791 delegate);
792 } 792 }
793 793
794 #endif 794 #endif
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram.h » ('j') | base/metrics/histogram.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698