Index: content/gpu/gpu_main_thread.cc |
diff --git a/content/gpu/gpu_main_thread.cc b/content/gpu/gpu_main_thread.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..65fef13b3605b0793f4854feecbb7f5b933d8f03 |
--- /dev/null |
+++ b/content/gpu/gpu_main_thread.cc |
@@ -0,0 +1,37 @@ |
+// 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/gpu/gpu_main_thread.h" |
+ |
+#include "content/gpu/gpu_child_thread.h" |
+#include "content/gpu/gpu_process.h" |
+ |
+namespace content { |
+ |
+GpuMainThread::GpuMainThread(const std::string& channel_id) |
+ : base::Thread("Chrome_InProcGpuThread"), |
+ channel_id_(channel_id), |
+ gpu_process_(NULL) { |
+} |
+ |
+GpuMainThread::~GpuMainThread() { |
+ Stop(); |
+} |
+ |
+void GpuMainThread::Init() { |
+ gpu_process_ = new GpuProcess(); |
+ // The process object takes ownership of the thread object, so do not |
+ // save and delete the pointer. |
+ gpu_process_->set_main_thread(new GpuChildThread(channel_id_)); |
+} |
+ |
+void GpuMainThread::CleanUp() { |
+ delete gpu_process_; |
+} |
+ |
+base::Thread* CreateGpuMainThread(const std::string& channel_id) { |
+ return new GpuMainThread(channel_id); |
+} |
+ |
+} // namespace content |