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

Unified Diff: components/filesystem/file_impl.cc

Issue 1995753002: [mojo-edk] Expose portable API for platform handle wrapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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 | « components/filesystem/directory_impl.cc ('k') | components/filesystem/file_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/filesystem/file_impl.cc
diff --git a/components/filesystem/file_impl.cc b/components/filesystem/file_impl.cc
index 94e4916f3d2267854480065fa12e6d5ec8146279..5a2eec9401e85aa9af6e2b79ba3e8c5617935b60 100644
--- a/components/filesystem/file_impl.cc
+++ b/components/filesystem/file_impl.cc
@@ -17,7 +17,7 @@
#include "components/filesystem/shared_temp_dir.h"
#include "components/filesystem/util.h"
#include "mojo/common/common_type_converters.h"
-#include "mojo/platform_handle/platform_handle_functions.h"
+#include "mojo/public/cpp/system/platform_handle.h"
static_assert(sizeof(off_t) <= sizeof(int64_t), "off_t too big");
static_assert(sizeof(size_t) >= sizeof(uint32_t), "size_t too small");
@@ -354,15 +354,8 @@ void FileImpl::AsHandle(const AsHandleCallback& callback) {
return;
}
- MojoHandle mojo_handle;
- MojoResult create_result = MojoCreatePlatformHandleWrapper(
- new_file.TakePlatformFile(), &mojo_handle);
- if (create_result != MOJO_RESULT_OK) {
- callback.Run(mojom::FileError::FAILED, ScopedHandle());
- return;
- }
-
- callback.Run(mojom::FileError::OK, ScopedHandle(mojo::Handle(mojo_handle)));
+ callback.Run(mojom::FileError::OK,
+ mojo::WrapPlatformFile(new_file.TakePlatformFile()));
}
} // namespace filesystem
« no previous file with comments | « components/filesystem/directory_impl.cc ('k') | components/filesystem/file_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698