Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 265993002: Add Promises for EME (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cdm_promise template Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after
2281 if (!render_frame_) 2281 if (!render_frame_)
2282 return PP_MakeUndefined(); 2282 return PP_MakeUndefined();
2283 return StringVar::StringToPPVar( 2283 return StringVar::StringToPPVar(
2284 render_frame_->render_view()->webkit_preferences().default_encoding); 2284 render_frame_->render_view()->webkit_preferences().default_encoding);
2285 } 2285 }
2286 2286
2287 // These PPB_ContentDecryptor_Private calls are responses to 2287 // These PPB_ContentDecryptor_Private calls are responses to
2288 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. 2288 // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|.
2289 // Therefore, |content_decryptor_delegate_| must have been initialized when 2289 // Therefore, |content_decryptor_delegate_| must have been initialized when
2290 // the following methods are called. 2290 // the following methods are called.
2291 void PepperPluginInstanceImpl::SessionCreated(PP_Instance instance, 2291 void PepperPluginInstanceImpl::PromiseResolved(PP_Instance instance,
2292 uint32_t session_id, 2292 uint32 promise_id) {
2293 PP_Var web_session_id_var) { 2293 content_decryptor_delegate_->OnPromiseResolved(promise_id);
2294 content_decryptor_delegate_->OnSessionCreated(session_id, web_session_id_var); 2294 }
2295
2296 void PepperPluginInstanceImpl::PromiseResolvedWithSession(
2297 PP_Instance instance,
2298 uint32 promise_id,
2299 PP_Var web_session_id_var) {
2300 content_decryptor_delegate_->OnPromiseResolvedWithSession(promise_id,
2301 web_session_id_var);
2302 }
2303
2304 void PepperPluginInstanceImpl::PromiseRejected(
2305 PP_Instance instance,
2306 uint32 promise_id,
2307 PP_ExceptionCodeType exception_code,
2308 uint32 system_code,
2309 PP_Var error_description_var) {
2310 content_decryptor_delegate_->OnPromiseRejected(
2311 promise_id, exception_code, system_code, error_description_var);
2295 } 2312 }
2296 2313
2297 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance, 2314 void PepperPluginInstanceImpl::SessionMessage(PP_Instance instance,
2298 uint32_t session_id, 2315 PP_Var web_session_id_var,
2299 PP_Var message_var, 2316 PP_Var message_var,
2300 PP_Var destination_url) { 2317 PP_Var destination_url_var) {
2301 content_decryptor_delegate_->OnSessionMessage( 2318 content_decryptor_delegate_->OnSessionMessage(
2302 session_id, message_var, destination_url); 2319 web_session_id_var, message_var, destination_url_var);
2303 } 2320 }
2304 2321
2305 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance, 2322 void PepperPluginInstanceImpl::SessionReady(PP_Instance instance,
2306 uint32_t session_id) { 2323 PP_Var web_session_id_var) {
2307 content_decryptor_delegate_->OnSessionReady(session_id); 2324 content_decryptor_delegate_->OnSessionReady(web_session_id_var);
2308 } 2325 }
2309 2326
2310 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance, 2327 void PepperPluginInstanceImpl::SessionClosed(PP_Instance instance,
2311 uint32_t session_id) { 2328 PP_Var web_session_id_var) {
2312 content_decryptor_delegate_->OnSessionClosed(session_id); 2329 content_decryptor_delegate_->OnSessionClosed(web_session_id_var);
2313 } 2330 }
2314 2331
2315 void PepperPluginInstanceImpl::SessionError(PP_Instance instance, 2332 void PepperPluginInstanceImpl::SessionError(PP_Instance instance,
2316 uint32_t session_id, 2333 PP_Var web_session_id_var,
2317 int32_t media_error, 2334 PP_ExceptionCodeType exception_code,
2318 uint32_t system_code) { 2335 uint32 system_code,
2336 PP_Var error_description_var) {
2319 content_decryptor_delegate_->OnSessionError( 2337 content_decryptor_delegate_->OnSessionError(
2320 session_id, media_error, system_code); 2338 web_session_id_var, exception_code, system_code, error_description_var);
2321 } 2339 }
2322 2340
2323 void PepperPluginInstanceImpl::DeliverBlock( 2341 void PepperPluginInstanceImpl::DeliverBlock(
2324 PP_Instance instance, 2342 PP_Instance instance,
2325 PP_Resource decrypted_block, 2343 PP_Resource decrypted_block,
2326 const PP_DecryptedBlockInfo* block_info) { 2344 const PP_DecryptedBlockInfo* block_info) {
2327 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); 2345 content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info);
2328 } 2346 }
2329 2347
2330 void PepperPluginInstanceImpl::DecoderInitializeDone( 2348 void PepperPluginInstanceImpl::DecoderInitializeDone(
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698