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

Unified Diff: native_client_sdk/src/libraries/nacl_mounts/mount_html5fs.cc

Issue 11887021: [NaCl SDK] Add HTTP mount. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 11 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
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);
« no previous file with comments | « native_client_sdk/src/libraries/nacl_mounts/library.dsc ('k') | native_client_sdk/src/libraries/nacl_mounts/mount_http.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698