Index: services/ui/gles2/command_buffer_driver_manager.h |
diff --git a/services/ui/gles2/command_buffer_driver_manager.h b/services/ui/gles2/command_buffer_driver_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a1ef2019092a1666b27ada2012ced6b188bc63a |
--- /dev/null |
+++ b/services/ui/gles2/command_buffer_driver_manager.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SERVICES_UI_GLES2_COMMAND_BUFFER_DRIVER_MANAGER_H_ |
+#define SERVICES_UI_GLES2_COMMAND_BUFFER_DRIVER_MANAGER_H_ |
+ |
+#include <stdint.h> |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "base/threading/non_thread_safe.h" |
+ |
+namespace ui { |
+ |
+class CommandBufferDriver; |
+ |
+// This class manages all initialized |CommandBufferDriver|s. |
+class CommandBufferDriverManager : base::NonThreadSafe { |
+ public: |
+ CommandBufferDriverManager(); |
+ ~CommandBufferDriverManager(); |
+ |
+ // Add a new initialized driver to the manager. |
+ void AddDriver(CommandBufferDriver* driver); |
+ |
+ // Remove a driver from the manager. |
+ void RemoveDriver(CommandBufferDriver* driver); |
+ |
+ // Return the global order number for the last unprocessed flush |
+ // (|CommandBufferDriver::Flush|). |
+ uint32_t GetUnprocessedOrderNum() const; |
+ |
+ // Return the global order number for the last processed flush |
+ // (|CommandBufferDriver::Flush|). |
+ uint32_t GetProcessedOrderNum() const; |
+ |
+ private: |
+ std::vector<CommandBufferDriver*> drivers_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CommandBufferDriverManager); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_MANAGER_H_ |