| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/common/constants.h" | 8 #include "gpu/command_buffer/common/constants.h" |
| 9 #include "gpu/ipc/common/surface_handle.h" | 9 #include "gpu/ipc/common/surface_handle.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 | 12 |
| 13 namespace IPC { | 13 namespace IPC { |
| 14 struct ChannelHandle; | 14 struct ChannelHandle; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace gpu { |
| 18 struct GPUMemoryUmaStats; |
| 19 } |
| 20 |
| 17 namespace content { | 21 namespace content { |
| 18 | 22 |
| 19 struct AcceleratedSurfaceBuffersSwappedParams; | 23 struct AcceleratedSurfaceBuffersSwappedParams; |
| 20 struct GPUMemoryUmaStats; | |
| 21 | 24 |
| 22 class GpuChannelManagerDelegate { | 25 class GpuChannelManagerDelegate { |
| 23 public: | 26 public: |
| 24 // Sets the currently active URL. Use GURL() to clear the URL. | 27 // Sets the currently active URL. Use GURL() to clear the URL. |
| 25 virtual void SetActiveURL(const GURL& url) = 0; | 28 virtual void SetActiveURL(const GURL& url) = 0; |
| 26 | 29 |
| 27 // Tells the delegate that a context has subscribed to a new target and | 30 // Tells the delegate that a context has subscribed to a new target and |
| 28 // the browser should start sending the corresponding information | 31 // the browser should start sending the corresponding information |
| 29 virtual void AddSubscription(int32_t client_id, unsigned int target) = 0; | 32 virtual void AddSubscription(int32_t client_id, unsigned int target) = 0; |
| 30 | 33 |
| 31 // Tells the delegate that an offscreen context was created for the provided | 34 // Tells the delegate that an offscreen context was created for the provided |
| 32 // |active_url|. | 35 // |active_url|. |
| 33 virtual void DidCreateOffscreenContext(const GURL& active_url) = 0; | 36 virtual void DidCreateOffscreenContext(const GURL& active_url) = 0; |
| 34 | 37 |
| 35 // Notification from GPU that the channel is destroyed. | 38 // Notification from GPU that the channel is destroyed. |
| 36 virtual void DidDestroyChannel(int client_id) = 0; | 39 virtual void DidDestroyChannel(int client_id) = 0; |
| 37 | 40 |
| 38 // Tells the delegate that an offscreen context was destroyed for the provided | 41 // Tells the delegate that an offscreen context was destroyed for the provided |
| 39 // |active_url|. | 42 // |active_url|. |
| 40 virtual void DidDestroyOffscreenContext(const GURL& active_url) = 0; | 43 virtual void DidDestroyOffscreenContext(const GURL& active_url) = 0; |
| 41 | 44 |
| 42 // Tells the delegate that a context was lost. | 45 // Tells the delegate that a context was lost. |
| 43 virtual void DidLoseContext(bool offscreen, | 46 virtual void DidLoseContext(bool offscreen, |
| 44 gpu::error::ContextLostReason reason, | 47 gpu::error::ContextLostReason reason, |
| 45 const GURL& active_url) = 0; | 48 const GURL& active_url) = 0; |
| 46 | 49 |
| 47 // Tells the delegate about GPU memory usage statistics for UMA logging. | 50 // Tells the delegate about GPU memory usage statistics for UMA logging. |
| 48 virtual void GpuMemoryUmaStats(const GPUMemoryUmaStats& params) = 0; | 51 virtual void GpuMemoryUmaStats(const gpu::GPUMemoryUmaStats& params) = 0; |
| 49 | 52 |
| 50 // Tells the delegate that no contexts are subscribed to the target anymore | 53 // Tells the delegate that no contexts are subscribed to the target anymore |
| 51 // so the delegate should stop sending the corresponding information. | 54 // so the delegate should stop sending the corresponding information. |
| 52 virtual void RemoveSubscription(int32_t client_id, unsigned int target) = 0; | 55 virtual void RemoveSubscription(int32_t client_id, unsigned int target) = 0; |
| 53 | 56 |
| 54 // Tells the delegate to cache the given shader information in persistent | 57 // Tells the delegate to cache the given shader information in persistent |
| 55 // storage. The embedder is expected to repopulate the in-memory cache through | 58 // storage. The embedder is expected to repopulate the in-memory cache through |
| 56 // the respective GpuChannelManager API. | 59 // the respective GpuChannelManager API. |
| 57 virtual void StoreShaderToDisk(int32_t client_id, | 60 virtual void StoreShaderToDisk(int32_t client_id, |
| 58 const std::string& key, | 61 const std::string& key, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 70 gpu::SurfaceHandle child_window) = 0; | 73 gpu::SurfaceHandle child_window) = 0; |
| 71 #endif | 74 #endif |
| 72 | 75 |
| 73 protected: | 76 protected: |
| 74 virtual ~GpuChannelManagerDelegate() {} | 77 virtual ~GpuChannelManagerDelegate() {} |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } // namespace content | 80 } // namespace content |
| 78 | 81 |
| 79 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ | 82 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_DELEGATE_H_ |
| OLD | NEW |