blob: d52e668fa2220fbdf0823fc831d43a8c1daf42c3 [file] [log] [blame]
[email protected]79078df2012-02-16 01:22:321// 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.
4
5#ifndef CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
6#define CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_
[email protected]79078df2012-02-16 01:22:327
[email protected]c3c10f22013-07-25 14:21:128#include "base/process/kill.h"
[email protected]79078df2012-02-16 01:22:329#include "content/common/content_export.h"
[email protected]fb246af2012-08-18 03:11:4110#include "content/public/common/gpu_memory_stats.h"
[email protected]44327692013-02-26 21:21:2211#include "content/public/common/three_d_api_types.h"
12
13class GURL;
[email protected]79078df2012-02-16 01:22:3214
15namespace content {
16
17// Observers can register themselves via GpuDataManager::AddObserver, and
18// can un-register with GpuDataManager::RemoveObserver.
[email protected]029dad32013-06-04 03:39:5919class CONTENT_EXPORT GpuDataManagerObserver {
[email protected]79078df2012-02-16 01:22:3220 public:
21 // Called for any observers whenever there is a GPU info update.
[email protected]44327692013-02-26 21:21:2222 virtual void OnGpuInfoUpdate() {}
[email protected]79078df2012-02-16 01:22:3223
[email protected]fb246af2012-08-18 03:11:4124 // Called for any observers whenever there is a GPU video memory update.
25 virtual void OnVideoMemoryUsageStatsUpdate(
[email protected]44327692013-02-26 21:21:2226 const GPUVideoMemoryUsageStats& video_memory_usage_stats) {}
27
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) {}
[email protected]fb246af2012-08-18 03:11:4134
[email protected]33d63102013-03-14 13:03:0135 // Called for any observer when the GPU process crashed.
36 virtual void OnGpuProcessCrashed(base::TerminationStatus exit_code) {}
37
[email protected]6c85b4c92013-05-15 01:06:4838 // Called for any observer when the system switches to a different GPU.
39 virtual void OnGpuSwitching() {}
40
[email protected]79078df2012-02-16 01:22:3241 protected:
42 virtual ~GpuDataManagerObserver() {}
43};
44
45}; // namespace content
46
47#endif // CONTENT_PUBLIC_BROWSER_GPU_DATA_MANAGER_OBSERVER_H_