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

Side by Side Diff: base/message_loop.cc

Issue 28046: Use string for Histogram names since these are all ASCII anyway wide-characte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « base/histogram_unittest.cc ('k') | base/message_pump_win.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) 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
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
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
OLDNEW
« no previous file with comments | « base/histogram_unittest.cc ('k') | base/message_pump_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698