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

Unified Diff: components/filesystem/directory_impl.cc

Issue 2607063002: Remove mojo::Array. (Closed)
Patch Set: Created 3 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: components/filesystem/directory_impl.cc
diff --git a/components/filesystem/directory_impl.cc b/components/filesystem/directory_impl.cc
index 8577078a0da2771108e1ba83a084a36ec940e7b3..64114de934824fbf90495e4b332df5d44f6c8b48 100644
--- a/components/filesystem/directory_impl.cc
+++ b/components/filesystem/directory_impl.cc
@@ -16,7 +16,6 @@
#include "components/filesystem/file_impl.h"
#include "components/filesystem/lock_table.h"
#include "components/filesystem/util.h"
-#include "mojo/common/common_type_converters.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace filesystem {
@@ -291,14 +290,14 @@ void DirectoryImpl::ReadEntireFile(const std::string& raw_path,
return;
}
- std::string contents;
+ std::vector<uint8_t> contents;
const int kBufferSize = 1 << 16;
std::unique_ptr<char[]> buf(new char[kBufferSize]);
int len;
while ((len = base_file.ReadAtCurrentPos(buf.get(), kBufferSize)) > 0)
- contents.append(buf.get(), len);
+ contents.insert(contents.end(), buf.get(), buf.get() + len);
- callback.Run(mojom::FileError::OK, mojo::Array<uint8_t>::From(contents));
+ callback.Run(mojom::FileError::OK, contents);
}
void DirectoryImpl::WriteFile(const std::string& raw_path,

Powered by Google App Engine
This is Rietveld 408576698