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

Unified Diff: gpu/command_buffer/service/mailbox_manager.cc

Issue 11194042: Implement TextureImageTransportSurface using texture mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura DCHECK() Created 8 years 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/mailbox_manager.h ('k') | gpu/command_buffer/service/texture_definition.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mailbox_manager.cc
diff --git a/gpu/command_buffer/service/mailbox_manager.cc b/gpu/command_buffer/service/mailbox_manager.cc
index ec7ad948bb273d61ff2e7bfc0d94448dbefcb041..90193934f3a4dd40ba797266978847b653241e69 100644
--- a/gpu/command_buffer/service/mailbox_manager.cc
+++ b/gpu/command_buffer/service/mailbox_manager.cc
@@ -4,6 +4,8 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
+#include <algorithm>
+
#include "base/rand_util.h"
#include "crypto/hmac.h"
#include "gpu/command_buffer/service/gl_utils.h"
@@ -12,6 +14,11 @@
namespace gpu {
namespace gles2 {
+MailboxName::MailboxName() {
+ std::fill(key, key + sizeof(key), 0);
+ std::fill(signature, signature + sizeof(signature), 0);
+}
+
MailboxManager::MailboxManager()
: hmac_(crypto::HMAC::SHA256),
textures_(std::ptr_fun(&MailboxManager::TargetNameLess)) {
@@ -19,9 +26,11 @@ MailboxManager::MailboxManager()
bool success = hmac_.Init(
base::StringPiece(private_key_, sizeof(private_key_)));
DCHECK(success);
+ DCHECK(!IsMailboxNameValid(MailboxName()));
}
MailboxManager::~MailboxManager() {
+ DCHECK(!textures_.size());
}
void MailboxManager::GenerateMailboxName(MailboxName* name) {
@@ -36,10 +45,8 @@ TextureDefinition* MailboxManager::ConsumeTexture(unsigned target,
TextureDefinitionMap::iterator it =
textures_.find(TargetName(target, name));
- if (it == textures_.end()) {
- NOTREACHED();
+ if (it == textures_.end())
return NULL;
- }
TextureDefinition* definition = it->second.definition.release();
textures_.erase(it);
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager.h ('k') | gpu/command_buffer/service/texture_definition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698