blob: 37167303fd128d3d4fc96d436eb29395040770f0 [file] [log] [blame]
[email protected]d7a2d892013-08-16 07:45:361// 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.
4
[email protected]8707caa2013-09-04 16:41:305#ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
6#define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
[email protected]d7a2d892013-08-16 07:45:367
8#include "base/threading/thread.h"
9#include "content/common/content_export.h"
morritac6238ab2015-03-18 01:48:2910#include "content/common/in_process_child_thread_params.h"
[email protected]d7a2d892013-08-16 07:45:3611
12namespace content {
13
grt8c648422015-06-29 18:17:1714class GpuMemoryBufferFactory;
[email protected]d7a2d892013-08-16 07:45:3615class GpuProcess;
16
17// This class creates a GPU thread (instead of a GPU process), when running
18// with --in-process-gpu or --single-process.
[email protected]8707caa2013-09-04 16:41:3019class InProcessGpuThread : public base::Thread {
[email protected]d7a2d892013-08-16 07:45:3620 public:
morritac6238ab2015-03-18 01:48:2921 InProcessGpuThread(const InProcessChildThreadParams& params);
dchenge933b3e2014-10-21 11:44:0922 ~InProcessGpuThread() override;
[email protected]d7a2d892013-08-16 07:45:3623
24 protected:
dchenge933b3e2014-10-21 11:44:0925 void Init() override;
26 void CleanUp() override;
[email protected]d7a2d892013-08-16 07:45:3627
28 private:
morritac6238ab2015-03-18 01:48:2929 InProcessChildThreadParams params_;
30
[email protected]d7a2d892013-08-16 07:45:3631 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
32 GpuProcess* gpu_process_;
33
grt8c648422015-06-29 18:17:1734 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
35
[email protected]8707caa2013-09-04 16:41:3036 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread);
[email protected]d7a2d892013-08-16 07:45:3637};
38
[email protected]8707caa2013-09-04 16:41:3039CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
morritac6238ab2015-03-18 01:48:2940 const InProcessChildThreadParams& params);
[email protected]d7a2d892013-08-16 07:45:3641
42} // namespace content
43
[email protected]8707caa2013-09-04 16:41:3044#endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_