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

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

Issue 8366020: Create a secondary file thread, FILE_USER_BLOCKING... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | « content/browser/browser_main_loop.cc ('k') | content/public/browser/browser_thread.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) 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 "content/browser/browser_thread_impl.h" 5 #include "content/browser/browser_thread_impl.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/message_loop_proxy.h" 11 #include "base/message_loop_proxy.h"
12 #include "base/threading/thread_restrictions.h" 12 #include "base/threading/thread_restrictions.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 namespace { 16 namespace {
17 17
18 // Friendly names for the well-known threads. 18 // Friendly names for the well-known threads.
19 static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = { 19 static const char* g_browser_thread_names[BrowserThread::ID_COUNT] = {
20 "", // UI (name assembled in browser_main.cc). 20 "", // UI (name assembled in browser_main.cc).
21 "Chrome_DBThread", // DB 21 "Chrome_DBThread", // DB
22 "Chrome_WebKitThread", // WEBKIT 22 "Chrome_WebKitThread", // WEBKIT
23 "Chrome_FileThread", // FILE 23 "Chrome_FileThread", // FILE
24 "Chrome_FileUserBlockingThread", // FILE_USER_BLOCKING
24 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER 25 "Chrome_ProcessLauncherThread", // PROCESS_LAUNCHER
25 "Chrome_CacheThread", // CACHE 26 "Chrome_CacheThread", // CACHE
26 "Chrome_IOThread", // IO 27 "Chrome_IOThread", // IO
27 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
28 "Chrome_WebSocketproxyThread", // WEB_SOCKET_PROXY 29 "Chrome_WebSocketproxyThread", // WEB_SOCKET_PROXY
29 #endif 30 #endif
30 }; 31 };
31 32
32 // This lock protects |g_browser_threads|. Do not read or modify that 33 // This lock protects |g_browser_threads|. Do not read or modify that
33 // array without holding this lock. Do not block while holding this 34 // array without holding this lock. Do not block while holding this
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 AtomicWord* storage = reinterpret_cast<AtomicWord*>( 412 AtomicWord* storage = reinterpret_cast<AtomicWord*>(
412 &g_browser_thread_delegates[identifier]); 413 &g_browser_thread_delegates[identifier]);
413 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 414 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
414 storage, reinterpret_cast<AtomicWord>(delegate)); 415 storage, reinterpret_cast<AtomicWord>(delegate));
415 416
416 // This catches registration when previously registered. 417 // This catches registration when previously registered.
417 DCHECK(!delegate || !old_pointer); 418 DCHECK(!delegate || !old_pointer);
418 } 419 }
419 420
420 } // namespace content 421 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/public/browser/browser_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698