Chromium Code Reviews| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument, | 175 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument, |
| 176 OnHostMsgDocumentCanAccessDocument) | 176 OnHostMsgDocumentCanAccessDocument) |
| 177 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL, | 177 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL, |
| 178 OnHostMsgGetPluginInstanceURL) | 178 OnHostMsgGetPluginInstanceURL) |
| 179 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginReferrerURL, | 179 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginReferrerURL, |
| 180 OnHostMsgGetPluginReferrerURL) | 180 OnHostMsgGetPluginReferrerURL) |
| 181 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseResolved, | 181 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseResolved, |
| 182 OnHostMsgPromiseResolved) | 182 OnHostMsgPromiseResolved) |
| 183 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseResolvedWithSession, | 183 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseResolvedWithSession, |
| 184 OnHostMsgPromiseResolvedWithSession) | 184 OnHostMsgPromiseResolvedWithSession) |
| 185 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseResolvedWithKeyIds, | |
| 186 OnHostMsgPromiseResolvedWithKeyIds) | |
| 187 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseRejected, | 185 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PromiseRejected, |
| 188 OnHostMsgPromiseRejected) | 186 OnHostMsgPromiseRejected) |
| 189 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionMessage, | 187 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionMessage, |
| 190 OnHostMsgSessionMessage) | 188 OnHostMsgSessionMessage) |
| 191 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionKeysChange, | 189 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionKeysChange, |
| 192 OnHostMsgSessionKeysChange) | 190 OnHostMsgSessionKeysChange) |
| 193 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionExpirationChange, | 191 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionExpirationChange, |
| 194 OnHostMsgSessionExpirationChange) | 192 OnHostMsgSessionExpirationChange) |
| 195 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionReady, | |
| 196 OnHostMsgSessionReady) | |
| 197 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionClosed, | 193 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionClosed, |
| 198 OnHostMsgSessionClosed) | 194 OnHostMsgSessionClosed) |
| 199 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionError, | 195 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SessionError, |
| 200 OnHostMsgSessionError) | 196 OnHostMsgSessionError) |
| 201 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, | 197 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, |
| 202 OnHostMsgDeliverBlock) | 198 OnHostMsgDeliverBlock) |
| 203 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitializeDone, | 199 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitializeDone, |
| 204 OnHostMsgDecoderInitializeDone) | 200 OnHostMsgDecoderInitializeDone) |
| 205 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, | 201 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, |
| 206 OnHostMsgDecoderDeinitializeDone) | 202 OnHostMsgDecoderDeinitializeDone) |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 void PPB_Instance_Proxy::PromiseResolvedWithSession(PP_Instance instance, | 575 void PPB_Instance_Proxy::PromiseResolvedWithSession(PP_Instance instance, |
| 580 uint32 promise_id, | 576 uint32 promise_id, |
| 581 PP_Var web_session_id_var) { | 577 PP_Var web_session_id_var) { |
| 582 dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseResolvedWithSession( | 578 dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseResolvedWithSession( |
| 583 API_ID_PPB_INSTANCE, | 579 API_ID_PPB_INSTANCE, |
| 584 instance, | 580 instance, |
| 585 promise_id, | 581 promise_id, |
| 586 SerializedVarSendInput(dispatcher(), web_session_id_var))); | 582 SerializedVarSendInput(dispatcher(), web_session_id_var))); |
| 587 } | 583 } |
| 588 | 584 |
| 589 void PPB_Instance_Proxy::PromiseResolvedWithKeyIds(PP_Instance instance, | |
| 590 uint32 promise_id, | |
| 591 PP_Var key_ids_var) { | |
| 592 ArrayVar* key_ids_array = ArrayVar::FromPPVar(key_ids_var); | |
| 593 if (!key_ids_array || | |
| 594 key_ids_array->GetLength() > media::limits::kMaxKeyIds) { | |
| 595 NOTREACHED(); | |
| 596 return; | |
| 597 } | |
| 598 | |
| 599 std::vector<std::vector<uint8_t> > key_ids; | |
| 600 for (size_t i = 0; i < key_ids_array->GetLength(); ++i) { | |
| 601 ArrayBufferVar* key_id = ArrayBufferVar::FromPPVar(key_ids_array->Get(i)); | |
| 602 if (!key_id || key_id->ByteLength() < media::limits::kMinKeyIdLength || | |
| 603 key_id->ByteLength() > media::limits::kMaxKeyIdLength) { | |
| 604 NOTREACHED(); | |
| 605 continue; | |
| 606 } | |
| 607 | |
| 608 const uint8_t* key_id_ptr = static_cast<const uint8_t*>(key_id->Map()); | |
| 609 const uint32_t key_id_size = key_id->ByteLength(); | |
| 610 std::vector<uint8_t> key_id_vector(key_id_ptr, key_id_ptr + key_id_size); | |
| 611 key_ids.push_back(key_id_vector); | |
| 612 } | |
| 613 | |
| 614 dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseResolvedWithKeyIds( | |
| 615 API_ID_PPB_INSTANCE, instance, promise_id, key_ids)); | |
| 616 } | |
| 617 | |
| 618 void PPB_Instance_Proxy::PromiseRejected(PP_Instance instance, | 585 void PPB_Instance_Proxy::PromiseRejected(PP_Instance instance, |
| 619 uint32 promise_id, | 586 uint32 promise_id, |
| 620 PP_CdmExceptionCode exception_code, | 587 PP_CdmExceptionCode exception_code, |
| 621 uint32 system_code, | 588 uint32 system_code, |
| 622 PP_Var error_description_var) { | 589 PP_Var error_description_var) { |
| 623 dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseRejected( | 590 dispatcher()->Send(new PpapiHostMsg_PPBInstance_PromiseRejected( |
| 624 API_ID_PPB_INSTANCE, | 591 API_ID_PPB_INSTANCE, |
| 625 instance, | 592 instance, |
| 626 promise_id, | 593 promise_id, |
| 627 exception_code, | 594 exception_code, |
| 628 system_code, | 595 system_code, |
| 629 SerializedVarSendInput(dispatcher(), error_description_var))); | 596 SerializedVarSendInput(dispatcher(), error_description_var))); |
| 630 } | 597 } |
| 631 | 598 |
| 632 void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, | 599 void PPB_Instance_Proxy::SessionMessage(PP_Instance instance, |
| 633 PP_Var web_session_id_var, | 600 PP_Var web_session_id_var, |
| 634 PP_Var message_var, | 601 PP_CdmMessageType message_type, |
| 635 PP_Var destination_url_var) { | 602 PP_Var message_var) { |
| 636 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( | 603 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionMessage( |
| 637 API_ID_PPB_INSTANCE, | 604 API_ID_PPB_INSTANCE, instance, |
| 638 instance, | 605 SerializedVarSendInput(dispatcher(), web_session_id_var), message_type, |
| 639 SerializedVarSendInput(dispatcher(), web_session_id_var), | 606 SerializedVarSendInput(dispatcher(), message_var))); |
| 640 SerializedVarSendInput(dispatcher(), message_var), | |
| 641 SerializedVarSendInput(dispatcher(), destination_url_var))); | |
| 642 } | 607 } |
| 643 | 608 |
| 644 void PPB_Instance_Proxy::SessionKeysChange(PP_Instance instance, | 609 void PPB_Instance_Proxy::SessionKeysChange( |
| 645 PP_Var web_session_id_var, | 610 PP_Instance instance, |
| 646 PP_Bool has_additional_usable_key) { | 611 PP_Var web_session_id_var, |
| 612 PP_Bool has_additional_usable_key, | |
| 613 uint32_t key_count, | |
| 614 const struct PP_KeyInformation key_information[]) { | |
| 647 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); | 615 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); |
| 648 if (!session_id || | 616 if (!session_id || |
| 649 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { | 617 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { |
| 650 NOTREACHED(); | 618 NOTREACHED(); |
| 651 return; | 619 return; |
| 652 } | 620 } |
| 653 | 621 |
| 622 if (key_count > media::limits::kMaxKeyIds) { | |
| 623 NOTREACHED(); | |
| 624 return; | |
| 625 } | |
| 626 | |
| 654 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionKeysChange( | 627 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionKeysChange( |
| 655 API_ID_PPB_INSTANCE, | 628 API_ID_PPB_INSTANCE, instance, session_id->value(), |
| 656 instance, | 629 has_additional_usable_key, |
| 657 session_id->value(), | 630 std::vector<PP_KeyInformation>(key_information, |
| 658 has_additional_usable_key)); | 631 key_information + key_count))); |
| 659 } | 632 } |
| 660 | 633 |
| 661 void PPB_Instance_Proxy::SessionExpirationChange(PP_Instance instance, | 634 void PPB_Instance_Proxy::SessionExpirationChange(PP_Instance instance, |
| 662 PP_Var web_session_id_var, | 635 PP_Var web_session_id_var, |
| 663 PP_Time new_expiry_time) { | 636 PP_Time new_expiry_time) { |
| 664 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); | 637 StringVar* session_id = StringVar::FromPPVar(web_session_id_var); |
| 665 if (!session_id || | 638 if (!session_id || |
| 666 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { | 639 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { |
| 667 NOTREACHED(); | 640 NOTREACHED(); |
| 668 return; | 641 return; |
| 669 } | 642 } |
| 670 | 643 |
| 671 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionExpirationChange( | 644 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionExpirationChange( |
| 672 API_ID_PPB_INSTANCE, instance, session_id->value(), new_expiry_time)); | 645 API_ID_PPB_INSTANCE, instance, session_id->value(), new_expiry_time)); |
| 673 } | 646 } |
| 674 | 647 |
| 675 void PPB_Instance_Proxy::SessionReady(PP_Instance instance, | |
| 676 PP_Var web_session_id_var) { | |
| 677 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionReady( | |
| 678 API_ID_PPB_INSTANCE, | |
| 679 instance, | |
| 680 SerializedVarSendInput(dispatcher(), web_session_id_var))); | |
| 681 } | |
| 682 | |
| 683 void PPB_Instance_Proxy::SessionClosed(PP_Instance instance, | 648 void PPB_Instance_Proxy::SessionClosed(PP_Instance instance, |
| 684 PP_Var web_session_id_var) { | 649 PP_Var web_session_id_var) { |
| 685 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionClosed( | 650 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SessionClosed( |
| 686 API_ID_PPB_INSTANCE, | 651 API_ID_PPB_INSTANCE, |
| 687 instance, | 652 instance, |
| 688 SerializedVarSendInput(dispatcher(), web_session_id_var))); | 653 SerializedVarSendInput(dispatcher(), web_session_id_var))); |
| 689 } | 654 } |
| 690 | 655 |
| 691 void PPB_Instance_Proxy::SessionError(PP_Instance instance, | 656 void PPB_Instance_Proxy::SessionError(PP_Instance instance, |
| 692 PP_Var web_session_id_var, | 657 PP_Var web_session_id_var, |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1279 SerializedVarReceiveInput web_session_id) { | 1244 SerializedVarReceiveInput web_session_id) { |
| 1280 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1245 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1281 return; | 1246 return; |
| 1282 EnterInstanceNoLock enter(instance); | 1247 EnterInstanceNoLock enter(instance); |
| 1283 if (enter.succeeded()) { | 1248 if (enter.succeeded()) { |
| 1284 enter.functions()->PromiseResolvedWithSession( | 1249 enter.functions()->PromiseResolvedWithSession( |
| 1285 instance, promise_id, web_session_id.Get(dispatcher())); | 1250 instance, promise_id, web_session_id.Get(dispatcher())); |
| 1286 } | 1251 } |
| 1287 } | 1252 } |
| 1288 | 1253 |
| 1289 void PPB_Instance_Proxy::OnHostMsgPromiseResolvedWithKeyIds( | |
| 1290 PP_Instance instance, | |
| 1291 uint32_t promise_id, | |
| 1292 const std::vector<std::vector<uint8_t> >& key_ids) { | |
| 1293 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | |
| 1294 return; | |
| 1295 if (key_ids.size() > media::limits::kMaxKeyIds) { | |
| 1296 NOTREACHED(); | |
| 1297 return; | |
| 1298 } | |
| 1299 | |
| 1300 scoped_refptr<ArrayVar> key_ids_array = new ArrayVar(); | |
| 1301 key_ids_array->SetLength(key_ids.size()); | |
| 1302 for (size_t i = 0; i < key_ids.size(); ++i) { | |
| 1303 const std::vector<uint8_t>& entry = key_ids[i]; | |
| 1304 if (entry.size() < media::limits::kMinKeyIdLength || | |
| 1305 entry.size() > media::limits::kMaxKeyIdLength) { | |
| 1306 NOTREACHED(); | |
| 1307 continue; | |
| 1308 } | |
| 1309 key_ids_array->Set( | |
| 1310 i, | |
| 1311 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(entry.size(), | |
| 1312 &entry[0])); | |
| 1313 } | |
| 1314 | |
| 1315 EnterInstanceNoLock enter(instance); | |
| 1316 if (enter.succeeded()) { | |
| 1317 ScopedPPVar key_ids_var(ScopedPPVar::PassRef(), key_ids_array->GetPPVar()); | |
| 1318 enter.functions()->PromiseResolvedWithKeyIds( | |
| 1319 instance, promise_id, key_ids_var.get()); | |
| 1320 } | |
| 1321 } | |
| 1322 | |
| 1323 void PPB_Instance_Proxy::OnHostMsgPromiseRejected( | 1254 void PPB_Instance_Proxy::OnHostMsgPromiseRejected( |
| 1324 PP_Instance instance, | 1255 PP_Instance instance, |
| 1325 uint32_t promise_id, | 1256 uint32_t promise_id, |
| 1326 PP_CdmExceptionCode exception_code, | 1257 PP_CdmExceptionCode exception_code, |
| 1327 uint32_t system_code, | 1258 uint32_t system_code, |
| 1328 SerializedVarReceiveInput error_description) { | 1259 SerializedVarReceiveInput error_description) { |
| 1329 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1260 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1330 return; | 1261 return; |
| 1331 EnterInstanceNoLock enter(instance); | 1262 EnterInstanceNoLock enter(instance); |
| 1332 if (enter.succeeded()) { | 1263 if (enter.succeeded()) { |
| 1333 enter.functions()->PromiseRejected(instance, | 1264 enter.functions()->PromiseRejected(instance, |
| 1334 promise_id, | 1265 promise_id, |
| 1335 exception_code, | 1266 exception_code, |
| 1336 system_code, | 1267 system_code, |
| 1337 error_description.Get(dispatcher())); | 1268 error_description.Get(dispatcher())); |
| 1338 } | 1269 } |
| 1339 } | 1270 } |
| 1340 | 1271 |
| 1341 void PPB_Instance_Proxy::OnHostMsgSessionMessage( | 1272 void PPB_Instance_Proxy::OnHostMsgSessionMessage( |
| 1342 PP_Instance instance, | 1273 PP_Instance instance, |
| 1343 SerializedVarReceiveInput web_session_id, | 1274 SerializedVarReceiveInput web_session_id, |
| 1344 SerializedVarReceiveInput message, | 1275 PP_CdmMessageType message_type, |
| 1345 SerializedVarReceiveInput destination_url) { | 1276 SerializedVarReceiveInput message) { |
| 1346 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1277 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1347 return; | 1278 return; |
| 1348 EnterInstanceNoLock enter(instance); | 1279 EnterInstanceNoLock enter(instance); |
| 1349 if (enter.succeeded()) { | 1280 if (enter.succeeded()) { |
| 1350 enter.functions()->SessionMessage(instance, | 1281 enter.functions()->SessionMessage(instance, |
| 1351 web_session_id.Get(dispatcher()), | 1282 web_session_id.Get(dispatcher()), |
| 1352 message.Get(dispatcher()), | 1283 message_type, message.Get(dispatcher())); |
| 1353 destination_url.Get(dispatcher())); | |
| 1354 } | 1284 } |
| 1355 } | 1285 } |
| 1356 | 1286 |
| 1357 void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( | 1287 void PPB_Instance_Proxy::OnHostMsgSessionKeysChange( |
| 1358 PP_Instance instance, | 1288 PP_Instance instance, |
| 1359 const std::string& web_session_id, | 1289 const std::string& web_session_id, |
| 1360 PP_Bool has_additional_usable_key) { | 1290 PP_Bool has_additional_usable_key, |
| 1291 const std::vector<PP_KeyInformation>& key_information) { | |
| 1361 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1292 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1362 return; | 1293 return; |
| 1294 | |
| 1295 if (key_information.size() > media::limits::kMaxKeyIds) { | |
| 1296 NOTREACHED(); | |
| 1297 return; | |
| 1298 } | |
| 1299 | |
| 1363 EnterInstanceNoLock enter(instance); | 1300 EnterInstanceNoLock enter(instance); |
| 1364 if (enter.succeeded()) { | 1301 if (enter.succeeded()) { |
| 1365 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), | 1302 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), |
| 1366 StringVar::StringToPPVar(web_session_id)); | 1303 StringVar::StringToPPVar(web_session_id)); |
| 1367 enter.functions()->SessionKeysChange( | 1304 enter.functions()->SessionKeysChange( |
| 1368 instance, web_session_id_var.get(), has_additional_usable_key); | 1305 instance, web_session_id_var.get(), has_additional_usable_key, |
| 1306 key_information.size(), | |
| 1307 key_information.empty() ? NULL : &key_information[0]); | |
|
dcheng
2015/01/08 19:12:31
It might be slightly clearer to say vector_as_arra
dcheng
2015/01/08 19:12:31
I think you can use vector_as_array() here.
jrummell
2015/01/08 20:12:12
Done.
jrummell
2015/01/08 20:12:12
Done.
| |
| 1369 } | 1308 } |
| 1370 } | 1309 } |
| 1371 | 1310 |
| 1372 void PPB_Instance_Proxy::OnHostMsgSessionExpirationChange( | 1311 void PPB_Instance_Proxy::OnHostMsgSessionExpirationChange( |
| 1373 PP_Instance instance, | 1312 PP_Instance instance, |
| 1374 const std::string& web_session_id, | 1313 const std::string& web_session_id, |
| 1375 PP_Time new_expiry_time) { | 1314 PP_Time new_expiry_time) { |
| 1376 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1315 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1377 return; | 1316 return; |
| 1378 EnterInstanceNoLock enter(instance); | 1317 EnterInstanceNoLock enter(instance); |
| 1379 if (enter.succeeded()) { | 1318 if (enter.succeeded()) { |
| 1380 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), | 1319 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), |
| 1381 StringVar::StringToPPVar(web_session_id)); | 1320 StringVar::StringToPPVar(web_session_id)); |
| 1382 enter.functions()->SessionExpirationChange( | 1321 enter.functions()->SessionExpirationChange( |
| 1383 instance, web_session_id_var.get(), new_expiry_time); | 1322 instance, web_session_id_var.get(), new_expiry_time); |
| 1384 } | 1323 } |
| 1385 } | 1324 } |
| 1386 | 1325 |
| 1387 void PPB_Instance_Proxy::OnHostMsgSessionReady( | |
| 1388 PP_Instance instance, | |
| 1389 SerializedVarReceiveInput web_session_id) { | |
| 1390 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | |
| 1391 return; | |
| 1392 EnterInstanceNoLock enter(instance); | |
| 1393 if (enter.succeeded()) { | |
| 1394 enter.functions()->SessionReady(instance, web_session_id.Get(dispatcher())); | |
| 1395 } | |
| 1396 } | |
| 1397 | |
| 1398 void PPB_Instance_Proxy::OnHostMsgSessionClosed( | 1326 void PPB_Instance_Proxy::OnHostMsgSessionClosed( |
| 1399 PP_Instance instance, | 1327 PP_Instance instance, |
| 1400 SerializedVarReceiveInput web_session_id) { | 1328 SerializedVarReceiveInput web_session_id) { |
| 1401 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 1329 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 1402 return; | 1330 return; |
| 1403 EnterInstanceNoLock enter(instance); | 1331 EnterInstanceNoLock enter(instance); |
| 1404 if (enter.succeeded()) { | 1332 if (enter.succeeded()) { |
| 1405 enter.functions()->SessionClosed(instance, | 1333 enter.functions()->SessionClosed(instance, |
| 1406 web_session_id.Get(dispatcher())); | 1334 web_session_id.Get(dispatcher())); |
| 1407 } | 1335 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1588 PP_Instance instance) { | 1516 PP_Instance instance) { |
| 1589 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1517 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1590 GetInstanceData(instance); | 1518 GetInstanceData(instance); |
| 1591 if (!data) | 1519 if (!data) |
| 1592 return; // Instance was probably deleted. | 1520 return; // Instance was probably deleted. |
| 1593 data->should_do_request_surrounding_text = false; | 1521 data->should_do_request_surrounding_text = false; |
| 1594 } | 1522 } |
| 1595 | 1523 |
| 1596 } // namespace proxy | 1524 } // namespace proxy |
| 1597 } // namespace ppapi | 1525 } // namespace ppapi |
| OLD | NEW |