OLD | NEW |
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/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 if (!render_frame_) | 2357 if (!render_frame_) |
2358 return PP_MakeUndefined(); | 2358 return PP_MakeUndefined(); |
2359 return StringVar::StringToPPVar( | 2359 return StringVar::StringToPPVar( |
2360 render_frame_->render_view()->webkit_preferences().default_encoding); | 2360 render_frame_->render_view()->webkit_preferences().default_encoding); |
2361 } | 2361 } |
2362 | 2362 |
2363 // These PPB_ContentDecryptor_Private calls are responses to | 2363 // These PPB_ContentDecryptor_Private calls are responses to |
2364 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. | 2364 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. |
2365 // Therefore, |content_decryptor_delegate_| must have been initialized when | 2365 // Therefore, |content_decryptor_delegate_| must have been initialized when |
2366 // the following methods are called. | 2366 // the following methods are called. |
2367 void PepperPluginInstanceImpl::SessionCreated(PP_Instance instance, | 2367 void PepperPluginInstanceImpl::PromiseResolved(PP_Instance instance, |
2368 uint32_t session_id, | 2368 uint32 promise_id) { |
2369 PP_Var web_session_id_var) { | 2369 content_decryptor_delegate_->OnPromiseResolved(promise_id); |
2370 content_decryptor_delegate_->OnSessionCreated(session_id, web_session_id_var); | 2370 } |
| 2371 |
| 2372 void PepperPluginInstanceImpl::PromiseResolvedWithSession( |
| 2373 PP_Instance instance, |
| 2374 uint32 promise_id, |
| 2375 PP_Var web_session_id_var) { |
| 2376 content_decryptor_delegate_->OnPromiseResolvedWithSession(promise_id, |
| 2377 web_session_id_var); |
| 2378 } |
| 2379 |
| 2380 void PepperPluginInstanceImpl::PromiseRejected( |
| 2381 PP_Instance instance, |
| 2382 uint32 promise_id, |
| 2383 PP_CdmExceptionCode exception_code, |
| 2384 uint32 system_code, |
| 2385 PP_Var error_description_var) { |
| 2386 content_decryptor_delegate_->OnPromiseRejected( |
| 2387 promise_id, exception_code, system_code, error_description_var); |
2371 } | 2388 } |
2372 | 2389 |
2373 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, | 2390 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, |
2374 uint32_t session_id, | 2391 PP_Var web_session_id_var, |
2375 PP_Var message_var, | 2392 PP_Var message_var, |
2376 PP_Var destination_url) { | 2393 PP_Var destination_url_var) { |
2377 content_decryptor_delegate_->OnSessionMessage( | 2394 content_decryptor_delegate_->OnSessionMessage( |
2378 session_id, message_var, destination_url); | 2395 web_session_id_var, message_var, destination_url_var); |
2379 } | 2396 } |
2380 | 2397 |
2381 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, | 2398 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, |
2382 uint32_t session_id) { | 2399 PP_Var web_session_id_var) { |
2383 content_decryptor_delegate_->OnSessionReady(session_id); | 2400 content_decryptor_delegate_->OnSessionReady(web_session_id_var); |
2384 } | 2401 } |
2385 | 2402 |
2386 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, | 2403 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, |
2387 uint32_t session_id) { | 2404 PP_Var web_session_id_var) { |
2388 content_decryptor_delegate_->OnSessionClosed(session_id); | 2405 content_decryptor_delegate_->OnSessionClosed(web_session_id_var); |
2389 } | 2406 } |
2390 | 2407 |
2391 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, | 2408 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, |
2392 uint32_t session_id, | 2409 PP_Var web_session_id_var, |
2393 int32_t media_error, | 2410 PP_CdmExceptionCode exception_code, |
2394 uint32_t system_code) { | 2411 uint32 system_code, |
| 2412 PP_Var error_description_var) { |
2395 content_decryptor_delegate_->OnSessionError( | 2413 content_decryptor_delegate_->OnSessionError( |
2396 session_id, media_error, system_code); | 2414 web_session_id_var, exception_code, system_code, error_description_var); |
2397 } | 2415 } |
2398 | 2416 |
2399 void PepperPluginInstanceImpl::DeliverBlock( | 2417 void PepperPluginInstanceImpl::DeliverBlock( |
2400 PP_Instance instance, | 2418 PP_Instance instance, |
2401 PP_Resource decrypted_block, | 2419 PP_Resource decrypted_block, |
2402 const PP_DecryptedBlockInfo* block_info) { | 2420 const PP_DecryptedBlockInfo* block_info) { |
2403 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); | 2421 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); |
2404 } | 2422 } |
2405 | 2423 |
2406 void PepperPluginInstanceImpl::DecoderInitializeDone( | 2424 void PepperPluginInstanceImpl::DecoderInitializeDone( |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 // Running out-of-process. Initiate an IPC call to notify the plugin | 3235 // Running out-of-process. Initiate an IPC call to notify the plugin |
3218 // process. | 3236 // process. |
3219 ppapi::proxy::HostDispatcher* dispatcher = | 3237 ppapi::proxy::HostDispatcher* dispatcher = |
3220 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3238 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3221 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3239 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3222 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3240 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3223 } | 3241 } |
3224 } | 3242 } |
3225 | 3243 |
3226 } // namespace content | 3244 } // namespace content |
OLD | NEW |