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_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ |
7 | 7 |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/common/three_d_api_types.h" | 10 #include "content/public/common/three_d_api_types.h" |
11 | 11 |
12 class GURL; | 12 class GURL; |
13 | 13 |
14 namespace gpu { | |
15 struct VideoMemoryUsageStats; | |
16 } | |
17 | |
18 namespace content { | 14 namespace content { |
19 | 15 |
20 // Observers can register themselves via GpuDataManager::AddObserver, and | 16 // Observers can register themselves via GpuDataManager::AddObserver, and |
21 // can un-register with GpuDataManager::RemoveObserver. | 17 // can un-register with GpuDataManager::RemoveObserver. |
22 class CONTENT_EXPORT GpuDataManagerObserver { | 18 class CONTENT_EXPORT GpuDataManagerObserver { |
23 public: | 19 public: |
24 // Called for any observers whenever there is a GPU info update. | 20 // Called for any observers whenever there is a GPU info update. |
25 virtual void OnGpuInfoUpdate() {} | 21 virtual void OnGpuInfoUpdate() {} |
26 | 22 |
27 // Called for any observers whenever there is a GPU video memory update. | |
28 virtual void OnVideoMemoryUsageStatsUpdate( | |
29 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) {} | |
30 | |
31 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just blocked on the | 23 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just blocked on the |
32 // given page, specifically because the GPU was reset recently. | 24 // given page, specifically because the GPU was reset recently. |
33 virtual void DidBlock3DAPIs(const GURL& top_origin_url, | 25 virtual void DidBlock3DAPIs(const GURL& top_origin_url, |
34 int render_process_id, | 26 int render_process_id, |
35 int render_frame_id, | 27 int render_frame_id, |
36 ThreeDAPIType requester) {} | 28 ThreeDAPIType requester) {} |
37 | 29 |
38 // Called for any observer when the GPU process crashed. | 30 // Called for any observer when the GPU process crashed. |
39 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) {} | 31 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) {} |
40 | 32 |
41 protected: | 33 protected: |
42 virtual ~GpuDataManagerObserver() {} | 34 virtual ~GpuDataManagerObserver() {} |
43 }; | 35 }; |
44 | 36 |
45 }; // namespace content | 37 }; // namespace content |
46 | 38 |
47 #endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ | 39 #endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_ |
OLD | NEW |