| 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 "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 instance, | 593 instance, |
| 594 promise_id, | 594 promise_id, |
| 595 exception_code, | 595 exception_code, |
| 596 system_code, | 596 system_code, |
| 597 SerializedVarSendInput(dispatcher(), error_description_var))); | 597 SerializedVarSendInput(dispatcher(), error_description_var))); |
| 598 } | 598 } |
| 599 | 599 |
| 600 void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, | 600 void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, |
| 601 PP_Var web_session_id_var, | 601 PP_Var web_session_id_var, |
| 602 PP_CdmMessageType message_type, | 602 PP_CdmMessageType message_type, |
| 603 PP_Var message_var) { | 603 PP_Var message_var, |
| 604 PP_Var legacy_destination_url_var) { |
| 604 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( | 605 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( |
| 605 API_ID_PPB_INSTANCE, instance, | 606 API_ID_PPB_INSTANCE, instance, |
| 606 SerializedVarSendInput(dispatcher(), web_session_id_var), message_type, | 607 SerializedVarSendInput(dispatcher(), web_session_id_var), message_type, |
| 607 SerializedVarSendInput(dispatcher(), message_var))); | 608 SerializedVarSendInput(dispatcher(), message_var), |
| 609 SerializedVarSendInput(dispatcher(), legacy_destination_url_var))); |
| 608 } | 610 } |
| 609 | 611 |
| 610 void PPB_Instance_Proxy::SessionKeysChange( | 612 void PPB_Instance_Proxy::SessionKeysChange( |
| 611 PP_Instance instance, | 613 PP_Instance instance, |
| 612 PP_Var web_session_id_var, | 614 PP_Var web_session_id_var, |
| 613 PP_Bool has_additional_usable_key, | 615 PP_Bool has_additional_usable_key, |
| 614 uint32_t key_count, | 616 uint32_t key_count, |
| 615 const struct PP_KeyInformation key_information[]) { | 617 const struct PP_KeyInformation key_information[]) { |
| 616 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); | 618 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); |
| 617 if (!session_id || | 619 if (!session_id || |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 exception_code, | 1269 exception_code, |
| 1268 system_code, | 1270 system_code, |
| 1269 error_description.Get(dispatcher())); | 1271 error_description.Get(dispatcher())); |
| 1270 } | 1272 } |
| 1271 } | 1273 } |
| 1272 | 1274 |
| 1273 void PPB_Instance_Proxy::OnHostMsgSessionMessage( | 1275 void PPB_Instance_Proxy::OnHostMsgSessionMessage( |
| 1274 PP_Instance instance, | 1276 PP_Instance instance, |
| 1275 SerializedVarReceiveInput web_session_id, | 1277 SerializedVarReceiveInput web_session_id, |
| 1276 PP_CdmMessageType message_type, | 1278 PP_CdmMessageType message_type, |
| 1277 SerializedVarReceiveInput message) { | 1279 SerializedVarReceiveInput message, |
| 1280 SerializedVarReceiveInput legacy_destination_url) { |
| 1278 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1281 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1279 return; | 1282 return; |
| 1280 EnterInstanceNoLock enter(instance); | 1283 EnterInstanceNoLock enter(instance); |
| 1281 if (enter.succeeded()) { | 1284 if (enter.succeeded()) { |
| 1282 enter.functions()->SessionMessage(instance, | 1285 enter.functions()->SessionMessage( |
| 1283 web_session_id.Get(dispatcher()), | 1286 instance, web_session_id.Get(dispatcher()), message_type, |
| 1284 message_type, message.Get(dispatcher())); | 1287 message.Get(dispatcher()), legacy_destination_url.Get(dispatcher())); |
| 1285 } | 1288 } |
| 1286 } | 1289 } |
| 1287 | 1290 |
| 1288 void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( | 1291 void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( |
| 1289 PP_Instance instance, | 1292 PP_Instance instance, |
| 1290 const std::string& web_session_id, | 1293 const std::string& web_session_id, |
| 1291 PP_Bool has_additional_usable_key, | 1294 PP_Bool has_additional_usable_key, |
| 1292 const std::vector<PP_KeyInformation>& key_information) { | 1295 const std::vector<PP_KeyInformation>& key_information) { |
| 1293 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1296 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1294 return; | 1297 return; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 PP_Instance instance) { | 1519 PP_Instance instance) { |
| 1517 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1520 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1518 GetInstanceData(instance); | 1521 GetInstanceData(instance); |
| 1519 if (!data) | 1522 if (!data) |
| 1520 return; // Instance was probably deleted. | 1523 return; // Instance was probably deleted. |
| 1521 data->should_do_request_surrounding_text = false; | 1524 data->should_do_request_surrounding_text = false; |
| 1522 } | 1525 } |
| 1523 | 1526 |
| 1524 } // namespace proxy | 1527 } // namespace proxy |
| 1525 } // namespace ppapi | 1528 } // namespace ppapi |
| OLD | NEW |