Popular sites on the NTP: Try to keep the ordering constant
[chromium-blink-merge.git] / content / public / browser / gpu_data_manager_observer.h
blobe45ed44082a6ffe9362a3f51c84702587448a3c0
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
6 #define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
8 #include "base/process/kill.h"
9 #include "content/common/content_export.h"
10 #include "content/public/common/gpu_memory_stats.h"
11 #include "content/public/common/three_d_api_types.h"
13 class GURL;
15 namespace content {
17 // Observers can register themselves via GpuDataManager::AddObserver, and
18 // can un-register with GpuDataManager::RemoveObserver.
19 class CONTENT_EXPORT GpuDataManagerObserver {
20 public:
21 // Called for any observers whenever there is a GPU info update.
22 virtual void OnGpuInfoUpdate() {}
24 // Called for any observers whenever there is a GPU video memory update.
25 virtual void OnVideoMemoryUsageStatsUpdate(
26 const GPUVideoMemoryUsageStats& video_memory_usage_stats) {}
28 // Indicates that client 3D APIs (Pepper 3D, WebGL) were just blocked on the
29 // given page, specifically because the GPU was reset recently.
30 virtual void DidBlock3DAPIs(const GURL& url,
31 int render_process_id,
32 int render_view_id,
33 ThreeDAPIType requester) {}
35 // Called for any observer when the GPU process crashed.
36 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) {}
38 protected:
39 virtual ~GpuDataManagerObserver() {}
42 }; // namespace content
44 #endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_