Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: components/mus/gles2/command_buffer_task_runner.h

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/mus/gles2/command_buffer_task_runner.h
diff --git a/components/mus/gles2/command_buffer_task_runner.h b/components/mus/gles2/command_buffer_task_runner.h
deleted file mode 100644
index 8ee317f58000e4512782c85e020c43a1bc0bb947..0000000000000000000000000000000000000000
--- a/components/mus/gles2/command_buffer_task_runner.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2014 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 COMPONENTS_MUS_GLES2_COMMAND_BUFFER_TASK_RUNNER_H_
-#define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_TASK_RUNNER_H_
-
-#include <deque>
-#include <map>
-#include <memory>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
-#include "base/synchronization/condition_variable.h"
-#include "base/synchronization/lock.h"
-#include "base/threading/thread_checker.h"
-
-namespace mus {
-
-class CommandBufferDriver;
-
-// This class maintains tasks submitted by |CommandBufferImpl|. Those tasks will
-// be executed on the main thread. But if the main thread is blocked in
-// |CommandBufferLocal::OnWaitFenceSync()| by waiting a sync point, the
-// |CommandBufferTaskRunner::RunOneTask()| could be used for executing a task
-// from other command buffers which may retire the sync point.
-class CommandBufferTaskRunner
- : public base::RefCountedThreadSafe<CommandBufferTaskRunner> {
- public:
- CommandBufferTaskRunner();
-
- // TaskCallback returns true if the task is completed and should be removed
- // from the task queue, otherwise returns false.
- typedef base::Callback<bool(void)> TaskCallback;
- bool PostTask(const CommandBufferDriver* driver,
- const TaskCallback& task);
-
- scoped_refptr<base::SingleThreadTaskRunner> task_runner() const {
- return task_runner_;
- }
-
- private:
- friend class base::RefCountedThreadSafe<CommandBufferTaskRunner>;
-
- ~CommandBufferTaskRunner();
-
- // Run one command buffer task from a scheduled command buffer.
- // When there isn't any command buffer task, and if the |block| is false,
- // this function will return false immediately, otherwise, this function
- // will be blocked until a task is available for executing.
- bool RunOneTaskInternalLocked();
-
- // Post a task to the main thread to execute tasks in |driver_map_|, if it is
- // necessary.
- void ScheduleTaskIfNecessaryLocked();
-
- // The callback function for executing tasks in |driver_map_|.
- void RunCommandBufferTask();
-
- base::ThreadChecker thread_checker_;
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-
- typedef std::deque<TaskCallback> TaskQueue;
- typedef std::map<const CommandBufferDriver*, TaskQueue> DriverMap;
- DriverMap driver_map_;
- bool need_post_task_;
-
- // The access lock for |driver_map_| and |need_post_task_|.
- base::Lock lock_;
-
- DISALLOW_COPY_AND_ASSIGN(CommandBufferTaskRunner);
-};
-
-} // namespace mus
-
-#endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_TASK_RUNNER_H_
« no previous file with comments | « components/mus/gles2/command_buffer_local_client.h ('k') | components/mus/gles2/command_buffer_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698