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

Side by Side Diff: media/webm/webm_content_encodings.cc

Issue 10826098: Use std::string for decryption key ID in webm parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/webm/webm_content_encodings.h ('k') | media/webm/webm_content_encodings_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "media/webm/webm_content_encodings.h" 6 #include "media/webm/webm_content_encodings.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 ContentEncoding::ContentEncoding() 10 ContentEncoding::ContentEncoding()
11 : order_(kOrderInvalid), 11 : order_(kOrderInvalid),
12 scope_(kScopeInvalid), 12 scope_(kScopeInvalid),
13 type_(kTypeInvalid), 13 type_(kTypeInvalid),
14 encryption_algo_(kEncAlgoInvalid), 14 encryption_algo_(kEncAlgoInvalid),
15 encryption_key_id_size_(0),
16 cipher_mode_(kCipherModeInvalid) { 15 cipher_mode_(kCipherModeInvalid) {
17 } 16 }
18 17
19 ContentEncoding::~ContentEncoding() {} 18 ContentEncoding::~ContentEncoding() {}
20 19
21 void ContentEncoding::SetEncryptionKeyId(const uint8* encryption_key_id, 20 void ContentEncoding::SetEncryptionKeyId(const uint8* encryption_key_id,
22 int size) { 21 int size) {
23 DCHECK(encryption_key_id); 22 DCHECK(encryption_key_id);
24 DCHECK_GT(size, 0); 23 DCHECK_GT(size, 0);
25 encryption_key_id_.reset(new uint8[size]); 24 encryption_key_id_.assign(reinterpret_cast<const char*>(encryption_key_id),
26 memcpy(encryption_key_id_.get(), encryption_key_id, size); 25 size);
27 encryption_key_id_size_ = size;
28 } 26 }
29 27
30 } // namespace media 28 } // namespace media
OLDNEW
« no previous file with comments | « media/webm/webm_content_encodings.h ('k') | media/webm/webm_content_encodings_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698