| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 if (!render_view_->Send(msg)) { | 1451 if (!render_view_->Send(msg)) { |
| 1452 pending_connect_tcps_.Remove(request_id); | 1452 pending_connect_tcps_.Remove(request_id); |
| 1453 return PP_ERROR_FAILED; | 1453 return PP_ERROR_FAILED; |
| 1454 } | 1454 } |
| 1455 | 1455 |
| 1456 return PP_OK_COMPLETIONPENDING; | 1456 return PP_OK_COMPLETIONPENDING; |
| 1457 } | 1457 } |
| 1458 | 1458 |
| 1459 int32_t PepperPluginDelegateImpl::ConnectTcpAddress( | 1459 int32_t PepperPluginDelegateImpl::ConnectTcpAddress( |
| 1460 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 1460 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
| 1461 const struct PP_Flash_NetAddress* addr) { | 1461 const struct PP_NetAddress_Private* addr) { |
| 1462 int request_id = pending_connect_tcps_.Add( | 1462 int request_id = pending_connect_tcps_.Add( |
| 1463 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); | 1463 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); |
| 1464 IPC::Message* msg = | 1464 IPC::Message* msg = |
| 1465 new PepperMsg_ConnectTcpAddress(render_view_->routing_id(), | 1465 new PepperMsg_ConnectTcpAddress(render_view_->routing_id(), |
| 1466 request_id, | 1466 request_id, |
| 1467 *addr); | 1467 *addr); |
| 1468 if (!render_view_->Send(msg)) { | 1468 if (!render_view_->Send(msg)) { |
| 1469 pending_connect_tcps_.Remove(request_id); | 1469 pending_connect_tcps_.Remove(request_id); |
| 1470 return PP_ERROR_FAILED; | 1470 return PP_ERROR_FAILED; |
| 1471 } | 1471 } |
| 1472 | 1472 |
| 1473 return PP_OK_COMPLETIONPENDING; | 1473 return PP_OK_COMPLETIONPENDING; |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 void PepperPluginDelegateImpl::OnConnectTcpACK( | 1476 void PepperPluginDelegateImpl::OnConnectTcpACK( |
| 1477 int request_id, | 1477 int request_id, |
| 1478 base::PlatformFile socket, | 1478 base::PlatformFile socket, |
| 1479 const PP_Flash_NetAddress& local_addr, | 1479 const PP_NetAddress_Private& local_addr, |
| 1480 const PP_Flash_NetAddress& remote_addr) { | 1480 const PP_NetAddress_Private& remote_addr) { |
| 1481 scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl> connector = | 1481 scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl> connector = |
| 1482 *pending_connect_tcps_.Lookup(request_id); | 1482 *pending_connect_tcps_.Lookup(request_id); |
| 1483 pending_connect_tcps_.Remove(request_id); | 1483 pending_connect_tcps_.Remove(request_id); |
| 1484 | 1484 |
| 1485 connector->CompleteConnectTcp(socket, local_addr, remote_addr); | 1485 connector->CompleteConnectTcp(socket, local_addr, remote_addr); |
| 1486 } | 1486 } |
| 1487 | 1487 |
| 1488 int32_t PepperPluginDelegateImpl::ShowContextMenu( | 1488 int32_t PepperPluginDelegateImpl::ShowContextMenu( |
| 1489 webkit::ppapi::PluginInstance* instance, | 1489 webkit::ppapi::PluginInstance* instance, |
| 1490 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 1490 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1737 if (!context) | 1737 if (!context) |
| 1738 return NULL; | 1738 return NULL; |
| 1739 if (!context->makeContextCurrent() || context->isContextLost()) | 1739 if (!context->makeContextCurrent() || context->isContextLost()) |
| 1740 return NULL; | 1740 return NULL; |
| 1741 | 1741 |
| 1742 RendererGLContext* parent_context = context->context(); | 1742 RendererGLContext* parent_context = context->context(); |
| 1743 if (!parent_context) | 1743 if (!parent_context) |
| 1744 return NULL; | 1744 return NULL; |
| 1745 return parent_context; | 1745 return parent_context; |
| 1746 } | 1746 } |
| OLD | NEW |