Chromium Code Reviews| Index: content/public/browser/browser_thread_delegate.h |
| diff --git a/content/public/browser/browser_thread_delegate.h b/content/public/browser/browser_thread_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c2055355735deb8fcb931efb10917178dd41ab83 |
| --- /dev/null |
| +++ b/content/public/browser/browser_thread_delegate.h |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
| +#define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |
| +#pragma once |
| + |
| +namespace content { |
| + |
| +// A class with this type may be registered via |
| +// BrowserThread::SetDelegate. |
| +// |
| +// If registered as such, it will receive an Init() call right before |
| +// the BrowserThread in question starts its message loop (and right |
| +// after the BrowserThread has done its own initialization), and a |
| +// CleanUp call right after the message loop ends (and before the |
| +// BrowserThread has done its own clean-up). |
| +class BrowserThreadDelegate { |
| + public: |
| + BrowserThreadDelegate() {} |
|
jam
2011/11/23 22:39:35
nit: we've been avoiding these in the content API
Jói
2011/11/28 12:51:15
Done.
|
| + virtual ~BrowserThreadDelegate() {} |
| + |
| + // Called just prior to starting the message loop. |
| + virtual void Init() = 0; |
| + |
| + // Called just after the message loop ends. |
| + virtual void CleanUp() = 0; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_DELEGATE_H_ |