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

Side by Side Diff: content/browser/gpu/gpu_process_host.h

Issue 2805623002: gpu: Notify callbacks the reason for channel creation failure (Closed)
Patch Set: . Created 3 years, 8 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 public IPC::Sender, 59 public IPC::Sender,
60 public ui::mojom::GpuHost, 60 public ui::mojom::GpuHost,
61 public base::NonThreadSafe { 61 public base::NonThreadSafe {
62 public: 62 public:
63 enum GpuProcessKind { 63 enum GpuProcessKind {
64 GPU_PROCESS_KIND_UNSANDBOXED, 64 GPU_PROCESS_KIND_UNSANDBOXED,
65 GPU_PROCESS_KIND_SANDBOXED, 65 GPU_PROCESS_KIND_SANDBOXED,
66 GPU_PROCESS_KIND_COUNT 66 GPU_PROCESS_KIND_COUNT
67 }; 67 };
68 68
69 typedef base::Callback<void(const IPC::ChannelHandle&, const gpu::GPUInfo&)> 69 enum class EstablishChannelStatus {
70 EstablishChannelCallback; 70 GPU_ACCESS_DENIED, // GPU access was not allowed.
71 GPU_HOST_INVALID, // Request failed because the gpu host became invalid
72 // while processing the request (e.g. the gpu process may
73 // have been killed). The caller should normally make
74 // another request to establish a new channel.
75 SUCCESS
76 };
77 using EstablishChannelCallback =
78 base::Callback<void(const IPC::ChannelHandle&,
79 const gpu::GPUInfo&,
80 EstablishChannelStatus status)>;
71 81
72 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)> 82 typedef base::Callback<void(const gfx::GpuMemoryBufferHandle& handle)>
73 CreateGpuMemoryBufferCallback; 83 CreateGpuMemoryBufferCallback;
74 84
75 static bool gpu_enabled() { return gpu_enabled_; } 85 static bool gpu_enabled() { return gpu_enabled_; }
76 static int gpu_crash_count() { return gpu_crash_count_; } 86 static int gpu_crash_count() { return gpu_crash_count_; }
77 87
78 // Creates a new GpuProcessHost (if |force_create| is turned on) or gets an 88 // Creates a new GpuProcessHost (if |force_create| is turned on) or gets an
79 // existing one, resulting in the launching of a GPU process if required. 89 // existing one, resulting in the launching of a GPU process if required.
80 // Returns null on failure. It is not safe to store the pointer once control 90 // Returns null on failure. It is not safe to store the pointer once control
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 gpu::GpuProcessHostActivityFlags activity_flags_; 298 gpu::GpuProcessHostActivityFlags activity_flags_;
289 299
290 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; 300 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_;
291 301
292 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 302 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
293 }; 303 };
294 304
295 } // namespace content 305 } // namespace content
296 306
297 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 307 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698