blob: e8e0140dc2809ff7ca23003176e3b2ccc632b1fc [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"
10
11namespace content {
12
13class GpuProcess;
14
15// This class creates a GPU thread (instead of a GPU process), when running
16// with --in-process-gpu or --single-process.
[email protected]8707caa2013-09-04 16:41:3017class InProcessGpuThread : public base::Thread {
[email protected]d7a2d892013-08-16 07:45:3618 public:
[email protected]8707caa2013-09-04 16:41:3019 explicit InProcessGpuThread(const std::string& channel_id);
dchenge933b3e2014-10-21 11:44:0920 ~InProcessGpuThread() override;
[email protected]d7a2d892013-08-16 07:45:3621
22 protected:
dchenge933b3e2014-10-21 11:44:0923 void Init() override;
24 void CleanUp() override;
[email protected]d7a2d892013-08-16 07:45:3625
26 private:
27 std::string channel_id_;
28 // Deleted in CleanUp() on the gpu thread, so don't use smart pointers.
29 GpuProcess* gpu_process_;
30
[email protected]8707caa2013-09-04 16:41:3031 DISALLOW_COPY_AND_ASSIGN(InProcessGpuThread);
[email protected]d7a2d892013-08-16 07:45:3632};
33
[email protected]8707caa2013-09-04 16:41:3034CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
35 const std::string& channel_id);
[email protected]d7a2d892013-08-16 07:45:3636
37} // namespace content
38
[email protected]8707caa2013-09-04 16:41:3039#endif // CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_