OLD | NEW |
(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 bool InitializeAndStartSandbox(const base::CommandLine& command_line); |
| 40 |
| 41 const GPUInfo& gpu_info() const { return gpu_info_; } |
| 42 GpuWatchdogThread* watchdog_thread() { return watchdog_thread_.get(); } |
| 43 |
| 44 private: |
| 45 GpuSandboxHelper* sandbox_helper_ = nullptr; |
| 46 scoped_refptr<GpuWatchdogThread> watchdog_thread_; |
| 47 GPUInfo gpu_info_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(GpuInit); |
| 50 }; |
| 51 |
| 52 } // namespace gpu |
| 53 |
| 54 #endif // GPU_IPC_SERVICE_GPU_INIT_H_ |
OLD | NEW |