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

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
« no previous file with comments | « content/browser/gpu/gpu_client.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
73 // may have been killed). The caller should normally
74 // make 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 gpu::GpuProcessHostActivityFlags activity_flags_; 295 gpu::GpuProcessHostActivityFlags activity_flags_;
286 296
287 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_; 297 base::WeakPtrFactory<GpuProcessHost> weak_ptr_factory_;
288 298
289 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); 299 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
290 }; 300 };
291 301
292 } // namespace content 302 } // namespace content
293 303
294 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ 304 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_client.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698