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

Side by Side Diff: media/webm/webm_content_encodings_client.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
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 "media/webm/webm_content_encodings_client.h" 5 #include "media/webm/webm_content_encodings_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "media/webm/webm_constants.h" 9 #include "media/webm/webm_constants.h"
10 10
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 // Multiple occurrence restriction is checked in this function. Mandatory 243 // Multiple occurrence restriction is checked in this function. Mandatory
244 // restriction is checked in OnListEnd. 244 // restriction is checked in OnListEnd.
245 bool WebMContentEncodingsClient::OnBinary(int id, const uint8* data, int size) { 245 bool WebMContentEncodingsClient::OnBinary(int id, const uint8* data, int size) {
246 DCHECK(cur_content_encoding_.get()); 246 DCHECK(cur_content_encoding_.get());
247 DCHECK(data); 247 DCHECK(data);
248 DCHECK_GT(size, 0); 248 DCHECK_GT(size, 0);
249 249
250 if (id == kWebMIdContentEncKeyID) { 250 if (id == kWebMIdContentEncKeyID) {
251 if (cur_content_encoding_->encryption_key_id() || 251 if (!cur_content_encoding_->encryption_key_id().empty()) {
252 cur_content_encoding_->encryption_key_id_size()) {
253 DVLOG(1) << "Unexpected multiple ContentEncKeyID"; 252 DVLOG(1) << "Unexpected multiple ContentEncKeyID";
254 return false; 253 return false;
255 } 254 }
256 cur_content_encoding_->SetEncryptionKeyId(data, size); 255 cur_content_encoding_->SetEncryptionKeyId(data, size);
257 return true; 256 return true;
258 } 257 }
259 258
260 // This should not happen if WebMListParser is working properly. 259 // This should not happen if WebMListParser is working properly.
261 DCHECK(false); 260 DCHECK(false);
262 return false; 261 return false;
263 } 262 }
264 263
265 } // namespace media 264 } // namespace media
OLDNEW
« no previous file with comments | « media/webm/webm_content_encodings.cc ('k') | media/webm/webm_content_encodings_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698