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

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

Issue 23072043: Change NeedKeyCB to use std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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_stream_parser.h" 5 #include "media/webm/webm_stream_parser.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 return -1; 312 return -1;
313 } 313 }
314 314
315 if (cluster_ended) 315 if (cluster_ended)
316 end_of_segment_cb_.Run(); 316 end_of_segment_cb_.Run();
317 317
318 return bytes_parsed; 318 return bytes_parsed;
319 } 319 }
320 320
321 void WebMStreamParser::FireNeedKey(const std::string& key_id) { 321 void WebMStreamParser::FireNeedKey(const std::string& key_id) {
322 int key_id_size = key_id.size(); 322 size_t key_id_size = key_id.size();
323 DCHECK_GT(key_id_size, 0); 323 DCHECK_GT(key_id_size, 0u);
324 scoped_ptr<uint8[]> key_id_array(new uint8[key_id_size]); 324 std::vector<uint8> key_id_array(key_id_size);
325 memcpy(key_id_array.get(), key_id.data(), key_id_size); 325 if (key_id_size)
326 need_key_cb_.Run(kWebMEncryptInitDataType, key_id_array.Pass(), key_id_size); 326 memcpy(&key_id_array[0], key_id.data(), key_id.size());
xhwang 2013/08/23 17:24:37 ditto about using vector::vector(firstIter, lastIt
acolwell GONE FROM CHROMIUM 2013/08/23 19:55:28 Done.
327 need_key_cb_.Run(kWebMEncryptInitDataType, key_id_array);
327 } 328 }
328 329
329 } // namespace media 330 } // namespace media
OLDNEW
« media/mp4/mp4_stream_parser_unittest.cc ('K') | « media/mp4/mp4_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698