Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: gpu/ipc/service/gpu_init.h

Issue 2322123002: gpu: Introduce GpuInit. (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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
5 #ifndef GPU_IPC_SERVICE_GPU_INIT_H_
6 #define GPU_IPC_SERVICE_GPU_INIT_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "gpu/config/gpu_info.h"
11 #include "gpu/gpu_export.h"
12
13 namespace base {
14 class CommandLine;
15 }
16
17 namespace gpu {
18
19 class GpuWatchdogThread;
20
21 class GPU_EXPORT GpuSandboxHelper {
22 public:
23 virtual ~GpuSandboxHelper() {}
24
25 virtual void PreSandboxStartup() = 0;
26
27 virtual bool EnsureSandboxInitialized() = 0;
28 };
29
30 class GPU_EXPORT GpuInit {
31 public:
32 GpuInit();
33 ~GpuInit();
34
35 void set_sandbox_helper(GpuSandboxHelper* helper) {
36 sandbox_helper_ = helper;
37 }
38
39 void InitializeAndStartSandbox(const base::CommandLine& command_line);
40
41 const GPUInfo& gpu_info() const { return gpu_info_; }
42 bool dead_on_arrival() const { return dead_on_arrival_; }
43 GpuWatchdogThread* watchdog_thread() { return watchdog_thread_.get(); }
44
45 private:
46 bool IsDeadOnArrival() const;
47
48 GpuSandboxHelper* sandbox_helper_ = nullptr;
49 scoped_refptr<GpuWatchdogThread> watchdog_thread_;
50 GPUInfo gpu_info_;
51 bool dead_on_arrival_ = false;
52
53 DISALLOW_COPY_AND_ASSIGN(GpuInit);
54 };
55
56 } // namespace gpu
57
58 #endif // GPU_IPC_SERVICE_GPU_INIT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698