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

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

Issue 7608030: Convert the PluginResource to be refcounted. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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 "ppapi/proxy/ppb_flash_menu_proxy.h" 5 #include "ppapi/proxy/ppb_flash_menu_proxy.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_flash_menu.h" 8 #include "ppapi/c/private/ppb_flash_menu.h"
9 #include "ppapi/proxy/enter_proxy.h" 9 #include "ppapi/proxy/enter_proxy.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 HostResource result; 115 HostResource result;
116 pp::proxy::SerializedFlashMenu serialized_menu; 116 pp::proxy::SerializedFlashMenu serialized_menu;
117 if (!serialized_menu.SetPPMenu(menu_data)) 117 if (!serialized_menu.SetPPMenu(menu_data))
118 return 0; 118 return 0;
119 119
120 dispatcher->Send(new PpapiHostMsg_PPBFlashMenu_Create( 120 dispatcher->Send(new PpapiHostMsg_PPBFlashMenu_Create(
121 INTERFACE_ID_PPB_FLASH_MENU, instance_id, serialized_menu, &result)); 121 INTERFACE_ID_PPB_FLASH_MENU, instance_id, serialized_menu, &result));
122 if (result.is_null()) 122 if (result.is_null())
123 return 0; 123 return 0;
124 124
125 linked_ptr<FlashMenu> menu(new FlashMenu(result)); 125 return PluginResourceTracker::GetInstance()->AddResource(
126 return PluginResourceTracker::GetInstance()->AddResource(menu); 126 new FlashMenu(result));
127 } 127 }
128 128
129 bool PPB_Flash_Menu_Proxy::OnMessageReceived(const IPC::Message& msg) { 129 bool PPB_Flash_Menu_Proxy::OnMessageReceived(const IPC::Message& msg) {
130 bool handled = true; 130 bool handled = true;
131 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Menu_Proxy, msg) 131 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Menu_Proxy, msg)
132 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Create, 132 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Create,
133 OnMsgCreate) 133 OnMsgCreate)
134 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Show, 134 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Show,
135 OnMsgShow) 135 OnMsgShow)
136 136
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( 187 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK(
188 INTERFACE_ID_PPB_FLASH_MENU, 188 INTERFACE_ID_PPB_FLASH_MENU,
189 request->menu, 189 request->menu,
190 request->selected_id, 190 request->selected_id,
191 result)); 191 result));
192 delete request; 192 delete request;
193 } 193 }
194 194
195 } // namespace proxy 195 } // namespace proxy
196 } // namespace pp 196 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698