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 "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 protected: | 28 protected: |
29 virtual void Init() OVERRIDE; | 29 virtual void Init() OVERRIDE; |
30 virtual void CleanUp() OVERRIDE; | 30 virtual void CleanUp() OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 // We implement all the functionality of the public BrowserThread | 33 // We implement all the functionality of the public BrowserThread |
34 // functions, but state is stored in the BrowserThreadImpl to keep | 34 // functions, but state is stored in the BrowserThreadImpl to keep |
35 // the API cleaner. Therefore make BrowserThread a friend class. | 35 // the API cleaner. Therefore make BrowserThread a friend class. |
36 friend class BrowserThread; | 36 friend class BrowserThread; |
37 | 37 |
38 // TODO(brettw) remove this variant when Task->Closure migration is complete. | |
39 static bool PostTaskHelper( | 38 static bool PostTaskHelper( |
40 BrowserThread::ID identifier, | 39 BrowserThread::ID identifier, |
41 const tracked_objects::Location& from_here, | 40 const tracked_objects::Location& from_here, |
42 Task* task, | |
43 int64 delay_ms, | |
44 bool nestable); | |
45 static bool PostTaskHelper( | |
46 BrowserThread::ID identifier, | |
47 const tracked_objects::Location& from_here, | |
48 const base::Closure& task, | 41 const base::Closure& task, |
49 int64 delay_ms, | 42 int64 delay_ms, |
50 bool nestable); | 43 bool nestable); |
51 | 44 |
52 // Common initialization code for the constructors. | 45 // Common initialization code for the constructors. |
53 void Initialize(); | 46 void Initialize(); |
54 | 47 |
55 // The identifier of this thread. Only one thread can exist with a given | 48 // The identifier of this thread. Only one thread can exist with a given |
56 // identifier at a given time. | 49 // identifier at a given time. |
57 ID identifier_; | 50 ID identifier_; |
58 }; | 51 }; |
59 | 52 |
60 } // namespace content | 53 } // namespace content |
61 | 54 |
62 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 55 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
OLD | NEW |