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

Side by Side Diff: base/message_loop/message_loop.cc

Issue 22816018: Make the lazy TLS pointer to the current MessageLoop into a Leaky LazyInstance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/message_loop.h" 5 #include "base/message_loop/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 26 matching lines...) Expand all
37 #include <gdk/gdk.h> 37 #include <gdk/gdk.h>
38 #include <gdk/gdkx.h> 38 #include <gdk/gdkx.h>
39 #endif 39 #endif
40 40
41 namespace base { 41 namespace base {
42 42
43 namespace { 43 namespace {
44 44
45 // A lazily created thread local storage for quick access to a thread's message 45 // A lazily created thread local storage for quick access to a thread's message
46 // loop, if one exists. This should be safe and free of static constructors. 46 // loop, if one exists. This should be safe and free of static constructors.
47 LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr = 47 LazyInstance<base::ThreadLocalPointer<MessageLoop> >::Leaky lazy_tls_ptr =
48 LAZY_INSTANCE_INITIALIZER; 48 LAZY_INSTANCE_INITIALIZER;
49 49
50 // Logical events for Histogram profiling. Run with -message-loop-histogrammer 50 // Logical events for Histogram profiling. Run with -message-loop-histogrammer
51 // to get an accounting of messages and actions taken on each thread. 51 // to get an accounting of messages and actions taken on each thread.
52 const int kTaskRunEvent = 0x1; 52 const int kTaskRunEvent = 0x1;
53 const int kTimerEvent = 0x2; 53 const int kTimerEvent = 0x2;
54 54
55 // Provide range of message IDs for use in histogramming and debug display. 55 // Provide range of message IDs for use in histogramming and debug display.
56 const int kLeastNonZeroMessageId = 1; 56 const int kLeastNonZeroMessageId = 1;
57 const int kMaxMessageId = 1099; 57 const int kMaxMessageId = 1099;
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 fd, 745 fd,
746 persistent, 746 persistent,
747 mode, 747 mode,
748 controller, 748 controller,
749 delegate); 749 delegate);
750 } 750 }
751 751
752 #endif 752 #endif
753 753
754 } // namespace base 754 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698