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

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.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 | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.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_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 18 matching lines...) Expand all
29 static void Initialize(bool establish_gpu_channel); 29 static void Initialize(bool establish_gpu_channel);
30 static void Terminate(); 30 static void Terminate();
31 static BrowserGpuChannelHostFactory* instance() { return instance_; } 31 static BrowserGpuChannelHostFactory* instance() { return instance_; }
32 32
33 // Overridden from gpu::GpuChannelHostFactory: 33 // Overridden from gpu::GpuChannelHostFactory:
34 bool IsMainThread() override; 34 bool IsMainThread() override;
35 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 35 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
36 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 36 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
37 size_t size) override; 37 size_t size) override;
38 38
39 int GpuProcessHostId() { return gpu_host_id_; }
40 gpu::GpuChannelHost* GetGpuChannel(); 39 gpu::GpuChannelHost* GetGpuChannel();
41 int GetGpuChannelId() { return gpu_client_id_; } 40 int GetGpuChannelId() { return gpu_client_id_; }
42 41
43 // Closes the channel to the GPU process. This should be called before the IO 42 // Closes the channel to the GPU process. This should be called before the IO
44 // thread stops. 43 // thread stops.
45 void CloseChannel(); 44 void CloseChannel();
46 45
47 // Used to skip GpuChannelHost tests when there can be no GPU process. 46 // Used to skip GpuChannelHost tests when there can be no GPU process.
48 static bool CanUseForTesting(); 47 static bool CanUseForTesting();
49 48
(...skipping 15 matching lines...) Expand all
65 void GpuChannelEstablished(); 64 void GpuChannelEstablished();
66 65
67 static void InitializeShaderDiskCacheOnIO(int gpu_client_id, 66 static void InitializeShaderDiskCacheOnIO(int gpu_client_id,
68 const base::FilePath& cache_dir); 67 const base::FilePath& cache_dir);
69 68
70 const int gpu_client_id_; 69 const int gpu_client_id_;
71 const uint64_t gpu_client_tracing_id_; 70 const uint64_t gpu_client_tracing_id_;
72 std::unique_ptr<base::WaitableEvent> shutdown_event_; 71 std::unique_ptr<base::WaitableEvent> shutdown_event_;
73 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; 72 scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
74 std::unique_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_; 73 std::unique_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_;
75 int gpu_host_id_;
76 scoped_refptr<EstablishRequest> pending_request_; 74 scoped_refptr<EstablishRequest> pending_request_;
77 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; 75 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_;
78 76
79 static BrowserGpuChannelHostFactory* instance_; 77 static BrowserGpuChannelHostFactory* instance_;
80 78
81 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 79 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
82 }; 80 };
83 81
84 } // namespace content 82 } // namespace content
85 83
86 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 84 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698