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

Side by Side Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 119203003: Drop DecryptConfig::data_offset_. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 11 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 "content/renderer/pepper/content_decryptor_delegate.h" 5 #include "content/renderer/pepper/content_decryptor_delegate.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/safe_numerics.h" 10 #include "base/safe_numerics.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 DCHECK(encrypted_buffer->data_size()) 99 DCHECK(encrypted_buffer->data_size())
100 << "DecryptConfig is set on an empty buffer"; 100 << "DecryptConfig is set on an empty buffer";
101 101
102 block_info->tracking_info.timestamp = 102 block_info->tracking_info.timestamp =
103 encrypted_buffer->timestamp().InMicroseconds(); 103 encrypted_buffer->timestamp().InMicroseconds();
104 block_info->data_size = encrypted_buffer->data_size(); 104 block_info->data_size = encrypted_buffer->data_size();
105 105
106 const media::DecryptConfig* decrypt_config = 106 const media::DecryptConfig* decrypt_config =
107 encrypted_buffer->decrypt_config(); 107 encrypted_buffer->decrypt_config();
108 block_info->data_offset = decrypt_config->data_offset(); 108 // TODO(xhwang): Drop |data_offset| in PP_EncryptedBlockInfo.
109 block_info->data_offset = 0;
109 110
110 if (!CopyStringToArray(decrypt_config->key_id(), block_info->key_id) || 111 if (!CopyStringToArray(decrypt_config->key_id(), block_info->key_id) ||
111 !CopyStringToArray(decrypt_config->iv(), block_info->iv)) 112 !CopyStringToArray(decrypt_config->iv(), block_info->iv))
112 return false; 113 return false;
113 114
114 block_info->key_id_size = decrypt_config->key_id().size(); 115 block_info->key_id_size = decrypt_config->key_id().size();
115 block_info->iv_size = decrypt_config->iv().size(); 116 block_info->iv_size = decrypt_config->iv().size();
116 117
117 if (decrypt_config->subsamples().size() > arraysize(block_info->subsamples)) 118 if (decrypt_config->subsamples().size() > arraysize(block_info->subsamples))
118 return false; 119 return false;
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 frames->push_back(frame); 1069 frames->push_back(frame);
1069 1070
1070 cur += frame_size; 1071 cur += frame_size;
1071 bytes_left -= frame_size; 1072 bytes_left -= frame_size;
1072 } while (bytes_left > 0); 1073 } while (bytes_left > 0);
1073 1074
1074 return true; 1075 return true;
1075 } 1076 }
1076 1077
1077 } // namespace content 1078 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698