OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_GPU_GPU_MEMORY_BUFFER_SERVICE_H_ |
| 6 #define CONTENT_GPU_GPU_MEMORY_BUFFER_SERVICE_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/gpu/gpu_memory_buffer_service_ipc_transport.h" |
| 10 #include "ipc/message_filter.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class GpuMemoryBufferFactory; |
| 15 struct CreateGpuMemoryBufferFromHandleParams; |
| 16 struct CreateGpuMemoryBufferParams; |
| 17 |
| 18 // Message filter used to to handle GpuMsg_CreateGpuMemoryBuffer messages on |
| 19 // the IO thread. This allows the UI thread in the browser process to remain |
| 20 // fast at all times. |
| 21 class GpuMemoryBufferService |
| 22 : public GpuMemoryBufferServiceIPCTransport::Client { |
| 23 public: |
| 24 explicit GpuMemoryBufferService( |
| 25 GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
| 26 |
| 27 GpuMemoryBufferServiceIPCTransport* transport() { return transport_.get(); } |
| 28 |
| 29 private: |
| 30 ~GpuMemoryBufferService() override; |
| 31 |
| 32 // GpuMemoryBufferServiceIPCTransport::Client: |
| 33 void OnConnectionClosed() override; |
| 34 void OnCreateGpuMemoryBuffer( |
| 35 const CreateGpuMemoryBufferParams& params) override; |
| 36 void OnCreateGpuMemoryBufferFromHandle( |
| 37 const CreateGpuMemoryBufferFromHandleParams& params) override; |
| 38 |
| 39 scoped_ptr<GpuMemoryBufferServiceIPCTransport> transport_; |
| 40 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_GPU_GPU_MEMROY_BUFFER_SERVICE_H_ |
OLD | NEW |