summaryrefslogtreecommitdiffstats
path: root/content/browser/in_process_webkit/webkit_thread.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:40:50 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 17:40:50 +0000
commit567812dd45d36e093554664bdbd4284a9670a8b3 (patch)
tree803b8da070eabfd2efa6a50b53f331c4255bbbc6 /content/browser/in_process_webkit/webkit_thread.h
parentabe19c107967234fce377db157b8b963f83ec529 (diff)
downloadchromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.zip
chromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.tar.gz
chromium_src-567812dd45d36e093554664bdbd4284a9670a8b3.tar.bz2
Move in_process_webkit dir from chrome\browser to content\browser.
Review URL: http://codereview.chromium.org/6580019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/in_process_webkit/webkit_thread.h')
-rw-r--r--content/browser/in_process_webkit/webkit_thread.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/content/browser/in_process_webkit/webkit_thread.h b/content/browser/in_process_webkit/webkit_thread.h
new file mode 100644
index 0000000..a677379
--- /dev/null
+++ b/content/browser/in_process_webkit/webkit_thread.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 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_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_THREAD_H_
+#define CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_THREAD_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "base/threading/thread.h"
+#include "content/browser/browser_thread.h"
+
+class BrowserWebKitClientImpl;
+
+// This creates a WebKit main thread on instantiation (if not in
+// --single-process mode) on construction and kills it on deletion.
+class WebKitThread {
+ public:
+ // Called from the UI thread.
+ WebKitThread();
+ ~WebKitThread();
+ void Initialize();
+
+ private:
+ // Must be private so that we can carefully control its lifetime.
+ class InternalWebKitThread : public BrowserThread {
+ public:
+ InternalWebKitThread();
+ virtual ~InternalWebKitThread();
+ // Does the actual initialization and shutdown of WebKit. Called at the
+ // beginning and end of the thread's lifetime.
+ virtual void Init();
+ virtual void CleanUp();
+
+ private:
+ // The WebKitClient implementation. Only access on WebKit thread.
+ scoped_ptr<BrowserWebKitClientImpl> webkit_client_;
+ };
+
+ // Pointer to the actual WebKitThread.
+ scoped_ptr<InternalWebKitThread> webkit_thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebKitThread);
+};
+
+#endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_THREAD_H_