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(PP_Instance instance, |
| 2307 uint32 promise_id, |
| 2308 PP_ExceptionCode exception_code, |
| 2309 uint32 system_code, |
| 2310 PP_Var error_description_var) { |
| 2311 content_decryptor_delegate_->OnPromiseRejected( |
| 2312 promise_id, exception_code, system_code, error_description_var); |
2297 } | 2313 } |
2298 | 2314 |
2299 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, | 2315 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, |
2300 uint32_t session_id, | 2316 PP_Var web_session_id_var, |
2301 PP_Var message_var, | 2317 PP_Var message_var, |
2302 PP_Var destination_url) { | 2318 PP_Var destination_url_var) { |
2303 content_decryptor_delegate_->OnSessionMessage( | 2319 content_decryptor_delegate_->OnSessionMessage( |
2304 session_id, message_var, destination_url); | 2320 web_session_id_var, message_var, destination_url_var); |
2305 } | 2321 } |
2306 | 2322 |
2307 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, | 2323 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, |
2308 uint32_t session_id) { | 2324 PP_Var web_session_id_var) { |
2309 content_decryptor_delegate_->OnSessionReady(session_id); | 2325 content_decryptor_delegate_->OnSessionReady(web_session_id_var); |
2310 } | 2326 } |
2311 | 2327 |
2312 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, | 2328 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, |
2313 uint32_t session_id) { | 2329 PP_Var web_session_id_var) { |
2314 content_decryptor_delegate_->OnSessionClosed(session_id); | 2330 content_decryptor_delegate_->OnSessionClosed(web_session_id_var); |
2315 } | 2331 } |
2316 | 2332 |
2317 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, | 2333 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, |
2318 uint32_t session_id, | 2334 PP_Var web_session_id_var, |
2319 int32_t media_error, | 2335 PP_ExceptionCode exception_code, |
2320 uint32_t system_code) { | 2336 uint32 system_code, |
| 2337 PP_Var error_description_var) { |
2321 content_decryptor_delegate_->OnSessionError( | 2338 content_decryptor_delegate_->OnSessionError( |
2322 session_id, media_error, system_code); | 2339 web_session_id_var, exception_code, system_code, error_description_var); |
2323 } | 2340 } |
2324 | 2341 |
2325 void PepperPluginInstanceImpl::DeliverBlock( | 2342 void PepperPluginInstanceImpl::DeliverBlock( |
2326 PP_Instance instance, | 2343 PP_Instance instance, |
2327 PP_Resource decrypted_block, | 2344 PP_Resource decrypted_block, |
2328 const PP_DecryptedBlockInfo* block_info) { | 2345 const PP_DecryptedBlockInfo* block_info) { |
2329 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); | 2346 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); |
2330 } | 2347 } |
2331 | 2348 |
2332 void PepperPluginInstanceImpl::DecoderInitializeDone( | 2349 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 | 3155 // Running out-of-process. Initiate an IPC call to notify the plugin |
3139 // process. | 3156 // process. |
3140 ppapi::proxy::HostDispatcher* dispatcher = | 3157 ppapi::proxy::HostDispatcher* dispatcher = |
3141 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3158 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3142 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3159 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3143 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3160 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3144 } | 3161 } |
3145 } | 3162 } |
3146 | 3163 |
3147 } // namespace content | 3164 } // namespace content |
OLD | NEW |