| Index: ppapi/cpp/file_system.cc
|
| diff --git a/ppapi/cpp/file_system.cc b/ppapi/cpp/file_system.cc
|
| index f993fdaa892459a036ff94192b5fd5460373ba08..8bd86d0eefdc8a9279953b39a6e79bceda6b32c4 100644
|
| --- a/ppapi/cpp/file_system.cc
|
| +++ b/ppapi/cpp/file_system.cc
|
| @@ -9,6 +9,7 @@
|
| #include "ppapi/cpp/completion_callback.h"
|
| #include "ppapi/cpp/file_ref.h"
|
| #include "ppapi/cpp/instance_handle.h"
|
| +#include "ppapi/cpp/logging.h"
|
| #include "ppapi/cpp/module.h"
|
| #include "ppapi/cpp/module_impl.h"
|
|
|
| @@ -28,6 +29,15 @@ FileSystem::FileSystem() {
|
| FileSystem::FileSystem(const FileSystem& other) : Resource(other) {
|
| }
|
|
|
| +FileSystem::FileSystem(const Resource& resource) : Resource(resource) {
|
| + if (!IsFileSystem(resource)) {
|
| + PP_NOTREACHED();
|
| +
|
| + // On release builds, set this to null.
|
| + Clear();
|
| + }
|
| +}
|
| +
|
| FileSystem::FileSystem(PassRef, PP_Resource resource)
|
| : Resource(PASS_REF, resource) {
|
| }
|
| @@ -48,4 +58,12 @@ int32_t FileSystem::Open(int64_t expected_size,
|
| pp_resource(), expected_size, cc.pp_completion_callback());
|
| }
|
|
|
| +// static
|
| +bool FileSystem::IsFileSystem(const Resource& resource) {
|
| + if (!has_interface<PPB_FileSystem_1_0>())
|
| + return false;
|
| + return get_interface<PPB_FileSystem_1_0>()->IsFileSystem(
|
| + resource.pp_resource()) == PP_TRUE;
|
| +}
|
| +
|
| } // namespace pp
|
|
|