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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.h

Issue 2197613003: gpu: Introduce GpuChannelEstablishFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/browser_gpu_channel_host_factory.h
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.h b/content/browser/gpu/browser_gpu_channel_host_factory.h
index aaf7f09f2f9f4329480deb478a7c6c1b139d6989..759f936a067330a8345df7b06277116e435c64e8 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.h
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.h
@@ -23,7 +23,8 @@ namespace content {
class BrowserGpuMemoryBufferManager;
class CONTENT_EXPORT BrowserGpuChannelHostFactory
- : public gpu::GpuChannelHostFactory {
+ : public gpu::GpuChannelHostFactory,
+ public gpu::GpuChannelEstablishFactory {
public:
static void Initialize(bool establish_gpu_channel);
static void Terminate();
@@ -36,16 +37,17 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory
size_t size) override;
int GpuProcessHostId() { return gpu_host_id_; }
-#if !defined(OS_ANDROID)
- scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync();
-#endif
- void EstablishGpuChannel(const base::Closure& callback);
gpu::GpuChannelHost* GetGpuChannel();
int GetGpuChannelId() { return gpu_client_id_; }
// Used to skip GpuChannelHost tests when there can be no GPU process.
static bool CanUseForTesting();
+ // Overridden from gpu::GpuChannelEstablishFactory:
+ void EstablishGpuChannel(
+ const gpu::GpuChannelEstablishedCallback& callback) override;
+ scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override;
+
private:
struct CreateRequest;
class EstablishRequest;
@@ -67,7 +69,7 @@ class CONTENT_EXPORT BrowserGpuChannelHostFactory
std::unique_ptr<BrowserGpuMemoryBufferManager> gpu_memory_buffer_manager_;
int gpu_host_id_;
scoped_refptr<EstablishRequest> pending_request_;
- std::vector<base::Closure> established_callbacks_;
+ std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks_;
static BrowserGpuChannelHostFactory* instance_;

Powered by Google App Engine
This is Rietveld 408576698