Index: content/public/browser/io_thread_delegate.h |
diff --git a/content/public/browser/io_thread_delegate.h b/content/public/browser/io_thread_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8710fdb5f75498ad5e2029b874d9d57d1733cf67 |
--- /dev/null |
+++ b/content/public/browser/io_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_IO_THREAD_DELEGATE_H_ |
+#define CONTENT_PUBLIC_BROWSER_IO_THREAD_DELEGATE_H_ |
+#pragma once |
+ |
+#include "base/basictypes.h" |
+ |
+namespace content { |
+ |
+// Some embedders may want to attach complex state to the IO thread, |
+// that is initialized before anything else happens on the thread, and |
+// torn down as the last thing that occurs on the thread. |
+// |
+// This is the interface to the object implementors need to provide |
+// via BrowserMainParts::PreMainMessageLoopRun to enable such |
+// initialization and teardown. |
+class IOThreadDelegate { |
+ public: |
+ virtual ~IOThreadDelegate() {} |
+ |
+ // Called as the first thing to happen on the IO thread. |
+ virtual void Init() = 0; |
+ |
+ // Called as the last thing processed on the IO thread. |
+ virtual void CleanUp() = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_IO_THREAD_DELEGATE_H_ |