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

Side by Side Diff: base/message_loop.cc

Issue 5784005: Properly lock access to static variables.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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') | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698