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

Unified Diff: ppapi/proxy/file_chooser_resource.cc

Issue 10815073: Refactoring of new IPC-only pepper implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/file_chooser_resource.h ('k') | ppapi/proxy/plugin_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/file_chooser_resource.cc
diff --git a/ppapi/proxy/file_chooser_resource.cc b/ppapi/proxy/file_chooser_resource.cc
index e368f73a70e26db1ff4fc718e968e50a73af70a9..87d11285e1d1b1323370c53bf7ff14f34d849fdd 100644
--- a/ppapi/proxy/file_chooser_resource.cc
+++ b/ppapi/proxy/file_chooser_resource.cc
@@ -7,6 +7,7 @@
#include "base/string_split.h"
#include "ipc/ipc_message.h"
#include "ppapi/c/pp_errors.h"
+#include "ppapi/proxy/dispatch_reply_message.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_file_ref_proxy.h"
#include "ppapi/shared_impl/var.h"
@@ -14,11 +15,11 @@
namespace ppapi {
namespace proxy {
-FileChooserResource::FileChooserResource(IPC::Sender* sender,
+FileChooserResource::FileChooserResource(Connection connection,
PP_Instance instance,
PP_FileChooserMode_Dev mode,
const std::string& accept_types)
- : PluginResource(sender, instance),
+ : PluginResource(connection, instance),
mode_(mode) {
PopulateAcceptTypes(accept_types, &accept_types_);
}
@@ -96,13 +97,18 @@ void FileChooserResource::PopulateAcceptTypes(
}
}
-void FileChooserResource::OnReplyReceived(int /* sequence */,
- int32_t result,
- const IPC::Message& msg) {
- PpapiPluginMsg_FileChooser_ShowReply::Schema::Param param;
- PpapiPluginMsg_FileChooser_ShowReply::Read(&msg, &param);
- const std::vector<ppapi::PPB_FileRef_CreateInfo>& chosen_files = param.a;
+void FileChooserResource::OnReplyReceived(
+ const ResourceMessageReplyParams& params,
+ const IPC::Message& msg) {
+ IPC_BEGIN_MESSAGE_MAP(FileChooserResource, msg)
+ PPAPI_DISPATCH_RESOURCE_REPLY(PpapiPluginMsg_FileChooser_ShowReply,
+ OnPluginMsgShowReply)
+ IPC_END_MESSAGE_MAP()
+}
+void FileChooserResource::OnPluginMsgShowReply(
+ const ResourceMessageReplyParams& params,
+ const std::vector<PPB_FileRef_CreateInfo>& chosen_files) {
if (output_.is_valid()) {
// Using v0.6 of the API with the output array.
std::vector<PP_Resource> files;
@@ -120,7 +126,7 @@ void FileChooserResource::OnReplyReceived(int /* sequence */,
}
// Notify the plugin of the new data.
- TrackedCallback::ClearAndRun(&callback_, result);
+ TrackedCallback::ClearAndRun(&callback_, params.result());
// DANGER: May delete |this|!
}
« no previous file with comments | « ppapi/proxy/file_chooser_resource.h ('k') | ppapi/proxy/plugin_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698