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

Unified Diff: ppapi/cpp/file_ref.cc

Issue 9712001: Check explicitly for version 1.0 PPB_File* interfaces in pp::File* wrappers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missed interface_name definitions. Created 8 years, 9 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/cpp/file_io.cc ('k') | ppapi/cpp/file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/file_ref.cc
diff --git a/ppapi/cpp/file_ref.cc b/ppapi/cpp/file_ref.cc
index 864e646909c9e7cce7f8c02bec99e8d3161eb853..8753f1c1c3d145d3de140dc2f449762bb811d47a 100644
--- a/ppapi/cpp/file_ref.cc
+++ b/ppapi/cpp/file_ref.cc
@@ -14,8 +14,8 @@ namespace pp {
namespace {
-template <> const char* interface_name<PPB_FileRef>() {
- return PPB_FILEREF_INTERFACE;
+template <> const char* interface_name<PPB_FileRef_1_0>() {
+ return PPB_FILEREF_INTERFACE_1_0;
}
} // namespace
@@ -28,9 +28,9 @@ FileRef::FileRef(PassRef, PP_Resource resource) : Resource(PASS_REF, resource) {
FileRef::FileRef(const FileSystem& file_system,
const char* path) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return;
- PassRefFromConstructor(get_interface<PPB_FileRef>()->Create(
+ PassRefFromConstructor(get_interface<PPB_FileRef_1_0>()->Create(
file_system.pp_resource(), path));
}
@@ -39,34 +39,36 @@ FileRef::FileRef(const FileRef& other)
}
PP_FileSystemType FileRef::GetFileSystemType() const {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return PP_FILESYSTEMTYPE_EXTERNAL;
- return get_interface<PPB_FileRef>()->GetFileSystemType(pp_resource());
+ return get_interface<PPB_FileRef_1_0>()->GetFileSystemType(pp_resource());
}
Var FileRef::GetName() const {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return Var();
- return Var(PASS_REF, get_interface<PPB_FileRef>()->GetName(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_FileRef_1_0>()->GetName(pp_resource()));
}
Var FileRef::GetPath() const {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return Var();
- return Var(PASS_REF, get_interface<PPB_FileRef>()->GetPath(pp_resource()));
+ return Var(PASS_REF,
+ get_interface<PPB_FileRef_1_0>()->GetPath(pp_resource()));
}
FileRef FileRef::GetParent() const {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return FileRef();
return FileRef(PASS_REF,
- get_interface<PPB_FileRef>()->GetParent(pp_resource()));
+ get_interface<PPB_FileRef_1_0>()->GetParent(pp_resource()));
}
int32_t FileRef::MakeDirectory(const CompletionCallback& cc) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef>()->MakeDirectory(
+ return get_interface<PPB_FileRef_1_0>()->MakeDirectory(
pp_resource(),
PP_FALSE, // make_ancestors
cc.pp_completion_callback());
@@ -74,9 +76,9 @@ int32_t FileRef::MakeDirectory(const CompletionCallback& cc) {
int32_t FileRef::MakeDirectoryIncludingAncestors(
const CompletionCallback& cc) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef>()->MakeDirectory(
+ return get_interface<PPB_FileRef_1_0>()->MakeDirectory(
pp_resource(),
PP_TRUE, // make_ancestors
cc.pp_completion_callback());
@@ -85,25 +87,25 @@ int32_t FileRef::MakeDirectoryIncludingAncestors(
int32_t FileRef::Touch(PP_Time last_access_time,
PP_Time last_modified_time,
const CompletionCallback& cc) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef>()->Touch(
+ return get_interface<PPB_FileRef_1_0>()->Touch(
pp_resource(), last_access_time, last_modified_time,
cc.pp_completion_callback());
}
int32_t FileRef::Delete(const CompletionCallback& cc) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef>()->Delete(
+ return get_interface<PPB_FileRef_1_0>()->Delete(
pp_resource(), cc.pp_completion_callback());
}
int32_t FileRef::Rename(const FileRef& new_file_ref,
const CompletionCallback& cc) {
- if (!has_interface<PPB_FileRef>())
+ if (!has_interface<PPB_FileRef_1_0>())
return cc.MayForce(PP_ERROR_NOINTERFACE);
- return get_interface<PPB_FileRef>()->Rename(
+ return get_interface<PPB_FileRef_1_0>()->Rename(
pp_resource(), new_file_ref.pp_resource(), cc.pp_completion_callback());
}
« no previous file with comments | « ppapi/cpp/file_io.cc ('k') | ppapi/cpp/file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698