OLD | NEW |
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 #ifndef CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const tracked_objects::Location& from_here, | 30 const tracked_objects::Location& from_here, |
31 Task* task, | 31 Task* task, |
32 int64 delay_ms, | 32 int64 delay_ms, |
33 bool nestable); | 33 bool nestable); |
34 static bool PostTaskHelper( | 34 static bool PostTaskHelper( |
35 BrowserThread::ID identifier, | 35 BrowserThread::ID identifier, |
36 const tracked_objects::Location& from_here, | 36 const tracked_objects::Location& from_here, |
37 const base::Closure& task, | 37 const base::Closure& task, |
38 int64 delay_ms, | 38 int64 delay_ms, |
39 bool nestable); | 39 bool nestable); |
40 | |
41 // This lock protects |browser_threads_|. Do not read or modify that array | |
42 // without holding this lock. Do not block while holding this lock. | |
43 static base::Lock lock_; | |
44 | |
45 // An array of the BrowserThread objects. This array is protected by |lock_|. | |
46 // The threads are not owned by this array. Typically, the threads are owned | |
47 // on the UI thread by the g_browser_process object. BrowserThreads remove | |
48 // themselves from this array upon destruction. | |
49 static BrowserThread* browser_threads_[ID_COUNT]; | |
50 }; | 40 }; |
51 | 41 |
52 } // namespace content | 42 } // namespace content |
53 | 43 |
54 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 44 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
OLD | NEW |