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

Unified Diff: content/public/browser/io_thread_delegate.h

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: With this patchset, Chrome runs and exits normally on Linux. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698