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 // BrowserThread::SetDelegate was deprecated, this is now only used by |
11 // BrowserThread::SetDelegate. | 11 // BrowserThread::SetIOThreadDelegate. |
12 // | 12 // |
13 // If registered as such, it will schedule to run Init() before the | 13 // When registered as such, it will schedule to run Init() before the message |
14 // message loop begins and the schedule InitAsync() as the first | 14 // loop begins and receive a CleanUp call right after the message loop ends (and |
15 // task on its message loop (after the BrowserThread has done its own | 15 // before the BrowserThread has done its own clean-up). |
16 // initialization), and receive a CleanUp call right after the message | |
17 // loop ends (and before the BrowserThread has done its own clean-up). | |
18 class BrowserThreadDelegate { | 16 class BrowserThreadDelegate { |
19 public: | 17 public: |
20 virtual ~BrowserThreadDelegate() {} | 18 virtual ~BrowserThreadDelegate() = default; |
21 | 19 |
22 // Called prior to starting the message loop | 20 // Called prior to starting the message loop |
23 virtual void Init() = 0; | 21 virtual void Init() = 0; |
24 | 22 |
25 // Called just after the message loop ends. | 23 // Called just after the message loop ends. |
26 virtual void CleanUp() = 0; | 24 virtual void CleanUp() = 0; |
27 }; | 25 }; |
28 | 26 |
29 } // namespace content | 27 } // namespace content |
30 | 28 |
31 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ | 29 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
OLD | NEW |