Commit c20a3370 authored by Jens Widell's avatar Jens Widell Committed by Commit Bot

Rename conflicting `ReadAndDeleteFile()` functions

They conflict in jumbo/unity builds.

Since one read a file as binary data (into a `std::vector<uint8_t>`) and
one as text (into a `std::string`), it seems reasonable to change the
names to `ReadAndDeleteBinaryFile()` and `ReadAndDeleteTextFile()`.

Change-Id: I8d8402c64cfe45132df9640bd5664df28742d6d7
Reviewed-on: https://chromium-review.googlesource.com/897603Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#534007}
parent 14ef2a6b
...@@ -22,7 +22,7 @@ const int kMaxImageCanvas = 4096 * 4096; // 16MB ...@@ -22,7 +22,7 @@ const int kMaxImageCanvas = 4096 * 4096; // 16MB
// Reads the file in |path| and then deletes it. // Reads the file in |path| and then deletes it.
// Returns a tuple containing: the file content, whether the read was // Returns a tuple containing: the file content, whether the read was
// successful, whether the delete was successful. // successful, whether the delete was successful.
std::tuple<std::vector<uint8_t>, bool, bool> ReadAndDeleteFile( std::tuple<std::vector<uint8_t>, bool, bool> ReadAndDeleteBinaryFile(
const base::FilePath& path) { const base::FilePath& path) {
std::vector<uint8_t> contents; std::vector<uint8_t> contents;
bool read_success = false; bool read_success = false;
...@@ -120,7 +120,7 @@ void ImageSanitizer::Start(service_manager::Connector* connector, ...@@ -120,7 +120,7 @@ void ImageSanitizer::Start(service_manager::Connector* connector,
base::FilePath full_image_path = image_dir_.Append(path); base::FilePath full_image_path = image_dir_.Append(path);
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
extensions::GetExtensionFileTaskRunner().get(), FROM_HERE, extensions::GetExtensionFileTaskRunner().get(), FROM_HERE,
base::BindOnce(&ReadAndDeleteFile, full_image_path), base::BindOnce(&ReadAndDeleteBinaryFile, full_image_path),
base::BindOnce(&ImageSanitizer::ImageFileRead, base::BindOnce(&ImageSanitizer::ImageFileRead,
weak_factory_.GetWeakPtr(), path)); weak_factory_.GetWeakPtr(), path));
} }
...@@ -221,4 +221,4 @@ void ImageSanitizer::CleanUp() { ...@@ -221,4 +221,4 @@ void ImageSanitizer::CleanUp() {
image_decoded_callback_.Reset(); image_decoded_callback_.Reset();
} }
} // namespace extensions } // namespace extensions
\ No newline at end of file
...@@ -17,7 +17,7 @@ namespace { ...@@ -17,7 +17,7 @@ namespace {
// Reads the file in |path| and then deletes it. // Reads the file in |path| and then deletes it.
// Returns a tuple containing: the file content, whether the read was // Returns a tuple containing: the file content, whether the read was
// successful, whether the delete was successful. // successful, whether the delete was successful.
std::tuple<std::string, bool, bool> ReadAndDeleteFile( std::tuple<std::string, bool, bool> ReadAndDeleteTextFile(
const base::FilePath& path) { const base::FilePath& path) {
std::string contents; std::string contents;
bool read_success = base::ReadFileToString(path, &contents); bool read_success = base::ReadFileToString(path, &contents);
...@@ -69,7 +69,7 @@ void JsonFileSanitizer::Start(service_manager::Connector* connector, ...@@ -69,7 +69,7 @@ void JsonFileSanitizer::Start(service_manager::Connector* connector,
for (const base::FilePath& path : file_paths_) { for (const base::FilePath& path : file_paths_) {
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
extensions::GetExtensionFileTaskRunner().get(), FROM_HERE, extensions::GetExtensionFileTaskRunner().get(), FROM_HERE,
base::BindOnce(&ReadAndDeleteFile, path), base::BindOnce(&ReadAndDeleteTextFile, path),
base::BindOnce(&JsonFileSanitizer::JsonFileRead, base::BindOnce(&JsonFileSanitizer::JsonFileRead,
weak_factory_.GetWeakPtr(), path)); weak_factory_.GetWeakPtr(), path));
} }
...@@ -145,4 +145,4 @@ void JsonFileSanitizer::ReportError(Status status, const std::string& error) { ...@@ -145,4 +145,4 @@ void JsonFileSanitizer::ReportError(Status status, const std::string& error) {
std::move(callback_).Run(status, error); std::move(callback_).Run(status, error);
} }
} // namespace extensions } // namespace extensions
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment