| OLD | NEW |
| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 struct EstablishRequest { | 58 struct EstablishRequest { |
| 59 explicit EstablishRequest(CauseForGpuLaunch); | 59 explicit EstablishRequest(CauseForGpuLaunch); |
| 60 ~EstablishRequest(); | 60 ~EstablishRequest(); |
| 61 base::WaitableEvent event; | 61 base::WaitableEvent event; |
| 62 CauseForGpuLaunch cause_for_gpu_launch; | 62 CauseForGpuLaunch cause_for_gpu_launch; |
| 63 int gpu_host_id; | 63 int gpu_host_id; |
| 64 bool reused_gpu_process; | 64 bool reused_gpu_process; |
| 65 IPC::ChannelHandle channel_handle; | 65 IPC::ChannelHandle channel_handle; |
| 66 GPUInfo gpu_info; | 66 gpu::GPUInfo gpu_info; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 BrowserGpuChannelHostFactory(); | 69 BrowserGpuChannelHostFactory(); |
| 70 virtual ~BrowserGpuChannelHostFactory(); | 70 virtual ~BrowserGpuChannelHostFactory(); |
| 71 | 71 |
| 72 void CreateViewCommandBufferOnIO( | 72 void CreateViewCommandBufferOnIO( |
| 73 CreateRequest* request, | 73 CreateRequest* request, |
| 74 int32 surface_id, | 74 int32 surface_id, |
| 75 const GPUCreateCommandBufferConfig& init_params); | 75 const GPUCreateCommandBufferConfig& init_params); |
| 76 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id); | 76 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id); |
| 77 void CreateImageOnIO( | 77 void CreateImageOnIO( |
| 78 gfx::PluginWindowHandle window, | 78 gfx::PluginWindowHandle window, |
| 79 int32 image_id, | 79 int32 image_id, |
| 80 const CreateImageCallback& callback); | 80 const CreateImageCallback& callback); |
| 81 static void ImageCreatedOnIO( | 81 static void ImageCreatedOnIO( |
| 82 const CreateImageCallback& callback, const gfx::Size size); | 82 const CreateImageCallback& callback, const gfx::Size size); |
| 83 static void OnImageCreated( | 83 static void OnImageCreated( |
| 84 const CreateImageCallback& callback, const gfx::Size size); | 84 const CreateImageCallback& callback, const gfx::Size size); |
| 85 void DeleteImageOnIO(int32 image_id, int32 sync_point); | 85 void DeleteImageOnIO(int32 image_id, int32 sync_point); |
| 86 void EstablishGpuChannelOnIO(EstablishRequest* request); | 86 void EstablishGpuChannelOnIO(EstablishRequest* request); |
| 87 void GpuChannelEstablishedOnIO( | 87 void GpuChannelEstablishedOnIO( |
| 88 EstablishRequest* request, | 88 EstablishRequest* request, |
| 89 const IPC::ChannelHandle& channel_handle, | 89 const IPC::ChannelHandle& channel_handle, |
| 90 const GPUInfo& gpu_info); | 90 const gpu::GPUInfo& gpu_info); |
| 91 static void AddFilterOnIO( | 91 static void AddFilterOnIO( |
| 92 int gpu_host_id, | 92 int gpu_host_id, |
| 93 scoped_refptr<IPC::ChannelProxy::MessageFilter> filter); | 93 scoped_refptr<IPC::ChannelProxy::MessageFilter> filter); |
| 94 | 94 |
| 95 int gpu_client_id_; | 95 int gpu_client_id_; |
| 96 scoped_ptr<base::WaitableEvent> shutdown_event_; | 96 scoped_ptr<base::WaitableEvent> shutdown_event_; |
| 97 scoped_refptr<GpuChannelHost> gpu_channel_; | 97 scoped_refptr<GpuChannelHost> gpu_channel_; |
| 98 int gpu_host_id_; | 98 int gpu_host_id_; |
| 99 | 99 |
| 100 static BrowserGpuChannelHostFactory* instance_; | 100 static BrowserGpuChannelHostFactory* instance_; |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); | 102 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace content | 105 } // namespace content |
| 106 | 106 |
| 107 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ | 107 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ |
| OLD | NEW |