summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-20 04:53:22 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-20 04:53:22 +0000
commitbab65ef72eb97612599d97a35c6da6f460b0cacc (patch)
treec3a3d01bf47a3c7f8e0a7969e5f59ff509963484 /ppapi/thunk
parent84a7f535761e3bceeac188cd8cd499e2f8016661 (diff)
downloadchromium_src-bab65ef72eb97612599d97a35c6da6f460b0cacc.zip
chromium_src-bab65ef72eb97612599d97a35c6da6f460b0cacc.tar.gz
chromium_src-bab65ef72eb97612599d97a35c6da6f460b0cacc.tar.bz2
Cleanup in the file chooser API.
This revs the file chooser interface to no longer pass a separate options structure. This structure was weird because it only had two members, and didn't have ownership of the string which is potentially dangerous. The new interface is a bit easier to call. I changed the string to take a Var, and the C++ layer now takes an Instance* rather than an Instance& which is consistent with the other interfaces. I updated the example. TEST=manual BUG= Review URL: http://codereview.chromium.org/7660017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/ppb_file_chooser_api.h2
-rw-r--r--ppapi/thunk/ppb_file_chooser_thunk.cc6
-rw-r--r--ppapi/thunk/resource_creation_api.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/ppapi/thunk/ppb_file_chooser_api.h b/ppapi/thunk/ppb_file_chooser_api.h
index 4119ae6..fba94c7 100644
--- a/ppapi/thunk/ppb_file_chooser_api.h
+++ b/ppapi/thunk/ppb_file_chooser_api.h
@@ -14,7 +14,7 @@ class PPB_FileChooser_API {
public:
virtual ~PPB_FileChooser_API() {}
- virtual int32_t Show(PP_CompletionCallback callback) = 0;
+ virtual int32_t Show(const PP_CompletionCallback& callback) = 0;
virtual PP_Resource GetNextChosenFile() = 0;
};
diff --git a/ppapi/thunk/ppb_file_chooser_thunk.cc b/ppapi/thunk/ppb_file_chooser_thunk.cc
index 224d248..c58f052 100644
--- a/ppapi/thunk/ppb_file_chooser_thunk.cc
+++ b/ppapi/thunk/ppb_file_chooser_thunk.cc
@@ -17,11 +17,13 @@ namespace thunk {
namespace {
PP_Resource Create(PP_Instance instance,
- const PP_FileChooserOptions_Dev* options) {
+ PP_FileChooserMode_Dev mode,
+ struct PP_Var accept_mime_types) {
EnterFunction<ResourceCreationAPI> enter(instance, true);
if (enter.failed())
return 0;
- return enter.functions()->CreateFileChooser(instance, options);
+ return enter.functions()->CreateFileChooser(instance, mode,
+ accept_mime_types);
}
PP_Bool IsFileChooser(PP_Resource resource) {
diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h
index 589484d..948a1dd 100644
--- a/ppapi/thunk/resource_creation_api.h
+++ b/ppapi/thunk/resource_creation_api.h
@@ -56,7 +56,8 @@ class ResourceCreationAPI {
virtual PP_Resource CreateDirectoryReader(PP_Resource directory_ref) = 0;
virtual PP_Resource CreateFileChooser(
PP_Instance instance,
- const PP_FileChooserOptions_Dev* options) = 0;
+ PP_FileChooserMode_Dev mode,
+ const PP_Var& accept_mime_types) = 0;
virtual PP_Resource CreateFileIO(PP_Instance instance) = 0;
virtual PP_Resource CreateFileRef(PP_Resource file_system,
const char* path) = 0;