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

Side by Side Diff: content/browser/browser_thread_impl.cc

Issue 10827026: Use NOINLINE for thread watcher and browser thread identifier (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « chrome/browser/metrics/thread_watcher.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_thread_impl.h" 5 #include "content/browser/browser_thread_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 reinterpret_cast<BrowserThreadDelegate*>(stored_pointer); 93 reinterpret_cast<BrowserThreadDelegate*>(stored_pointer);
94 if (delegate) 94 if (delegate)
95 delegate->Init(); 95 delegate->Init();
96 } 96 }
97 97
98 // We disable optimizations for this block of functions so the compiler doesn't 98 // We disable optimizations for this block of functions so the compiler doesn't
99 // merge them all together. 99 // merge them all together.
100 MSVC_DISABLE_OPTIMIZE() 100 MSVC_DISABLE_OPTIMIZE()
101 MSVC_PUSH_DISABLE_WARNING(4748) 101 MSVC_PUSH_DISABLE_WARNING(4748)
102 102
103 void BrowserThreadImpl::UIThreadRun(MessageLoop* message_loop) { 103 NOINLINE void BrowserThreadImpl::UIThreadRun(MessageLoop* message_loop) {
104 volatile int line_number = __LINE__; 104 volatile int line_number = __LINE__;
105 Thread::Run(message_loop); 105 Thread::Run(message_loop);
106 CHECK_GT(line_number, 0); 106 CHECK_GT(line_number, 0);
107 } 107 }
108 108
109 void BrowserThreadImpl::DBThreadRun(MessageLoop* message_loop) { 109 NOINLINE void BrowserThreadImpl::DBThreadRun(MessageLoop* message_loop) {
110 volatile int line_number = __LINE__; 110 volatile int line_number = __LINE__;
111 Thread::Run(message_loop); 111 Thread::Run(message_loop);
112 CHECK_GT(line_number, 0); 112 CHECK_GT(line_number, 0);
113 } 113 }
114 114
115 void BrowserThreadImpl::WebKitThreadRun(MessageLoop* message_loop) { 115 NOINLINE void BrowserThreadImpl::WebKitThreadRun(MessageLoop* message_loop) {
116 volatile int line_number = __LINE__; 116 volatile int line_number = __LINE__;
117 Thread::Run(message_loop); 117 Thread::Run(message_loop);
118 CHECK_GT(line_number, 0); 118 CHECK_GT(line_number, 0);
119 } 119 }
120 120
121 void BrowserThreadImpl::FileThreadRun(MessageLoop* message_loop) { 121 NOINLINE void BrowserThreadImpl::FileThreadRun(MessageLoop* message_loop) {
122 volatile int line_number = __LINE__; 122 volatile int line_number = __LINE__;
123 Thread::Run(message_loop); 123 Thread::Run(message_loop);
124 CHECK_GT(line_number, 0); 124 CHECK_GT(line_number, 0);
125 } 125 }
126 126
127 void BrowserThreadImpl::FileUserBlockingThreadRun(MessageLoop* message_loop) { 127 NOINLINE void BrowserThreadImpl::FileUserBlockingThreadRun(
128 MessageLoop* message_loop) {
128 volatile int line_number = __LINE__; 129 volatile int line_number = __LINE__;
129 Thread::Run(message_loop); 130 Thread::Run(message_loop);
130 CHECK_GT(line_number, 0); 131 CHECK_GT(line_number, 0);
131 } 132 }
132 133
133 void BrowserThreadImpl::ProcessLauncherThreadRun(MessageLoop* message_loop) { 134 NOINLINE void BrowserThreadImpl::ProcessLauncherThreadRun(
135 MessageLoop* message_loop) {
134 volatile int line_number = __LINE__; 136 volatile int line_number = __LINE__;
135 Thread::Run(message_loop); 137 Thread::Run(message_loop);
136 CHECK_GT(line_number, 0); 138 CHECK_GT(line_number, 0);
137 } 139 }
138 140
139 void BrowserThreadImpl::CacheThreadRun(MessageLoop* message_loop) { 141 NOINLINE void BrowserThreadImpl::CacheThreadRun(MessageLoop* message_loop) {
140 volatile int line_number = __LINE__; 142 volatile int line_number = __LINE__;
141 Thread::Run(message_loop); 143 Thread::Run(message_loop);
142 CHECK_GT(line_number, 0); 144 CHECK_GT(line_number, 0);
143 } 145 }
144 146
145 void BrowserThreadImpl::IOThreadRun(MessageLoop* message_loop) { 147 NOINLINE void BrowserThreadImpl::IOThreadRun(MessageLoop* message_loop) {
146 volatile int line_number = __LINE__; 148 volatile int line_number = __LINE__;
147 Thread::Run(message_loop); 149 Thread::Run(message_loop);
148 CHECK_GT(line_number, 0); 150 CHECK_GT(line_number, 0);
149 } 151 }
150 152
151 MSVC_POP_WARNING() 153 MSVC_POP_WARNING()
152 MSVC_ENABLE_OPTIMIZE(); 154 MSVC_ENABLE_OPTIMIZE();
153 155
154 void BrowserThreadImpl::Run(MessageLoop* message_loop) { 156 void BrowserThreadImpl::Run(MessageLoop* message_loop) {
155 BrowserThread::ID thread_id; 157 BrowserThread::ID thread_id;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 AtomicWord* storage = reinterpret_cast<AtomicWord*>( 463 AtomicWord* storage = reinterpret_cast<AtomicWord*>(
462 &globals.thread_delegates[identifier]); 464 &globals.thread_delegates[identifier]);
463 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 465 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
464 storage, reinterpret_cast<AtomicWord>(delegate)); 466 storage, reinterpret_cast<AtomicWord>(delegate));
465 467
466 // This catches registration when previously registered. 468 // This catches registration when previously registered.
467 DCHECK(!delegate || !old_pointer); 469 DCHECK(!delegate || !old_pointer);
468 } 470 }
469 471
470 } // namespace content 472 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698