Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: content/public/browser/browser_thread_delegate.h

Issue 1011683002: Lazily initialize MessageLoop for faster thread startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/test/test_browser_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 schedule to run Init() before the 13 // If registered as such, it will schedule to run Init() before the
14 // message loop begins and the schedule InitAsync() as the first 14 // message loop begins and the schedule InitAsync() as the first
15 // task on its message loop (after the BrowserThread has done its own 15 // task on its message loop (after the BrowserThread has done its own
16 // initialization), and receive a CleanUp call right after the message 16 // initialization), and receive a CleanUp call right after the message
17 // loop ends (and before the BrowserThread has done its own clean-up). 17 // loop ends (and before the BrowserThread has done its own clean-up).
18 class BrowserThreadDelegate { 18 class BrowserThreadDelegate {
19 public: 19 public:
20 virtual ~BrowserThreadDelegate() {} 20 virtual ~BrowserThreadDelegate() {}
21 21
22 // Called prior to starting the message loop 22 // Called prior to starting the message loop
23 virtual void Init() = 0; 23 virtual void Init() = 0;
24 24
25 // Called as the first task on the thread's message loop.
26 virtual void InitAsync() = 0;
27
28 // Called just after the message loop ends. 25 // Called just after the message loop ends.
29 virtual void CleanUp() = 0; 26 virtual void CleanUp() = 0;
30 }; 27 };
31 28
32 } // namespace content 29 } // namespace content
33 30
34 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ 31 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/public/test/test_browser_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698