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

Unified Diff: gpu/ipc/client/command_buffer_proxy_impl.h

Issue 1933473002: Added more strict checks for fence sync counters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add thread_checker header Created 4 years, 8 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 | « no previous file | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/command_buffer_proxy_impl.h
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h
index 453d7b790c506bed40a045bf75db93c895f2d77c..dea27f265b666c94444dff0daddaba49b5fecca9 100644
--- a/gpu/ipc/client/command_buffer_proxy_impl.h
+++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -21,6 +21,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "base/threading/thread_checker.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/command_buffer_id.h"
@@ -157,8 +158,11 @@ class GPU_EXPORT CommandBufferProxyImpl
typedef base::hash_map<uint32_t, base::Closure> SignalTaskMap;
void CheckLock() {
- if (lock_)
+ if (lock_) {
lock_->AssertAcquired();
+ } else {
+ DCHECK(lockless_thread_checker_.CalledOnValidThread());
+ }
}
// Send an IPC message over the GPU channel. This is private to fully
@@ -196,7 +200,11 @@ class GPU_EXPORT CommandBufferProxyImpl
// The shared memory area used to update state.
gpu::CommandBufferSharedState* shared_state() const;
+ // There should be a lock_ if this is going to be used across multiple
+ // threads, or we guarantee it is used by a single thread by using a thread
+ // checker if no lock_ is set.
base::Lock* lock_;
+ base::ThreadChecker lockless_thread_checker_;
// Client that wants to listen for important events on the GpuControl.
gpu::GpuControlClient* gpu_control_client_;
« no previous file with comments | « no previous file | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698