summaryrefslogtreecommitdiffstats
path: root/content/renderer/in_process_renderer_thread.cc
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 16:41:30 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-04 16:41:30 +0000
commit8707caab1cf84a32152b86a955b536a46cb6cdd1 (patch)
tree8b49b2f963802e1ac4719437556cfa69d0f697cc /content/renderer/in_process_renderer_thread.cc
parent70f5332e3042f489cb19e77e232a2cf347202b31 (diff)
downloadchromium_src-8707caab1cf84a32152b86a955b536a46cb6cdd1.zip
chromium_src-8707caab1cf84a32152b86a955b536a46cb6cdd1.tar.gz
chromium_src-8707caab1cf84a32152b86a955b536a46cb6cdd1.tar.bz2
Fix names of in-process threads, tidy gpu DEPS
Follow-up after http://crrev.com/217968 per comments on https://chromiumcodereview.appspot.com/23235002/ R=jam@chromium.org BUG=237249 Review URL: https://chromiumcodereview.appspot.com/23452016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221199 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/in_process_renderer_thread.cc')
-rw-r--r--content/renderer/in_process_renderer_thread.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/content/renderer/in_process_renderer_thread.cc b/content/renderer/in_process_renderer_thread.cc
new file mode 100644
index 0000000..fa6b834
--- /dev/null
+++ b/content/renderer/in_process_renderer_thread.cc
@@ -0,0 +1,45 @@
+// Copyright 2013 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.
+
+#include "content/renderer/in_process_renderer_thread.h"
+
+#include "content/renderer/render_process.h"
+#include "content/renderer/render_process_impl.h"
+#include "content/renderer/render_thread_impl.h"
+
+namespace content {
+
+InProcessRendererThread::InProcessRendererThread(const std::string& channel_id)
+ : Thread("Chrome_InProcRendererThread"), channel_id_(channel_id) {
+}
+
+InProcessRendererThread::~InProcessRendererThread() {
+ Stop();
+}
+
+void InProcessRendererThread::Init() {
+ render_process_.reset(new RenderProcessImpl());
+ new RenderThreadImpl(channel_id_);
+}
+
+void InProcessRendererThread::CleanUp() {
+ render_process_.reset();
+
+ // It's a little lame to manually set this flag. But the single process
+ // RendererThread will receive the WM_QUIT. We don't need to assert on
+ // this thread, so just force the flag manually.
+ // If we want to avoid this, we could create the InProcRendererThread
+ // directly with _beginthreadex() rather than using the Thread class.
+ // We used to set this flag in the Init function above. However there
+ // other threads like WebThread which are created by this thread
+ // which resets this flag. Please see Thread::StartWithOptions. Setting
+ // this flag to true in Cleanup works around these problems.
+ SetThreadWasQuitProperly(true);
+}
+
+base::Thread* CreateInProcessRendererThread(const std::string& channel_id) {
+ return new InProcessRendererThread(channel_id);
+}
+
+} // namespace content