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

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

Issue 8359010: Convert the Flash interfaces to no longer use GetInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 9 years, 2 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
« no previous file with comments | « ppapi/proxy/ppb_flash_menu_proxy.h ('k') | ppapi/proxy/ppb_flash_net_connector_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) 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"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppb_flash_menu_api.h" 12 #include "ppapi/thunk/ppb_flash_menu_api.h"
13 #include "ppapi/thunk/resource_creation_api.h" 13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
15 14
16 using ppapi::thunk::EnterFunctionNoLock; 15 using ppapi::thunk::EnterFunctionNoLock;
17 using ppapi::thunk::PPB_Flash_Menu_API; 16 using ppapi::thunk::PPB_Flash_Menu_API;
18 using ppapi::thunk::ResourceCreationAPI; 17 using ppapi::thunk::ResourceCreationAPI;
19 18
20 namespace ppapi { 19 namespace ppapi {
21 namespace proxy { 20 namespace proxy {
22 21
23 class FlashMenu : public PPB_Flash_Menu_API, public Resource { 22 class FlashMenu : public PPB_Flash_Menu_API, public Resource {
24 public: 23 public:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 new PpapiHostMsg_PPBFlashMenu_Show( 67 new PpapiHostMsg_PPBFlashMenu_Show(
69 API_ID_PPB_FLASH_MENU, host_resource(), *location)); 68 API_ID_PPB_FLASH_MENU, host_resource(), *location));
70 return PP_OK_COMPLETIONPENDING; 69 return PP_OK_COMPLETIONPENDING;
71 } 70 }
72 71
73 void FlashMenu::ShowACK(int32_t selected_id, int32_t result) { 72 void FlashMenu::ShowACK(int32_t selected_id, int32_t result) {
74 *selected_id_ptr_ = selected_id; 73 *selected_id_ptr_ = selected_id;
75 PP_RunAndClearCompletionCallback(&callback_, result); 74 PP_RunAndClearCompletionCallback(&callback_, result);
76 } 75 }
77 76
78 namespace {
79
80 InterfaceProxy* CreateFlashMenuProxy(Dispatcher* dispatcher) {
81 return new PPB_Flash_Menu_Proxy(dispatcher);
82 }
83
84 } // namespace
85
86 PPB_Flash_Menu_Proxy::PPB_Flash_Menu_Proxy(Dispatcher* dispatcher) 77 PPB_Flash_Menu_Proxy::PPB_Flash_Menu_Proxy(Dispatcher* dispatcher)
87 : InterfaceProxy(dispatcher), 78 : InterfaceProxy(dispatcher),
88 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 79 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
89 } 80 }
90 81
91 PPB_Flash_Menu_Proxy::~PPB_Flash_Menu_Proxy() { 82 PPB_Flash_Menu_Proxy::~PPB_Flash_Menu_Proxy() {
92 } 83 }
93 84
94 // static 85 // static
95 const InterfaceProxy::Info* PPB_Flash_Menu_Proxy::GetInfo() {
96 static const Info info = {
97 ppapi::thunk::GetPPB_Flash_Menu_Thunk(),
98 PPB_FLASH_MENU_INTERFACE,
99 API_ID_PPB_FLASH_MENU,
100 true,
101 &CreateFlashMenuProxy,
102 };
103 return &info;
104 }
105
106 // static
107 PP_Resource PPB_Flash_Menu_Proxy::CreateProxyResource( 86 PP_Resource PPB_Flash_Menu_Proxy::CreateProxyResource(
108 PP_Instance instance_id, 87 PP_Instance instance_id,
109 const PP_Flash_Menu* menu_data) { 88 const PP_Flash_Menu* menu_data) {
110 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id); 89 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
111 if (!dispatcher) 90 if (!dispatcher)
112 return 0; 91 return 0;
113 92
114 HostResource result; 93 HostResource result;
115 SerializedFlashMenu serialized_menu; 94 SerializedFlashMenu serialized_menu;
116 if (!serialized_menu.SetPPMenu(menu_data)) 95 if (!serialized_menu.SetPPMenu(menu_data))
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( 163 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK(
185 API_ID_PPB_FLASH_MENU, 164 API_ID_PPB_FLASH_MENU,
186 request->menu, 165 request->menu,
187 request->selected_id, 166 request->selected_id,
188 result)); 167 result));
189 delete request; 168 delete request;
190 } 169 }
191 170
192 } // namespace proxy 171 } // namespace proxy
193 } // namespace ppapi 172 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_flash_menu_proxy.h ('k') | ppapi/proxy/ppb_flash_net_connector_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698