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

Side by Side Diff: webkit/media/crypto/ppapi_decryptor.cc

Issue 15772012: Separate MediaKeys interface from Decryptor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 "webkit/media/crypto/ppapi_decryptor.h" 5 #include "webkit/media/crypto/ppapi_decryptor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 NOTREACHED(); 255 NOTREACHED();
256 } 256 }
257 } 257 }
258 258
259 void PpapiDecryptor::KeyAdded(const std::string& key_system, 259 void PpapiDecryptor::KeyAdded(const std::string& key_system,
260 const std::string& session_id) { 260 const std::string& session_id) {
261 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 261 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
262 key_added_cb_.Run(key_system, session_id); 262 key_added_cb_.Run(key_system, session_id);
263 } 263 }
264 264
265 void PpapiDecryptor::KeyError(const std::string& key_system, 265 void PpapiDecryptor::KeyError(const std::string& key_system,
ddorwin 2013/05/24 20:39:12 Why do we need a proxy for key_error_cb_? Is it ju
xhwang 2013/05/24 23:15:56 We don't like to have callbacks jump layers, i.e.
266 const std::string& session_id, 266 const std::string& session_id,
267 media::Decryptor::KeyError error_code, 267 media::MediaKeys::KeyError error_code,
268 int system_code) { 268 int system_code) {
269 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 269 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
270 key_error_cb_.Run(key_system, session_id, error_code, system_code); 270 key_error_cb_.Run(key_system, session_id, error_code, system_code);
271 } 271 }
272 272
273 void PpapiDecryptor::KeyMessage(const std::string& key_system, 273 void PpapiDecryptor::KeyMessage(const std::string& key_system,
274 const std::string& session_id, 274 const std::string& session_id,
275 const std::string& message, 275 const std::string& message,
276 const std::string& default_url) { 276 const std::string& default_url) {
277 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 277 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
278 key_message_cb_.Run(key_system, session_id, message, default_url); 278 key_message_cb_.Run(key_system, session_id, message, default_url);
279 } 279 }
280 280
281 void PpapiDecryptor::NeedKey(const std::string& key_system, 281 void PpapiDecryptor::NeedKey(const std::string& key_system,
282 const std::string& session_id, 282 const std::string& session_id,
283 const std::string& type, 283 const std::string& type,
284 scoped_ptr<uint8[]> init_data, 284 scoped_ptr<uint8[]> init_data,
285 int init_data_size) { 285 int init_data_size) {
286 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 286 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
287 need_key_cb_.Run(key_system, session_id, type, 287 need_key_cb_.Run(key_system, session_id, type,
288 init_data.Pass(), init_data_size); 288 init_data.Pass(), init_data_size);
289 } 289 }
290 290
291 } // namespace webkit_media 291 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698