OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 // Method and data for histogramming events and actions taken by each instance | 632 // Method and data for histogramming events and actions taken by each instance |
633 // on each thread. | 633 // on each thread. |
634 | 634 |
635 // static | 635 // static |
636 void MessageLoop::EnableHistogrammer(bool enable) { | 636 void MessageLoop::EnableHistogrammer(bool enable) { |
637 enable_histogrammer_ = enable; | 637 enable_histogrammer_ = enable; |
638 } | 638 } |
639 | 639 |
640 void MessageLoop::StartHistogrammer() { | 640 void MessageLoop::StartHistogrammer() { |
641 if (enable_histogrammer_ && !message_histogram_.get() | 641 if (enable_histogrammer_ && !message_histogram_.get() |
642 && base::StatisticsRecorder::WasStarted()) { | 642 && base::StatisticsRecorder::IsActive()) { |
643 DCHECK(!thread_name_.empty()); | 643 DCHECK(!thread_name_.empty()); |
644 message_histogram_ = base::LinearHistogram::FactoryGet( | 644 message_histogram_ = base::LinearHistogram::FactoryGet( |
645 "MsgLoop:" + thread_name_, | 645 "MsgLoop:" + thread_name_, |
646 kLeastNonZeroMessageId, kMaxMessageId, | 646 kLeastNonZeroMessageId, kMaxMessageId, |
647 kNumberOfDistinctMessagesDisplayed, | 647 kNumberOfDistinctMessagesDisplayed, |
648 message_histogram_->kHexRangePrintingFlag); | 648 message_histogram_->kHexRangePrintingFlag); |
649 message_histogram_->SetRangeDescriptions(event_descriptions_); | 649 message_histogram_->SetRangeDescriptions(event_descriptions_); |
650 } | 650 } |
651 } | 651 } |
652 | 652 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 Watcher *delegate) { | 702 Watcher *delegate) { |
703 return pump_libevent()->WatchFileDescriptor( | 703 return pump_libevent()->WatchFileDescriptor( |
704 fd, | 704 fd, |
705 persistent, | 705 persistent, |
706 static_cast<base::MessagePumpLibevent::Mode>(mode), | 706 static_cast<base::MessagePumpLibevent::Mode>(mode), |
707 controller, | 707 controller, |
708 delegate); | 708 delegate); |
709 } | 709 } |
710 | 710 |
711 #endif | 711 #endif |
OLD | NEW |