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

Side by Side Diff: base/message_loop.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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/mac/scoped_nsexception_enabler.mm ('k') | base/nix/mime_util_xdg.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 24 matching lines...) Expand all
35 #include <gdk/gdkx.h> 35 #include <gdk/gdkx.h>
36 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) 36 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
37 37
38 using base::TimeDelta; 38 using base::TimeDelta;
39 using base::TimeTicks; 39 using base::TimeTicks;
40 40
41 namespace { 41 namespace {
42 42
43 // A lazily created thread local storage for quick access to a thread's message 43 // A lazily created thread local storage for quick access to a thread's message
44 // loop, if one exists. This should be safe and free of static constructors. 44 // loop, if one exists. This should be safe and free of static constructors.
45 base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr( 45 base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr =
46 base::LINKER_INITIALIZED); 46 LAZY_INSTANCE_INITIALIZER;
47 47
48 // Logical events for Histogram profiling. Run with -message-loop-histogrammer 48 // Logical events for Histogram profiling. Run with -message-loop-histogrammer
49 // to get an accounting of messages and actions taken on each thread. 49 // to get an accounting of messages and actions taken on each thread.
50 const int kTaskRunEvent = 0x1; 50 const int kTaskRunEvent = 0x1;
51 const int kTimerEvent = 0x2; 51 const int kTimerEvent = 0x2;
52 52
53 // Provide range of message IDs for use in histogramming and debug display. 53 // Provide range of message IDs for use in histogramming and debug display.
54 const int kLeastNonZeroMessageId = 1; 54 const int kLeastNonZeroMessageId = 1;
55 const int kMaxMessageId = 1099; 55 const int kMaxMessageId = 1099;
56 const int kNumberOfDistinctMessagesDisplayed = 1100; 56 const int kNumberOfDistinctMessagesDisplayed = 1100;
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 Watcher *delegate) { 869 Watcher *delegate) {
870 return pump_libevent()->WatchFileDescriptor( 870 return pump_libevent()->WatchFileDescriptor(
871 fd, 871 fd,
872 persistent, 872 persistent,
873 static_cast<base::MessagePumpLibevent::Mode>(mode), 873 static_cast<base::MessagePumpLibevent::Mode>(mode),
874 controller, 874 controller,
875 delegate); 875 delegate);
876 } 876 }
877 877
878 #endif 878 #endif
OLDNEW
« no previous file with comments | « base/mac/scoped_nsexception_enabler.mm ('k') | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698