| Index: native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc
|
| diff --git a/native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc b/native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc
|
| index a417b6aa38c28ee90a56973b266e66edd24d423d..b8aed8a8533e13dca1bd757dc7574efb3e39474d 100644
|
| --- a/native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc
|
| +++ b/native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc
|
| @@ -69,18 +69,16 @@ int MountHtml5Fs::Mkdir(const Path& path, int permissions) {
|
| return -1;
|
| }
|
|
|
| - PP_Resource fileref_resource = ppapi()->GetFileRefInterface()->Create(
|
| - filesystem_resource_, path.Join().c_str());
|
| - if (!fileref_resource) {
|
| + ScopedResource fileref_resource(
|
| + ppapi(), ppapi()->GetFileRefInterface()->Create(filesystem_resource_,
|
| + path.Join().c_str()));
|
| + if (!fileref_resource.pp_resource()) {
|
| errno = EINVAL;
|
| return -1;
|
| }
|
|
|
| - ScopedResource scoped_resource(ppapi_, fileref_resource,
|
| - ScopedResource::NoAddRef());
|
| -
|
| int32_t result = ppapi()->GetFileRefInterface()->MakeDirectory(
|
| - fileref_resource, PP_FALSE, PP_BlockUntilComplete());
|
| + fileref_resource.pp_resource(), PP_FALSE, PP_BlockUntilComplete());
|
| if (result != PP_OK) {
|
| errno = PPErrorToErrno(result);
|
| return -1;
|
| @@ -99,18 +97,16 @@ int MountHtml5Fs::Remove(const Path& path) {
|
| return -1;
|
| }
|
|
|
| - PP_Resource fileref_resource = ppapi()->GetFileRefInterface()->Create(
|
| - filesystem_resource_, path.Join().c_str());
|
| - if (!fileref_resource) {
|
| + ScopedResource fileref_resource(
|
| + ppapi(), ppapi()->GetFileRefInterface()->Create(filesystem_resource_,
|
| + path.Join().c_str()));
|
| + if (!fileref_resource.pp_resource()) {
|
| errno = EINVAL;
|
| return -1;
|
| }
|
|
|
| - ScopedResource scoped_resource(ppapi_, fileref_resource,
|
| - ScopedResource::NoAddRef());
|
| -
|
| int32_t result = ppapi()->GetFileRefInterface()->Delete(
|
| - fileref_resource,
|
| + fileref_resource.pp_resource(),
|
| PP_BlockUntilComplete());
|
| if (result != PP_OK) {
|
| errno = PPErrorToErrno(result);
|
|
|