diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 19:20:14 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-10 19:20:14 +0000 |
commit | 9e27571002528a10306e535427dda2571c0a2704 (patch) | |
tree | 18f200af44e816e434f9ccb8cfa7173caef17b4a /courgette | |
parent | 3ab5e0f10f73ef249452d8c5e2af11accb7c4606 (diff) | |
download | chromium_src-9e27571002528a10306e535427dda2571c0a2704.zip chromium_src-9e27571002528a10306e535427dda2571c0a2704.tar.gz chromium_src-9e27571002528a10306e535427dda2571c0a2704.tar.bz2 |
More FilePath -> base::FilePath replacement.
Review URL: https://codereview.chromium.org/12225112
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette')
-rw-r--r-- | courgette/base_test_unittest.cc | 2 | ||||
-rw-r--r-- | courgette/base_test_unittest.h | 2 | ||||
-rw-r--r-- | courgette/courgette.h | 6 | ||||
-rw-r--r-- | courgette/courgette_tool.cc | 54 | ||||
-rw-r--r-- | courgette/ensemble_apply.cc | 12 | ||||
-rw-r--r-- | courgette/memory_allocator.cc | 2 |
6 files changed, 39 insertions, 39 deletions
diff --git a/courgette/base_test_unittest.cc b/courgette/base_test_unittest.cc index f85fd35..a0e7d05 100644 --- a/courgette/base_test_unittest.cc +++ b/courgette/base_test_unittest.cc @@ -17,7 +17,7 @@ void BaseTest::TearDown() { // Reads a test file into a string. std::string BaseTest::FileContents(const char* file_name) const { - FilePath file_path = test_dir_; + base::FilePath file_path = test_dir_; file_path = file_path.AppendASCII(file_name); std::string file_bytes; diff --git a/courgette/base_test_unittest.h b/courgette/base_test_unittest.h index a0733a4..e4ea0ec 100644 --- a/courgette/base_test_unittest.h +++ b/courgette/base_test_unittest.h @@ -23,7 +23,7 @@ class BaseTest : public testing::Test { virtual void SetUp(); virtual void TearDown(); - FilePath test_dir_; + base::FilePath test_dir_; }; #endif // COURGETTE_BASE_TEST_UNITTEST_H_ diff --git a/courgette/courgette.h b/courgette/courgette.h index 2cd4cd7..6d3112d 100644 --- a/courgette/courgette.h +++ b/courgette/courgette.h @@ -77,9 +77,9 @@ Status ApplyEnsemblePatch(SourceStream* old, SourceStream* patch, // Returns C_OK unless something went wrong. // This function first validates that the patch file has a proper header, so the // function can be used to 'try' a patch. -Status ApplyEnsemblePatch(const FilePath::CharType* old_file_name, - const FilePath::CharType* patch_file_name, - const FilePath::CharType* new_file_name); +Status ApplyEnsemblePatch(const base::FilePath::CharType* old_file_name, + const base::FilePath::CharType* patch_file_name, + const base::FilePath::CharType* new_file_name); // Generates a patch that will transform the bytes in |old| into the bytes in // |target|. diff --git a/courgette/courgette_tool.cc b/courgette/courgette_tool.cc index 2714e0f..95c7824 100644 --- a/courgette/courgette_tool.cc +++ b/courgette/courgette_tool.cc @@ -47,7 +47,7 @@ void Problem(const char* format, ...) { exit(1); } -std::string ReadOrFail(const FilePath& file_name, const char* kind) { +std::string ReadOrFail(const base::FilePath& file_name, const char* kind) { int64 file_size = 0; if (!file_util::GetFileSize(file_name, &file_size)) Problem("Can't read %s file.", kind); @@ -59,7 +59,7 @@ std::string ReadOrFail(const FilePath& file_name, const char* kind) { } void WriteSinkToFile(const courgette::SinkStream *sink, - const FilePath& output_file) { + const base::FilePath& output_file) { int count = file_util::WriteFile(output_file, reinterpret_cast<const char*>(sink->Buffer()), @@ -70,8 +70,8 @@ void WriteSinkToFile(const courgette::SinkStream *sink, Problem("Incomplete write."); } -void Disassemble(const FilePath& input_file, - const FilePath& output_file) { +void Disassemble(const base::FilePath& input_file, + const base::FilePath& output_file) { std::string buffer = ReadOrFail(input_file, "input"); courgette::AssemblyProgram* program = NULL; @@ -106,7 +106,7 @@ void Disassemble(const FilePath& input_file, WriteSinkToFile(&sink, output_file); } -bool Supported(const FilePath& input_file) { +bool Supported(const base::FilePath& input_file) { bool result = false; std::string buffer = ReadOrFail(input_file, "input"); @@ -141,9 +141,9 @@ bool Supported(const FilePath& input_file) { return result; } -void DisassembleAndAdjust(const FilePath& program_file, - const FilePath& model_file, - const FilePath& output_file) { +void DisassembleAndAdjust(const base::FilePath& program_file, + const base::FilePath& model_file, + const base::FilePath& output_file) { std::string program_buffer = ReadOrFail(program_file, "program"); std::string model_buffer = ReadOrFail(model_file, "reference"); @@ -196,9 +196,9 @@ void DisassembleAndAdjust(const FilePath& program_file, // original file's stream and the new file's stream. This is completely // uninteresting to users, but it is handy for seeing how much each which // streams are contributing to the final file size. Adjustment is optional. -void DisassembleAdjustDiff(const FilePath& model_file, - const FilePath& program_file, - const FilePath& output_file_root, +void DisassembleAdjustDiff(const base::FilePath& model_file, + const base::FilePath& program_file, + const base::FilePath& output_file_root, bool adjust) { std::string model_buffer = ReadOrFail(model_file, "'old'"); std::string program_buffer = ReadOrFail(program_file, "'new'"); @@ -275,8 +275,8 @@ void DisassembleAdjustDiff(const FilePath& model_file, } } -void Assemble(const FilePath& input_file, - const FilePath& output_file) { +void Assemble(const base::FilePath& input_file, + const base::FilePath& output_file) { std::string buffer = ReadOrFail(input_file, "input"); courgette::SourceStreamSet sources; @@ -297,9 +297,9 @@ void Assemble(const FilePath& input_file, WriteSinkToFile(&sink, output_file); } -void GenerateEnsemblePatch(const FilePath& old_file, - const FilePath& new_file, - const FilePath& patch_file) { +void GenerateEnsemblePatch(const base::FilePath& old_file, + const base::FilePath& new_file, + const base::FilePath& patch_file) { std::string old_buffer = ReadOrFail(old_file, "'old' input"); std::string new_buffer = ReadOrFail(new_file, "'new' input"); @@ -317,9 +317,9 @@ void GenerateEnsemblePatch(const FilePath& old_file, WriteSinkToFile(&patch_stream, patch_file); } -void ApplyEnsemblePatch(const FilePath& old_file, - const FilePath& patch_file, - const FilePath& new_file) { +void ApplyEnsemblePatch(const base::FilePath& old_file, + const base::FilePath& patch_file, + const base::FilePath& new_file) { // We do things a little differently here in order to call the same Courgette // entry point as the installer. That entry point point takes file names and // returns an status code but does not output any diagnostics. @@ -374,9 +374,9 @@ void ApplyEnsemblePatch(const FilePath& old_file, Problem("-apply failed."); } -void GenerateBSDiffPatch(const FilePath& old_file, - const FilePath& new_file, - const FilePath& patch_file) { +void GenerateBSDiffPatch(const base::FilePath& old_file, + const base::FilePath& new_file, + const base::FilePath& patch_file) { std::string old_buffer = ReadOrFail(old_file, "'old' input"); std::string new_buffer = ReadOrFail(new_file, "'new' input"); @@ -394,9 +394,9 @@ void GenerateBSDiffPatch(const FilePath& old_file, WriteSinkToFile(&patch_stream, patch_file); } -void ApplyBSDiffPatch(const FilePath& old_file, - const FilePath& patch_file, - const FilePath& new_file) { +void ApplyBSDiffPatch(const base::FilePath& old_file, + const base::FilePath& patch_file, + const base::FilePath& new_file) { std::string old_buffer = ReadOrFail(old_file, "'old' input"); std::string patch_buffer = ReadOrFail(patch_file, "'patch' input"); @@ -438,10 +438,10 @@ int main(int argc, const char* argv[]) { bool cmd_spread_1_adjusted = command_line.HasSwitch("gen1a"); bool cmd_spread_1_unadjusted = command_line.HasSwitch("gen1u"); - std::vector<FilePath> values; + std::vector<base::FilePath> values; const CommandLine::StringVector& args = command_line.GetArgs(); for (size_t i = 0; i < args.size(); ++i) { - values.push_back(FilePath(args[i])); + values.push_back(base::FilePath(args[i])); } // '-repeat=N' is for debugging. Running many iterations can reveal leaks and diff --git a/courgette/ensemble_apply.cc b/courgette/ensemble_apply.cc index 475cdf2..28312f3 100644 --- a/courgette/ensemble_apply.cc +++ b/courgette/ensemble_apply.cc @@ -372,12 +372,12 @@ Status ApplyEnsemblePatch(SourceStream* base, return C_OK; } -Status ApplyEnsemblePatch(const FilePath::CharType* old_file_name, - const FilePath::CharType* patch_file_name, - const FilePath::CharType* new_file_name) { +Status ApplyEnsemblePatch(const base::FilePath::CharType* old_file_name, + const base::FilePath::CharType* patch_file_name, + const base::FilePath::CharType* new_file_name) { // First read enough of the patch file to validate the header is well-formed. // A few varint32 numbers should fit in 100. - FilePath patch_file_path(patch_file_name); + base::FilePath patch_file_path(patch_file_name); file_util::MemoryMappedFile patch_file; if (!patch_file.Initialize(patch_file_path)) return C_READ_OPEN_ERROR; @@ -391,7 +391,7 @@ Status ApplyEnsemblePatch(const FilePath::CharType* old_file_name, return status; // Read the old_file. - FilePath old_file_path(old_file_name); + base::FilePath old_file_path(old_file_name); file_util::MemoryMappedFile old_file; if (!old_file.Initialize(old_file_path)) return C_READ_ERROR; @@ -408,7 +408,7 @@ Status ApplyEnsemblePatch(const FilePath::CharType* old_file_name, return status; // Write the patched data to |new_file_name|. - FilePath new_file_path(new_file_name); + base::FilePath new_file_path(new_file_name); int written = file_util::WriteFile( new_file_path, diff --git a/courgette/memory_allocator.cc b/courgette/memory_allocator.cc index b3a45b4..54b34da 100644 --- a/courgette/memory_allocator.cc +++ b/courgette/memory_allocator.cc @@ -31,7 +31,7 @@ void TempFile::Close() { bool TempFile::Create() { DCHECK(file_ == base::kInvalidPlatformFileValue); - FilePath path; + base::FilePath path; if (!file_util::CreateTemporaryFile(&path)) return false; |