Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.h ('k') | ppapi/proxy/ppb_message_loop_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.h ('k') | ppapi/proxy/ppb_message_loop_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698