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(PP_Instance instance, |
| 2381 uint32 promise_id, |
| 2382 PP_ExceptionCode exception_code, |
| 2383 uint32 system_code, |
| 2384 PP_Var error_description_var) { |
| 2385 content_decryptor_delegate_->OnPromiseRejected( |
| 2386 promise_id, exception_code, system_code, error_description_var); |
2371 } | 2387 } |
2372 | 2388 |
2373 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, | 2389 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, |
2374 uint32_t session_id, | 2390 PP_Var web_session_id_var, |
2375 PP_Var message_var, | 2391 PP_Var message_var, |
2376 PP_Var destination_url) { | 2392 PP_Var destination_url_var) { |
2377 content_decryptor_delegate_->OnSessionMessage( | 2393 content_decryptor_delegate_->OnSessionMessage( |
2378 session_id, message_var, destination_url); | 2394 web_session_id_var, message_var, destination_url_var); |
2379 } | 2395 } |
2380 | 2396 |
2381 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, | 2397 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, |
2382 uint32_t session_id) { | 2398 PP_Var web_session_id_var) { |
2383 content_decryptor_delegate_->OnSessionReady(session_id); | 2399 content_decryptor_delegate_->OnSessionReady(web_session_id_var); |
2384 } | 2400 } |
2385 | 2401 |
2386 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, | 2402 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, |
2387 uint32_t session_id) { | 2403 PP_Var web_session_id_var) { |
2388 content_decryptor_delegate_->OnSessionClosed(session_id); | 2404 content_decryptor_delegate_->OnSessionClosed(web_session_id_var); |
2389 } | 2405 } |
2390 | 2406 |
2391 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, | 2407 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, |
2392 uint32_t session_id, | 2408 PP_Var web_session_id_var, |
2393 int32_t media_error, | 2409 PP_ExceptionCode exception_code, |
2394 uint32_t system_code) { | 2410 uint32 system_code, |
| 2411 PP_Var error_description_var) { |
2395 content_decryptor_delegate_->OnSessionError( | 2412 content_decryptor_delegate_->OnSessionError( |
2396 session_id, media_error, system_code); | 2413 web_session_id_var, exception_code, system_code, error_description_var); |
2397 } | 2414 } |
2398 | 2415 |
2399 void PepperPluginInstanceImpl::DeliverBlock( | 2416 void PepperPluginInstanceImpl::DeliverBlock( |
2400 PP_Instance instance, | 2417 PP_Instance instance, |
2401 PP_Resource decrypted_block, | 2418 PP_Resource decrypted_block, |
2402 const PP_DecryptedBlockInfo* block_info) { | 2419 const PP_DecryptedBlockInfo* block_info) { |
2403 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); | 2420 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); |
2404 } | 2421 } |
2405 | 2422 |
2406 void PepperPluginInstanceImpl::DecoderInitializeDone( | 2423 void PepperPluginInstanceImpl::DecoderInitializeDone( |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3214 // Running out-of-process. Initiate an IPC call to notify the plugin | 3231 // Running out-of-process. Initiate an IPC call to notify the plugin |
3215 // process. | 3232 // process. |
3216 ppapi::proxy::HostDispatcher* dispatcher = | 3233 ppapi::proxy::HostDispatcher* dispatcher = |
3217 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3234 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3218 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3235 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3219 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3236 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3220 } | 3237 } |
3221 } | 3238 } |
3222 | 3239 |
3223 } // namespace content | 3240 } // namespace content |
OLD | NEW |