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

Unified Diff: gpu/command_buffer/common/mailbox.h

Issue 165393003: gpu: Generate mailboxes on client side (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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
Index: gpu/command_buffer/common/mailbox.h
diff --git a/gpu/command_buffer/common/mailbox.h b/gpu/command_buffer/common/mailbox.h
index 08a970fad856c06221f1db2acd7ac04e0d0de58f..06b4b591da1cbd8a53685247161bda77fd01074c 100644
--- a/gpu/command_buffer/common/mailbox.h
+++ b/gpu/command_buffer/common/mailbox.h
@@ -22,6 +22,15 @@ struct GPU_EXPORT Mailbox {
bool IsZero() const;
void SetZero();
void SetName(const int8* name);
+
+ // Generate a unique unguessable mailbox name.
+ static Mailbox Generate();
+
+ // Verify that the mailbox was created through Mailbox::Generate. This only
+ // works in Debug (always returns true in Release). This is not a secure
+ // check, only to catch bugs where clients forgot to call Mailbox::Generate.
+ bool Verify() const;
+
int8 name[GL_MAILBOX_SIZE_CHROMIUM];
bool operator<(const Mailbox& other) const {
return memcmp(this, &other, sizeof other) < 0;

Powered by Google App Engine
This is Rietveld 408576698