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_image_data_proxy.h" | 5 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 #endif | 514 #endif |
| 515 IPC_MESSAGE_HANDLER(PpapiMsg_PPBImageData_NotifyUnusedImageData, | 515 IPC_MESSAGE_HANDLER(PpapiMsg_PPBImageData_NotifyUnusedImageData, |
| 516 OnPluginMsgNotifyUnusedImageData) | 516 OnPluginMsgNotifyUnusedImageData) |
| 517 | 517 |
| 518 IPC_MESSAGE_UNHANDLED(handled = false) | 518 IPC_MESSAGE_UNHANDLED(handled = false) |
| 519 IPC_END_MESSAGE_MAP() | 519 IPC_END_MESSAGE_MAP() |
| 520 return handled; | 520 return handled; |
| 521 } | 521 } |
| 522 | 522 |
| 523 #if !defined(OS_NACL) | 523 #if !defined(OS_NACL) |
| 524 // TODO(raymes): Do we leak resources in these Create functions if the code | |
| 525 // fails to return a handle to the plugin? | |
|
yzshen1
2013/04/03 18:32:39
The resource is passed to the plugin side as HostR
raymes
2013/04/03 23:18:21
ok I removed the todo
| |
| 524 void PPB_ImageData_Proxy::OnHostMsgCreate(PP_Instance instance, | 526 void PPB_ImageData_Proxy::OnHostMsgCreate(PP_Instance instance, |
| 525 int32_t format, | 527 int32_t format, |
| 526 const PP_Size& size, | 528 const PP_Size& size, |
| 527 PP_Bool init_to_zero, | 529 PP_Bool init_to_zero, |
| 528 HostResource* result, | 530 HostResource* result, |
| 529 std::string* image_data_desc, | 531 std::string* image_data_desc, |
| 530 ImageHandle* result_image_handle) { | 532 ImageHandle* result_image_handle) { |
| 531 *result_image_handle = ImageData::NullHandle(); | 533 *result_image_handle = ImageData::NullHandle(); |
| 532 | 534 |
| 533 thunk::EnterResourceCreation enter(instance); | 535 thunk::EnterResourceCreation enter(instance); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 // still cached in our process, the proxy still holds a reference so we can | 632 // still cached in our process, the proxy still holds a reference so we can |
| 631 // remove the one the renderer just sent is. If the proxy no longer holds a | 633 // remove the one the renderer just sent is. If the proxy no longer holds a |
| 632 // reference, we released everything and we should also release the one the | 634 // reference, we released everything and we should also release the one the |
| 633 // renderer just sent us. | 635 // renderer just sent us. |
| 634 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( | 636 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( |
| 635 API_ID_PPB_CORE, old_image_data)); | 637 API_ID_PPB_CORE, old_image_data)); |
| 636 } | 638 } |
| 637 | 639 |
| 638 } // namespace proxy | 640 } // namespace proxy |
| 639 } // namespace ppapi | 641 } // namespace ppapi |
| OLD | NEW |