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

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11106004: Allow null buffer resources to be returned through the PPB_ContentDecryptor_Private proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/plugins/ppapi/ppapi_plugin_instance.h" 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 return false; 1508 return false;
1509 plugin_decryption_interface_->CancelKeyRequest( 1509 plugin_decryption_interface_->CancelKeyRequest(
1510 pp_instance(), 1510 pp_instance(),
1511 StringVar::StringToPPVar(session_id)); 1511 StringVar::StringToPPVar(session_id));
1512 return true; 1512 return true;
1513 } 1513 }
1514 1514
1515 bool PluginInstance::Decrypt( 1515 bool PluginInstance::Decrypt(
1516 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, 1516 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer,
1517 const media::Decryptor::DecryptCB& decrypt_cb) { 1517 const media::Decryptor::DecryptCB& decrypt_cb) {
1518 DVLOG(2) << "Decrypt()";
1518 if (!LoadContentDecryptorInterface()) 1519 if (!LoadContentDecryptorInterface())
1519 return false; 1520 return false;
1520 1521
1521 ScopedPPResource encrypted_resource( 1522 ScopedPPResource encrypted_resource(
1522 ScopedPPResource::PassRef(), 1523 ScopedPPResource::PassRef(),
1523 MakeBufferResource(pp_instance(), 1524 MakeBufferResource(pp_instance(),
1524 encrypted_buffer->GetData(), 1525 encrypted_buffer->GetData(),
1525 encrypted_buffer->GetDataSize())); 1526 encrypted_buffer->GetDataSize()));
1526 if (!encrypted_resource.get()) 1527 if (!encrypted_resource.get())
1527 return false; 1528 return false;
1528 1529
1529 uint32_t request_id = next_decryption_request_id_++; 1530 uint32_t request_id = next_decryption_request_id_++;
1531 DVLOG(2) << "Decrypt() - request_id " << request_id;
1530 1532
1531 PP_EncryptedBlockInfo block_info; 1533 PP_EncryptedBlockInfo block_info;
1532 DCHECK(encrypted_buffer->GetDecryptConfig()); 1534 DCHECK(encrypted_buffer->GetDecryptConfig());
1533 if (!MakeEncryptedBlockInfo(*encrypted_buffer->GetDecryptConfig(), 1535 if (!MakeEncryptedBlockInfo(*encrypted_buffer->GetDecryptConfig(),
1534 encrypted_buffer->GetTimestamp().InMicroseconds(), 1536 encrypted_buffer->GetTimestamp().InMicroseconds(),
1535 request_id, 1537 request_id,
1536 &block_info)) { 1538 &block_info)) {
1537 return false; 1539 return false;
1538 } 1540 }
1539 1541
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 decryptor_client_->KeyError( 2277 decryptor_client_->KeyError(
2276 key_system_string->value(), 2278 key_system_string->value(),
2277 session_id_string->value(), 2279 session_id_string->value(),
2278 static_cast<media::Decryptor::KeyError>(media_error), 2280 static_cast<media::Decryptor::KeyError>(media_error),
2279 system_code); 2281 system_code);
2280 } 2282 }
2281 2283
2282 void PluginInstance::DeliverBlock(PP_Instance instance, 2284 void PluginInstance::DeliverBlock(PP_Instance instance,
2283 PP_Resource decrypted_block, 2285 PP_Resource decrypted_block,
2284 const PP_DecryptedBlockInfo* block_info) { 2286 const PP_DecryptedBlockInfo* block_info) {
2287 DVLOG(2) << "DeliverBlock() - request_id "
2288 << block_info->tracking_info.request_id;
2285 DCHECK(block_info); 2289 DCHECK(block_info);
2286 DecryptionCBMap::iterator found = pending_decryption_cbs_.find( 2290 DecryptionCBMap::iterator found = pending_decryption_cbs_.find(
2287 block_info->tracking_info.request_id); 2291 block_info->tracking_info.request_id);
2288 if (found == pending_decryption_cbs_.end()) 2292 if (found == pending_decryption_cbs_.end())
2289 return; 2293 return;
2290 media::Decryptor::DecryptCB decrypt_cb = found->second; 2294 media::Decryptor::DecryptCB decrypt_cb = found->second;
2291 pending_decryption_cbs_.erase(found); 2295 pending_decryption_cbs_.erase(found);
2292 2296
2293 if (block_info->result == PP_DECRYPTRESULT_DECRYPT_NOKEY) { 2297 if (block_info->result == PP_DECRYPTRESULT_DECRYPT_NOKEY) {
2294 decrypt_cb.Run(media::Decryptor::kNoKey, NULL); 2298 decrypt_cb.Run(media::Decryptor::kNoKey, NULL);
(...skipping 21 matching lines...) Expand all
2316 media::DecoderBuffer::CopyFrom( 2320 media::DecoderBuffer::CopyFrom(
2317 reinterpret_cast<const uint8*>(mapper.data()), mapper.size())); 2321 reinterpret_cast<const uint8*>(mapper.data()), mapper.size()));
2318 decrypted_buffer->SetTimestamp(base::TimeDelta::FromMicroseconds( 2322 decrypted_buffer->SetTimestamp(base::TimeDelta::FromMicroseconds(
2319 block_info->tracking_info.timestamp)); 2323 block_info->tracking_info.timestamp));
2320 decrypt_cb.Run(media::Decryptor::kSuccess, decrypted_buffer); 2324 decrypt_cb.Run(media::Decryptor::kSuccess, decrypted_buffer);
2321 } 2325 }
2322 2326
2323 void PluginInstance::DeliverFrame(PP_Instance instance, 2327 void PluginInstance::DeliverFrame(PP_Instance instance,
2324 PP_Resource decrypted_frame, 2328 PP_Resource decrypted_frame,
2325 const PP_DecryptedFrameInfo* frame_info) { 2329 const PP_DecryptedFrameInfo* frame_info) {
2330 DVLOG(2) << "DeliverFrame()";
2326 // TODO(tomfinegan): To be implemented after completion of v0.1 of the 2331 // TODO(tomfinegan): To be implemented after completion of v0.1 of the
2327 // EME/CDM work. 2332 // EME/CDM work.
2328 } 2333 }
2329 2334
2330 void PluginInstance::DeliverSamples(PP_Instance instance, 2335 void PluginInstance::DeliverSamples(PP_Instance instance,
2331 PP_Resource decrypted_samples, 2336 PP_Resource decrypted_samples,
2332 const PP_DecryptedBlockInfo* block_info) { 2337 const PP_DecryptedBlockInfo* block_info) {
2338 DVLOG(2) << "DeliverSamples()";
2333 // TODO(tomfinegan): To be implemented after completion of v0.1 of the 2339 // TODO(tomfinegan): To be implemented after completion of v0.1 of the
2334 // EME/CDM work. 2340 // EME/CDM work.
2335 } 2341 }
2336 2342
2337 void PluginInstance::NumberOfFindResultsChanged(PP_Instance instance, 2343 void PluginInstance::NumberOfFindResultsChanged(PP_Instance instance,
2338 int32_t total, 2344 int32_t total,
2339 PP_Bool final_result) { 2345 PP_Bool final_result) {
2340 DCHECK_NE(find_identifier_, -1); 2346 DCHECK_NE(find_identifier_, -1);
2341 delegate_->NumberOfFindResultsChanged(find_identifier_, total, 2347 delegate_->NumberOfFindResultsChanged(find_identifier_, total,
2342 PP_ToBool(final_result)); 2348 PP_ToBool(final_result));
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2714 screen_size_for_fullscreen_ = gfx::Size(); 2720 screen_size_for_fullscreen_ = gfx::Size();
2715 WebElement element = container_->element(); 2721 WebElement element = container_->element();
2716 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); 2722 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_);
2717 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); 2723 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_);
2718 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); 2724 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_);
2719 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); 2725 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_);
2720 } 2726 }
2721 2727
2722 } // namespace ppapi 2728 } // namespace ppapi
2723 } // namespace webkit 2729 } // namespace webkit
OLDNEW
« webkit/media/crypto/proxy_decryptor.cc ('K') | « webkit/media/crypto/proxy_decryptor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698