| 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 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2342 if (!render_frame_) | 2342 if (!render_frame_) |
| 2343 return PP_MakeUndefined(); | 2343 return PP_MakeUndefined(); |
| 2344 return StringVar::StringToPPVar( | 2344 return StringVar::StringToPPVar( |
| 2345 render_frame_->render_view()->webkit_preferences().default_encoding); | 2345 render_frame_->render_view()->webkit_preferences().default_encoding); |
| 2346 } | 2346 } |
| 2347 | 2347 |
| 2348 // These PPB_ContentDecryptor_Private calls are responses to | 2348 // These PPB_ContentDecryptor_Private calls are responses to |
| 2349 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. | 2349 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. |
| 2350 // Therefore, |content_decryptor_delegate_| must have been initialized when | 2350 // Therefore, |content_decryptor_delegate_| must have been initialized when |
| 2351 // the following methods are called. | 2351 // the following methods are called. |
| 2352 void PepperPluginInstanceImpl::SessionCreated(PP_Instance instance, | 2352 void PepperPluginInstanceImpl::PromiseResolved(PP_Instance instance, |
| 2353 uint32_t session_id, | 2353 uint32 promise_id) { |
| 2354 PP_Var web_session_id_var) { | 2354 content_decryptor_delegate_->OnPromiseResolved(promise_id); |
| 2355 content_decryptor_delegate_->OnSessionCreated(session_id, web_session_id_var); | 2355 } |
| 2356 |
| 2357 void PepperPluginInstanceImpl::PromiseResolvedWithSession( |
| 2358 PP_Instance instance, |
| 2359 uint32 promise_id, |
| 2360 PP_Var web_session_id_var) { |
| 2361 content_decryptor_delegate_->OnPromiseResolvedWithSession(promise_id, |
| 2362 web_session_id_var); |
| 2363 } |
| 2364 |
| 2365 void PepperPluginInstanceImpl::PromiseRejected(PP_Instance instance, |
| 2366 uint32 promise_id, |
| 2367 PP_ExceptionCode exception_code, |
| 2368 uint32 system_code, |
| 2369 PP_Var error_description_var) { |
| 2370 content_decryptor_delegate_->OnPromiseRejected( |
| 2371 promise_id, exception_code, system_code, error_description_var); |
| 2356 } | 2372 } |
| 2357 | 2373 |
| 2358 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, | 2374 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, |
| 2359 uint32_t session_id, | 2375 PP_Var web_session_id_var, |
| 2360 PP_Var message_var, | 2376 PP_Var message_var, |
| 2361 PP_Var destination_url) { | 2377 PP_Var destination_url_var) { |
| 2362 content_decryptor_delegate_->OnSessionMessage( | 2378 content_decryptor_delegate_->OnSessionMessage( |
| 2363 session_id, message_var, destination_url); | 2379 web_session_id_var, message_var, destination_url_var); |
| 2364 } | 2380 } |
| 2365 | 2381 |
| 2366 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, | 2382 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, |
| 2367 uint32_t session_id) { | 2383 PP_Var web_session_id_var) { |
| 2368 content_decryptor_delegate_->OnSessionReady(session_id); | 2384 content_decryptor_delegate_->OnSessionReady(web_session_id_var); |
| 2369 } | 2385 } |
| 2370 | 2386 |
| 2371 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, | 2387 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, |
| 2372 uint32_t session_id) { | 2388 PP_Var web_session_id_var) { |
| 2373 content_decryptor_delegate_->OnSessionClosed(session_id); | 2389 content_decryptor_delegate_->OnSessionClosed(web_session_id_var); |
| 2374 } | 2390 } |
| 2375 | 2391 |
| 2376 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, | 2392 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, |
| 2377 uint32_t session_id, | 2393 PP_Var web_session_id_var, |
| 2378 int32_t media_error, | 2394 PP_ExceptionCode exception_code, |
| 2379 uint32_t system_code) { | 2395 uint32 system_code, |
| 2396 PP_Var error_description_var) { |
| 2380 content_decryptor_delegate_->OnSessionError( | 2397 content_decryptor_delegate_->OnSessionError( |
| 2381 session_id, media_error, system_code); | 2398 web_session_id_var, exception_code, system_code, error_description_var); |
| 2382 } | 2399 } |
| 2383 | 2400 |
| 2384 void PepperPluginInstanceImpl::DeliverBlock( | 2401 void PepperPluginInstanceImpl::DeliverBlock( |
| 2385 PP_Instance instance, | 2402 PP_Instance instance, |
| 2386 PP_Resource decrypted_block, | 2403 PP_Resource decrypted_block, |
| 2387 const PP_DecryptedBlockInfo* block_info) { | 2404 const PP_DecryptedBlockInfo* block_info) { |
| 2388 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); | 2405 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); |
| 2389 } | 2406 } |
| 2390 | 2407 |
| 2391 void PepperPluginInstanceImpl::DecoderInitializeDone( | 2408 void PepperPluginInstanceImpl::DecoderInitializeDone( |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3199 // Running out-of-process. Initiate an IPC call to notify the plugin | 3216 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3200 // process. | 3217 // process. |
| 3201 ppapi::proxy::HostDispatcher* dispatcher = | 3218 ppapi::proxy::HostDispatcher* dispatcher = |
| 3202 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3219 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3203 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3220 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3204 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3221 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3205 } | 3222 } |
| 3206 } | 3223 } |
| 3207 | 3224 |
| 3208 } // namespace content | 3225 } // namespace content |
| OLD | NEW |