| 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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2283 if (!render_frame_) | 2283 if (!render_frame_) |
| 2284 return PP_MakeUndefined(); | 2284 return PP_MakeUndefined(); |
| 2285 return StringVar::StringToPPVar( | 2285 return StringVar::StringToPPVar( |
| 2286 render_frame_->render_view()->webkit_preferences().default_encoding); | 2286 render_frame_->render_view()->webkit_preferences().default_encoding); |
| 2287 } | 2287 } |
| 2288 | 2288 |
| 2289 // These PPB_ContentDecryptor_Private calls are responses to | 2289 // These PPB_ContentDecryptor_Private calls are responses to |
| 2290 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. | 2290 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. |
| 2291 // Therefore, |content_decryptor_delegate_| must have been initialized when | 2291 // Therefore, |content_decryptor_delegate_| must have been initialized when |
| 2292 // the following methods are called. | 2292 // the following methods are called. |
| 2293 void PepperPluginInstanceImpl::SessionCreated(PP_Instance instance, | 2293 void PepperPluginInstanceImpl::PromiseResolved(PP_Instance instance, |
| 2294 uint32_t session_id, | 2294 uint32 promise_id) { |
| 2295 PP_Var web_session_id_var) { | 2295 content_decryptor_delegate_->OnPromiseResolved(promise_id); |
| 2296 content_decryptor_delegate_->OnSessionCreated(session_id, web_session_id_var); | 2296 } |
| 2297 |
| 2298 void PepperPluginInstanceImpl::PromiseResolvedWithSession( |
| 2299 PP_Instance instance, |
| 2300 uint32 promise_id, |
| 2301 PP_Var web_session_id_var) { |
| 2302 content_decryptor_delegate_->OnPromiseResolvedWithSession(promise_id, |
| 2303 web_session_id_var); |
| 2304 } |
| 2305 |
| 2306 void PepperPluginInstanceImpl::PromiseRejected( |
| 2307 PP_Instance instance, |
| 2308 uint32 promise_id, |
| 2309 PP_ExceptionCodeType exception_code, |
| 2310 uint32 system_code, |
| 2311 PP_Var error_description_var) { |
| 2312 content_decryptor_delegate_->OnPromiseRejected( |
| 2313 promise_id, exception_code, system_code, error_description_var); |
| 2297 } | 2314 } |
| 2298 | 2315 |
| 2299 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, | 2316 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, |
| 2300 uint32_t session_id, | 2317 PP_Var web_session_id_var, |
| 2301 PP_Var message_var, | 2318 PP_Var message_var, |
| 2302 PP_Var destination_url) { | 2319 PP_Var destination_url_var) { |
| 2303 content_decryptor_delegate_->OnSessionMessage( | 2320 content_decryptor_delegate_->OnSessionMessage( |
| 2304 session_id, message_var, destination_url); | 2321 web_session_id_var, message_var, destination_url_var); |
| 2305 } | 2322 } |
| 2306 | 2323 |
| 2307 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, | 2324 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, |
| 2308 uint32_t session_id) { | 2325 PP_Var web_session_id_var) { |
| 2309 content_decryptor_delegate_->OnSessionReady(session_id); | 2326 content_decryptor_delegate_->OnSessionReady(web_session_id_var); |
| 2310 } | 2327 } |
| 2311 | 2328 |
| 2312 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, | 2329 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, |
| 2313 uint32_t session_id) { | 2330 PP_Var web_session_id_var) { |
| 2314 content_decryptor_delegate_->OnSessionClosed(session_id); | 2331 content_decryptor_delegate_->OnSessionClosed(web_session_id_var); |
| 2315 } | 2332 } |
| 2316 | 2333 |
| 2317 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, | 2334 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, |
| 2318 uint32_t session_id, | 2335 PP_Var web_session_id_var, |
| 2319 int32_t media_error, | 2336 PP_ExceptionCodeType exception_code, |
| 2320 uint32_t system_code) { | 2337 uint32 system_code, |
| 2338 PP_Var error_description_var) { |
| 2321 content_decryptor_delegate_->OnSessionError( | 2339 content_decryptor_delegate_->OnSessionError( |
| 2322 session_id, media_error, system_code); | 2340 web_session_id_var, exception_code, system_code, error_description_var); |
| 2323 } | 2341 } |
| 2324 | 2342 |
| 2325 void PepperPluginInstanceImpl::DeliverBlock( | 2343 void PepperPluginInstanceImpl::DeliverBlock( |
| 2326 PP_Instance instance, | 2344 PP_Instance instance, |
| 2327 PP_Resource decrypted_block, | 2345 PP_Resource decrypted_block, |
| 2328 const PP_DecryptedBlockInfo* block_info) { | 2346 const PP_DecryptedBlockInfo* block_info) { |
| 2329 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); | 2347 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); |
| 2330 } | 2348 } |
| 2331 | 2349 |
| 2332 void PepperPluginInstanceImpl::DecoderInitializeDone( | 2350 void PepperPluginInstanceImpl::DecoderInitializeDone( |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3138 // Running out-of-process. Initiate an IPC call to notify the plugin | 3156 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3139 // process. | 3157 // process. |
| 3140 ppapi::proxy::HostDispatcher* dispatcher = | 3158 ppapi::proxy::HostDispatcher* dispatcher = |
| 3141 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3159 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3142 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3160 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3143 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3161 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3144 } | 3162 } |
| 3145 } | 3163 } |
| 3146 | 3164 |
| 3147 } // namespace content | 3165 } // namespace content |
| OLD | NEW |