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

Unified Diff: components/leveldb/leveldb_mojo_proxy.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
Index: components/leveldb/leveldb_mojo_proxy.cc
diff --git a/components/leveldb/leveldb_mojo_proxy.cc b/components/leveldb/leveldb_mojo_proxy.cc
index 3820b6103c5bb9ad84c988ffebaf64ce01098069..07622bd03ded64b99c02e0cfa992fe7ea29a38e0 100644
--- a/components/leveldb/leveldb_mojo_proxy.cc
+++ b/components/leveldb/leveldb_mojo_proxy.cc
@@ -8,8 +8,8 @@
#include "base/bind.h"
#include "base/callback.h"
-#include "mojo/platform_handle/platform_handle_functions.h"
#include "mojo/public/cpp/bindings/interface_request.h"
+#include "mojo/public/cpp/system/platform_handle.h"
namespace leveldb {
@@ -189,12 +189,11 @@ void LevelDBMojoProxy::OpenFileHandleImpl(OpaqueDir* dir,
if (error != filesystem::mojom::FileError::OK) {
*output_file = base::File(static_cast<base::File::Error>(error));
} else {
- MojoPlatformHandle platform_handle;
- MojoResult extract_result =
- MojoExtractPlatformHandle(handle.release().value(), &platform_handle);
-
- if (extract_result == MOJO_RESULT_OK) {
- *output_file = base::File(platform_handle);
+ base::PlatformFile platform_file;
+ MojoResult unwrap_result = mojo::UnwrapPlatformFile(std::move(handle),
+ &platform_file);
+ if (unwrap_result == MOJO_RESULT_OK) {
+ *output_file = base::File(platform_file);
} else {
NOTREACHED();
*output_file = base::File(base::File::Error::FILE_ERROR_FAILED);
« no previous file with comments | « components/font_service/public/cpp/font_service_thread.cc ('k') | components/mus/gles2/command_buffer_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698