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

Unified Diff: components/leveldb/leveldb_mojo_proxy.cc

Issue 2539383002: Replace base::File wrapping with typemapping. (Closed)
Patch Set: Created 4 years 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 67c0521d65279a7da085b8e679414758a5063031..2a609b0dcb22703656422af50cacf0b97086e42c 100644
--- a/components/leveldb/leveldb_mojo_proxy.cc
+++ b/components/leveldb/leveldb_mojo_proxy.cc
@@ -10,7 +10,6 @@
#include "base/callback.h"
#include "base/single_thread_task_runner.h"
#include "mojo/public/cpp/bindings/interface_request.h"
-#include "mojo/public/cpp/system/platform_handle.h"
namespace leveldb {
@@ -183,24 +182,16 @@ void LevelDBMojoProxy::OpenFileHandleImpl(OpaqueDir* dir,
std::string name,
uint32_t open_flags,
base::File* output_file) {
- mojo::ScopedHandle handle;
+ base::File file;
filesystem::mojom::FileError error = filesystem::mojom::FileError::FAILED;
bool completed =
- dir->directory->OpenFileHandle(name, open_flags, &error, &handle);
+ dir->directory->OpenFileHandle(name, open_flags, &error, &file);
DCHECK(completed);
if (error != filesystem::mojom::FileError::OK) {
*output_file = base::File(static_cast<base::File::Error>(error));
} else {
- 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);
- }
+ *output_file = std::move(file);
}
}

Powered by Google App Engine
This is Rietveld 408576698