1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/gpu/in_process_gpu_thread.h"
7 #include "content/gpu/gpu_child_thread.h"
8 #include "content/gpu/gpu_process.h"
12 InProcessGpuThread::InProcessGpuThread(const std::string
& channel_id
)
13 : base::Thread("Chrome_InProcGpuThread"),
14 channel_id_(channel_id
),
18 InProcessGpuThread::~InProcessGpuThread() {
22 void InProcessGpuThread::Init() {
23 gpu_process_
= new GpuProcess();
24 // The process object takes ownership of the thread object, so do not
25 // save and delete the pointer.
26 gpu_process_
->set_main_thread(new GpuChildThread(channel_id_
));
29 void InProcessGpuThread::CleanUp() {
30 SetThreadWasQuitProperly(true);
34 base::Thread
* CreateInProcessGpuThread(const std::string
& channel_id
) {
35 return new InProcessGpuThread(channel_id
);
38 } // namespace content