| 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_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace content { | 8 namespace content { |
| 9 | 9 |
| 10 // A class with this type may be registered via | 10 // A class with this type may be registered via |
| 11 // BrowserThread::SetDelegate. | 11 // BrowserThread::SetDelegate. |
| 12 // | 12 // |
| 13 // If registered as such, it will receive an Init() call right before | 13 // If registered as such, it will schedule to run Init() as the first |
| 14 // the BrowserThread in question starts its message loop (and right | 14 // task on its message loop (after the BrowserThread has done its own |
| 15 // after the BrowserThread has done its own initialization), and a | 15 // initialization), and receive a CleanUp call right after the message |
| 16 // CleanUp call right after the message loop ends (and before the | 16 // loop ends (and before the BrowserThread has done its own clean-up). |
| 17 // BrowserThread has done its own clean-up). | |
| 18 class BrowserThreadDelegate { | 17 class BrowserThreadDelegate { |
| 19 public: | 18 public: |
| 20 virtual ~BrowserThreadDelegate() {} | 19 virtual ~BrowserThreadDelegate() {} |
| 21 | 20 |
| 22 // Called just prior to starting the message loop. | 21 // Called as the first task on the thread's message loop. |
| 23 virtual void Init() = 0; | 22 virtual void Init() = 0; |
| 24 | 23 |
| 25 // Called just after the message loop ends. | 24 // Called just after the message loop ends. |
| 26 virtual void CleanUp() = 0; | 25 virtual void CleanUp() = 0; |
| 27 }; | 26 }; |
| 28 | 27 |
| 29 } // namespace content | 28 } // namespace content |
| 30 | 29 |
| 31 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ | 30 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
| OLD | NEW |