OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 // static | 498 // static |
499 void MessageLoop::EnableHistogrammer(bool enable) { | 499 void MessageLoop::EnableHistogrammer(bool enable) { |
500 enable_histogrammer_ = enable; | 500 enable_histogrammer_ = enable; |
501 } | 501 } |
502 | 502 |
503 void MessageLoop::StartHistogrammer() { | 503 void MessageLoop::StartHistogrammer() { |
504 if (enable_histogrammer_ && !message_histogram_.get() | 504 if (enable_histogrammer_ && !message_histogram_.get() |
505 && StatisticsRecorder::WasStarted()) { | 505 && StatisticsRecorder::WasStarted()) { |
506 DCHECK(!thread_name_.empty()); | 506 DCHECK(!thread_name_.empty()); |
507 message_histogram_.reset(new LinearHistogram( | 507 message_histogram_.reset( |
508 ASCIIToWide("MsgLoop:" + thread_name_).c_str(), | 508 new LinearHistogram(("MsgLoop:" + thread_name_).c_str(), |
509 kLeastNonZeroMessageId, | 509 kLeastNonZeroMessageId, |
510 kMaxMessageId, | 510 kMaxMessageId, |
511 kNumberOfDistinctMessagesDisplayed)); | 511 kNumberOfDistinctMessagesDisplayed)); |
512 message_histogram_->SetFlags(message_histogram_->kHexRangePrintingFlag); | 512 message_histogram_->SetFlags(message_histogram_->kHexRangePrintingFlag); |
513 message_histogram_->SetRangeDescriptions(event_descriptions_); | 513 message_histogram_->SetRangeDescriptions(event_descriptions_); |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 void MessageLoop::HistogramEvent(int event) { | 517 void MessageLoop::HistogramEvent(int event) { |
518 if (message_histogram_.get()) | 518 if (message_histogram_.get()) |
519 message_histogram_->Add(event); | 519 message_histogram_->Add(event); |
520 } | 520 } |
521 | 521 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 Watcher *delegate) { | 600 Watcher *delegate) { |
601 return pump_libevent()->WatchFileDescriptor( | 601 return pump_libevent()->WatchFileDescriptor( |
602 fd, | 602 fd, |
603 persistent, | 603 persistent, |
604 static_cast<base::MessagePumpLibevent::Mode>(mode), | 604 static_cast<base::MessagePumpLibevent::Mode>(mode), |
605 controller, | 605 controller, |
606 delegate); | 606 delegate); |
607 } | 607 } |
608 | 608 |
609 #endif | 609 #endif |
OLD | NEW |