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

Unified Diff: ppapi/cpp/file_system.cc

Issue 52233002: [PPAPI] Added VarResource_Dev class. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to reviews, and add FileSystem methods. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/file_system.h ('k') | ppapi/cpp/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/file_system.cc
diff --git a/ppapi/cpp/file_system.cc b/ppapi/cpp/file_system.cc
index f993fdaa892459a036ff94192b5fd5460373ba08..d158d6e4c085faad1860b76119bf881508eab92e 100644
--- a/ppapi/cpp/file_system.cc
+++ b/ppapi/cpp/file_system.cc
@@ -28,6 +28,10 @@ FileSystem::FileSystem() {
FileSystem::FileSystem(const FileSystem& other) : Resource(other) {
}
+FileSystem::FileSystem(Resource resource) : Resource(resource) {
+ PP_DCHECK(ResourceIsFileSystem(resource));
dmichael (off chromium) 2013/10/31 16:48:56 Let's make the Resource a "Null" one in this case
Matt Giuca 2013/10/31 23:24:43 Done. Note: I added Clear() as a protected method
+}
+
FileSystem::FileSystem(PassRef, PP_Resource resource)
: Resource(PASS_REF, resource) {
}
@@ -48,4 +52,12 @@ int32_t FileSystem::Open(int64_t expected_size,
pp_resource(), expected_size, cc.pp_completion_callback());
}
+// static
+bool FileSystem::ResourceIsFileSystem(const Resource& resource) {
+ if (!has_interface<PPB_FileSystem_1_0>())
+ return false;
+ return get_interface<PPB_FileSystem_1_0>()->IsFileSystem(
+ resource.pp_resource());
+}
+
} // namespace pp
« no previous file with comments | « ppapi/cpp/file_system.h ('k') | ppapi/cpp/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698