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

Unified Diff: mojo/edk/embedder/simple_platform_shared_buffer_android.cc

Issue 1346643003: Convert base::ScopedFD to (mojo::embedder::)ScopedPlatformHandle. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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: mojo/edk/embedder/simple_platform_shared_buffer_android.cc
diff --git a/mojo/edk/embedder/simple_platform_shared_buffer_android.cc b/mojo/edk/embedder/simple_platform_shared_buffer_android.cc
index 60219f91af9f8f42023c08b2e918139b94111578..6ee24e703043c6b622f5c167ef562ab38cf3c5fe 100644
--- a/mojo/edk/embedder/simple_platform_shared_buffer_android.cc
+++ b/mojo/edk/embedder/simple_platform_shared_buffer_android.cc
@@ -10,9 +10,7 @@
#include <limits>
-#include "base/files/scoped_file.h"
#include "base/logging.h"
-#include "mojo/edk/embedder/platform_handle.h"
#include "third_party/ashmem/ashmem.h"
namespace mojo {
@@ -28,18 +26,19 @@ bool SimplePlatformSharedBuffer::Init() {
return false;
}
- base::ScopedFD fd(ashmem_create_region(nullptr, num_bytes_));
- if (!fd.is_valid()) {
+ ScopedPlatformHandle handle(
+ PlatformHandle(ashmem_create_region(nullptr, num_bytes_)));
+ if (!handle.is_valid()) {
DPLOG(ERROR) << "ashmem_create_region()";
return false;
}
- if (ashmem_set_prot_region(fd.get(), PROT_READ | PROT_WRITE) < 0) {
+ if (ashmem_set_prot_region(handle.get().fd, PROT_READ | PROT_WRITE) < 0) {
DPLOG(ERROR) << "ashmem_set_prot_region()";
return false;
}
- handle_.reset(PlatformHandle(fd.release()));
+ handle_ = handle.Pass();
return true;
}
« no previous file with comments | « mojo/edk/embedder/scoped_platform_handle.h ('k') | mojo/edk/embedder/simple_platform_shared_buffer_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698