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

Unified Diff: ppapi/proxy/ppb_file_chooser_proxy.cc

Issue 7551032: Add a template to handle properly issuing completion callbacks. This fixes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_broker_proxy.cc ('k') | ppapi/proxy/ppb_file_system_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_file_chooser_proxy.cc
===================================================================
--- ppapi/proxy/ppb_file_chooser_proxy.cc (revision 94913)
+++ ppapi/proxy/ppb_file_chooser_proxy.cc (working copy)
@@ -194,13 +194,11 @@
}
void PPB_FileChooser_Proxy::OnMsgShow(const HostResource& chooser) {
- CompletionCallback callback = callback_factory_.NewOptionalCallback(
- &PPB_FileChooser_Proxy::OnShowCallback, chooser);
-
- int32_t result = ppb_file_chooser_target()->Show(
- chooser.host_resource(), callback.pp_completion_callback());
- if (result != PP_OK_COMPLETIONPENDING)
- callback.Run(result);
+ EnterHostFromHostResourceForceCallback<PPB_FileChooser_API> enter(
+ chooser, callback_factory_, &PPB_FileChooser_Proxy::OnShowCallback,
+ chooser);
+ if (enter.succeeded())
+ enter.SetResult(enter.object()->Show(enter.callback()));
}
void PPB_FileChooser_Proxy::OnMsgChooseComplete(
« no previous file with comments | « ppapi/proxy/ppb_broker_proxy.cc ('k') | ppapi/proxy/ppb_file_system_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698