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

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

Issue 2250473005: content: Fix Context creation logic in ContextProviderFactoryImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: run the callback once, fix comments. Created 4 years, 4 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_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 10 matching lines...) Expand all
21 21
22 namespace content { 22 namespace content {
23 class BrowserGpuMemoryBufferManager; 23 class BrowserGpuMemoryBufferManager;
24 24
25 class CONTENT_EXPORT BrowserGpuChannelHostFactory 25 class CONTENT_EXPORT BrowserGpuChannelHostFactory
26 : public gpu::GpuChannelHostFactory, 26 : public gpu::GpuChannelHostFactory,
27 public gpu::GpuChannelEstablishFactory { 27 public gpu::GpuChannelEstablishFactory {
28 public: 28 public:
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
32 // The instance can be null during shutdown.
31 static BrowserGpuChannelHostFactory* instance() { return instance_; } 33 static BrowserGpuChannelHostFactory* instance() { return instance_; }
32 34
33 // Overridden from gpu::GpuChannelHostFactory: 35 // Overridden from gpu::GpuChannelHostFactory:
34 bool IsMainThread() override; 36 bool IsMainThread() override;
35 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 37 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
36 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 38 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
37 size_t size) override; 39 size_t size) override;
38 40
39 int GpuProcessHostId() { return gpu_host_id_; } 41 int GpuProcessHostId() { return gpu_host_id_; }
40 gpu::GpuChannelHost* GetGpuChannel(); 42 gpu::GpuChannelHost* GetGpuChannel();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_; 76 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_;
75 77
76 static BrowserGpuChannelHostFactory* instance_; 78 static BrowserGpuChannelHostFactory* instance_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 80 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
79 }; 81 };
80 82
81 } // namespace content 83 } // namespace content
82 84
83 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 85 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698