Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / gl / gpu_switching_manager.h
index a097d9a..7e82d62 100644 (file)
@@ -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);
 };