OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 7 |
| 8 namespace content { |
| 9 |
| 10 struct GPUMemoryUmaStats; |
| 11 |
| 12 class GpuChannelManagerDelegate { |
| 13 public: |
| 14 // Tells the delegate that a context has subscribed to a new target and |
| 15 // the browser should start sending the corresponding information |
| 16 virtual void AddSubscription(int32_t client_id, unsigned int target) = 0; |
| 17 |
| 18 // Tells the delegate to cache the given shader information in persistent |
| 19 // storage. The embedder is expected tor epopulate the in-memory cache through |
| 20 // the respective GpuChannelManager API. |
| 21 virtual void StoreShaderToDisk(int32_t client_id, |
| 22 const std::string& key, |
| 23 const std::string& shader) = 0; |
| 24 |
| 25 // Response from GPU to an EstablishChannel request. |
| 26 virtual void ChannelEstablished(const IPC::ChannelHandle& channel_handle) = 0; |
| 27 |
| 28 // Tells the delegate that an offscreen context was created for the provided |
| 29 // |active_url|. |
| 30 virtual void DidCreateOffscreenContext(const GURL& active_url) = 0; |
| 31 |
| 32 // Notification from GPU that the channel is destroyed. |
| 33 virtual void DidDestroyChannel(int client_id) = 0; |
| 34 |
| 35 // Tells the delegate that an offscreen context was destroyed for the provided |
| 36 // |active_url|. |
| 37 virtual void DidDestroyOffscreenContext(const GURL& active_url) = 0; |
| 38 |
| 39 // Tells the delegate that a context was lost. |
| 40 virtual void DidLoseContext(bool offscreen, |
| 41 gpu::error::ContextLostReason reason, |
| 42 const GURL& active_url) = 0; |
| 43 |
| 44 // Tells the delegate about GPU memory usage statistics for UMA logging. |
| 45 virtual void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) = 0; |
| 46 |
| 47 // Tells the delegate that no contexts are subscribed to the target anymore |
| 48 // so the delegate should stop sending the corresponding information. |
| 49 virtual void RemoveSubscription(int32_t client_id, unsigned int target) = 0; |
| 50 |
| 51 protected: |
| 52 virtual ~GpuChannelManagerDelegate() {} |
| 53 }; |
| 54 |
| 55 } // namespace content |
| 56 |
| 57 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
OLD | NEW |