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/numerics/safe_conversions.h" |
8 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
10 #include "media/base/limits.h" | 11 #include "media/base/limits.h" |
11 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
12 #include "ppapi/c/pp_time.h" | 13 #include "ppapi/c/pp_time.h" |
13 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
14 #include "ppapi/c/ppb_audio_config.h" | 15 #include "ppapi/c/ppb_audio_config.h" |
15 #include "ppapi/c/ppb_instance.h" | 16 #include "ppapi/c/ppb_instance.h" |
16 #include "ppapi/c/ppb_messaging.h" | 17 #include "ppapi/c/ppb_messaging.h" |
17 #include "ppapi/c/ppb_mouse_lock.h" | 18 #include "ppapi/c/ppb_mouse_lock.h" |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 NOTREACHED(); | 1296 NOTREACHED(); |
1296 return; | 1297 return; |
1297 } | 1298 } |
1298 | 1299 |
1299 EnterInstanceNoLock enter(instance); | 1300 EnterInstanceNoLock enter(instance); |
1300 if (enter.succeeded()) { | 1301 if (enter.succeeded()) { |
1301 ScopedPPVar session_id_var(ScopedPPVar::PassRef(), | 1302 ScopedPPVar session_id_var(ScopedPPVar::PassRef(), |
1302 StringVar::StringToPPVar(session_id)); | 1303 StringVar::StringToPPVar(session_id)); |
1303 enter.functions()->SessionKeysChange( | 1304 enter.functions()->SessionKeysChange( |
1304 instance, session_id_var.get(), has_additional_usable_key, | 1305 instance, session_id_var.get(), has_additional_usable_key, |
1305 key_information.size(), vector_as_array(&key_information)); | 1306 base::checked_cast<uint32_t>(key_information.size()), |
| 1307 vector_as_array(&key_information)); |
1306 } | 1308 } |
1307 } | 1309 } |
1308 | 1310 |
1309 void PPB_Instance_Proxy::OnHostMsgSessionExpirationChange( | 1311 void PPB_Instance_Proxy::OnHostMsgSessionExpirationChange( |
1310 PP_Instance instance, | 1312 PP_Instance instance, |
1311 const std::string& session_id, | 1313 const std::string& session_id, |
1312 PP_Time new_expiry_time) { | 1314 PP_Time new_expiry_time) { |
1313 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1315 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
1314 return; | 1316 return; |
1315 EnterInstanceNoLock enter(instance); | 1317 EnterInstanceNoLock enter(instance); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 PP_Instance instance) { | 1513 PP_Instance instance) { |
1512 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1514 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1513 GetInstanceData(instance); | 1515 GetInstanceData(instance); |
1514 if (!data) | 1516 if (!data) |
1515 return; // Instance was probably deleted. | 1517 return; // Instance was probably deleted. |
1516 data->should_do_request_surrounding_text = false; | 1518 data->should_do_request_surrounding_text = false; |
1517 } | 1519 } |
1518 | 1520 |
1519 } // namespace proxy | 1521 } // namespace proxy |
1520 } // namespace ppapi | 1522 } // namespace ppapi |
OLD | NEW |