Index: ui/gl/gpu_switching_manager.h |
diff --git a/ui/gl/gpu_switching_manager.h b/ui/gl/gpu_switching_manager.h |
index a097d9af681e1b9476bc059b6009d460fdcda72d..7e82d62481852762f55e091d3783acc92fb2922e 100644 |
--- a/ui/gl/gpu_switching_manager.h |
+++ b/ui/gl/gpu_switching_manager.h |
@@ -8,8 +8,10 @@ |
#include <vector> |
#include "base/memory/singleton.h" |
+#include "base/observer_list.h" |
#include "ui/gl/gl_export.h" |
#include "ui/gl/gpu_preference.h" |
+#include "ui/gl/gpu_switching_observer.h" |
#if defined(OS_MACOSX) |
#include <OpenGL/OpenGL.h> |
@@ -40,6 +42,16 @@ class GL_EXPORT GpuSwitchingManager { |
void SetGpuCount(size_t gpu_count); |
+ void AddObserver(GpuSwitchingObserver* observer); |
+ void RemoveObserver(GpuSwitchingObserver* observer); |
+ |
+ // Called when a GPU switch is noticed by the system. In the browser process |
+ // this is occurs as a result of a system observer. In the GPU process, this |
+ // occurs as a result of an IPC from the browser. The system observer is kept |
+ // in the browser process only so that any workarounds or blacklisting can |
+ // be applied there. |
+ void NotifyGpuSwitched(); |
+ |
private: |
friend struct DefaultSingletonTraits<GpuSwitchingManager>; |
@@ -60,6 +72,8 @@ class GL_EXPORT GpuSwitchingManager { |
size_t gpu_count_; |
+ ObserverList<GpuSwitchingObserver> observer_list_; |
+ |
DISALLOW_COPY_AND_ASSIGN(GpuSwitchingManager); |
}; |