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

Unified Diff: gpu/command_buffer/service/sync_point_manager.h

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « gpu/command_buffer/service/shader_translator.h ('k') | gpu/command_buffer/service/sync_point_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/sync_point_manager.h
diff --git a/gpu/command_buffer/service/sync_point_manager.h b/gpu/command_buffer/service/sync_point_manager.h
index 8cbf8a838f97c8a2ad57332c25103dfc680a6687..001ab176087ec81ffebeb24e045cdea16201e0b1 100644
--- a/gpu/command_buffer/service/sync_point_manager.h
+++ b/gpu/command_buffer/service/sync_point_manager.h
@@ -10,10 +10,14 @@
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
-#include "base/threading/thread_checker.h"
#include "gpu/gpu_export.h"
+namespace base {
+class SequenceChecker;
+}
+
namespace gpu {
// This class manages the sync points, which allow cross-channel
@@ -21,7 +25,10 @@ namespace gpu {
class GPU_EXPORT SyncPointManager
: public base::RefCountedThreadSafe<SyncPointManager> {
public:
- SyncPointManager();
+ // InProcessCommandBuffer allows threaded calls since it can call into
+ // SyncPointManager from client threads, or from multiple service threads
+ // used in Android WebView.
+ static SyncPointManager* Create(bool allow_threaded_calls);
// Generates a sync point, returning its ID. This can me called on any thread.
// IDs start at a random number. Never return 0.
@@ -44,9 +51,11 @@ class GPU_EXPORT SyncPointManager
typedef std::vector<base::Closure> ClosureList;
typedef base::hash_map<uint32, ClosureList> SyncPointMap;
+ explicit SyncPointManager(bool allow_threaded_calls);
~SyncPointManager();
+ void CheckSequencedThread();
- base::ThreadChecker thread_checker_;
+ scoped_ptr<base::SequenceChecker> sequence_checker_;
// Protects the 2 fields below. Note: callbacks shouldn't be called with this
// held.
« no previous file with comments | « gpu/command_buffer/service/shader_translator.h ('k') | gpu/command_buffer/service/sync_point_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698