summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 04:45:18 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-07 04:45:18 +0000
commitbba2ff826889c3c06c492281bb34f0a09e0aba68 (patch)
treea7a7da859cd3e121cbe20d01e751e0c120b14a9d /gpu
parentbe71a04c0b865e679c36c1bc2b7fc315d1dd1aee (diff)
downloadchromium_src-bba2ff826889c3c06c492281bb34f0a09e0aba68.zip
chromium_src-bba2ff826889c3c06c492281bb34f0a09e0aba68.tar.gz
chromium_src-bba2ff826889c3c06c492281bb34f0a09e0aba68.tar.bz2
IPC to generate mailbox names on the GPU process IO thread.
This allows the browser and renderer processes to get new unique mailbox names without syncing with the GPU process main thread. Review URL: https://chromiumcodereview.appspot.com/11362053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/mailbox_manager.cc6
-rw-r--r--gpu/command_buffer/service/mailbox_manager.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/mailbox_manager.cc b/gpu/command_buffer/service/mailbox_manager.cc
index 9cdf0bc..ec7ad94 100644
--- a/gpu/command_buffer/service/mailbox_manager.cc
+++ b/gpu/command_buffer/service/mailbox_manager.cc
@@ -15,9 +15,9 @@ namespace gles2 {
MailboxManager::MailboxManager()
: hmac_(crypto::HMAC::SHA256),
textures_(std::ptr_fun(&MailboxManager::TargetNameLess)) {
- unsigned char private_key[GL_MAILBOX_SIZE_CHROMIUM / 2];
- base::RandBytes(private_key, sizeof(private_key));
- bool success = hmac_.Init(private_key, sizeof(private_key));
+ base::RandBytes(private_key_, sizeof(private_key_));
+ bool success = hmac_.Init(
+ base::StringPiece(private_key_, sizeof(private_key_)));
DCHECK(success);
}
diff --git a/gpu/command_buffer/service/mailbox_manager.h b/gpu/command_buffer/service/mailbox_manager.h
index f9ae588..337998d 100644
--- a/gpu/command_buffer/service/mailbox_manager.h
+++ b/gpu/command_buffer/service/mailbox_manager.h
@@ -56,6 +56,10 @@ class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
// manager.
void DestroyOwnedTextures(TextureManager* owner, bool have_context);
+ std::string private_key() {
+ return std::string(private_key_, sizeof(private_key_));
+ }
+
private:
friend class base::RefCounted<MailboxManager>;
@@ -86,6 +90,7 @@ class GPU_EXPORT MailboxManager : public base::RefCounted<MailboxManager> {
std::pointer_to_binary_function<
const TargetName&, const TargetName&, bool> > TextureDefinitionMap;
+ char private_key_[GL_MAILBOX_SIZE_CHROMIUM / 2];
crypto::HMAC hmac_;
TextureDefinitionMap textures_;