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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 PP_Instance instance, | 780 PP_Instance instance, |
781 void* user_data, | 781 void* user_data, |
782 const PPP_MessageHandler_0_2* handler, | 782 const PPP_MessageHandler_0_2* handler, |
783 PP_Resource message_loop) { | 783 PP_Resource message_loop) { |
784 InstanceData* data = | 784 InstanceData* data = |
785 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); | 785 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); |
786 if (!data) | 786 if (!data) |
787 return PP_ERROR_BADARGUMENT; | 787 return PP_ERROR_BADARGUMENT; |
788 | 788 |
789 int32_t result = PP_ERROR_FAILED; | 789 int32_t result = PP_ERROR_FAILED; |
790 scoped_ptr<MessageHandler> message_handler = MessageHandler::Create( | 790 std::unique_ptr<MessageHandler> message_handler = MessageHandler::Create( |
791 instance, handler, user_data, message_loop, &result); | 791 instance, handler, user_data, message_loop, &result); |
792 if (message_handler) | 792 if (message_handler) |
793 data->message_handler = std::move(message_handler); | 793 data->message_handler = std::move(message_handler); |
794 return result; | 794 return result; |
795 } | 795 } |
796 | 796 |
797 void PPB_Instance_Proxy::UnregisterMessageHandler(PP_Instance instance) { | 797 void PPB_Instance_Proxy::UnregisterMessageHandler(PP_Instance instance) { |
798 InstanceData* data = | 798 InstanceData* data = |
799 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); | 799 static_cast<PluginDispatcher*>(dispatcher())->GetInstanceData(instance); |
800 if (!data) | 800 if (!data) |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 PP_Instance instance) { | 1465 PP_Instance instance) { |
1466 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1466 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1467 GetInstanceData(instance); | 1467 GetInstanceData(instance); |
1468 if (!data) | 1468 if (!data) |
1469 return; // Instance was probably deleted. | 1469 return; // Instance was probably deleted. |
1470 data->should_do_request_surrounding_text = false; | 1470 data->should_do_request_surrounding_text = false; |
1471 } | 1471 } |
1472 | 1472 |
1473 } // namespace proxy | 1473 } // namespace proxy |
1474 } // namespace ppapi | 1474 } // namespace ppapi |
OLD | NEW |