| OLD | NEW |
| 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 #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 | 7 |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 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 10 matching lines...) Expand all Loading... |
| 21 // Special constructor for the main (UI) thread and unittests. If a | 21 // Special constructor for the main (UI) thread and unittests. If a |
| 22 // |message_loop| is provied, we use a dummy thread here since the main | 22 // |message_loop| is provied, we use a dummy thread here since the main |
| 23 // thread already exists. | 23 // thread already exists. |
| 24 BrowserThreadImpl(BrowserThread::ID identifier, | 24 BrowserThreadImpl(BrowserThread::ID identifier, |
| 25 base::MessageLoop* message_loop); | 25 base::MessageLoop* message_loop); |
| 26 virtual ~BrowserThreadImpl(); | 26 virtual ~BrowserThreadImpl(); |
| 27 | 27 |
| 28 static void ShutdownThreadPool(); | 28 static void ShutdownThreadPool(); |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 virtual void Init() OVERRIDE; | 31 virtual void Init() override; |
| 32 virtual void Run(base::MessageLoop* message_loop) OVERRIDE; | 32 virtual void Run(base::MessageLoop* message_loop) override; |
| 33 virtual void CleanUp() OVERRIDE; | 33 virtual void CleanUp() override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // We implement all the functionality of the public BrowserThread | 36 // We implement all the functionality of the public BrowserThread |
| 37 // functions, but state is stored in the BrowserThreadImpl to keep | 37 // functions, but state is stored in the BrowserThreadImpl to keep |
| 38 // the API cleaner. Therefore make BrowserThread a friend class. | 38 // the API cleaner. Therefore make BrowserThread a friend class. |
| 39 friend class BrowserThread; | 39 friend class BrowserThread; |
| 40 | 40 |
| 41 // The following are unique function names that makes it possible to tell | 41 // The following are unique function names that makes it possible to tell |
| 42 // the thread id from the callstack alone in crash dumps. | 42 // the thread id from the callstack alone in crash dumps. |
| 43 void UIThreadRun(base::MessageLoop* message_loop); | 43 void UIThreadRun(base::MessageLoop* message_loop); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 64 static void FlushThreadPoolHelperForTesting(); | 64 static void FlushThreadPoolHelperForTesting(); |
| 65 | 65 |
| 66 // The identifier of this thread. Only one thread can exist with a given | 66 // The identifier of this thread. Only one thread can exist with a given |
| 67 // identifier at a given time. | 67 // identifier at a given time. |
| 68 ID identifier_; | 68 ID identifier_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace content | 71 } // namespace content |
| 72 | 72 |
| 73 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 73 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
| OLD | NEW |