Index: tools/gn/ninja_target_writer.cc |
diff --git a/tools/gn/ninja_target_writer.cc b/tools/gn/ninja_target_writer.cc |
index 7d9c08afd65bdcb7741b52f8633ada63bfd56b79..9f19b2b0065321d12f74279d97dfbe492cf5ecc1 100644 |
--- a/tools/gn/ninja_target_writer.cc |
+++ b/tools/gn/ninja_target_writer.cc |
@@ -74,9 +74,7 @@ void NinjaTargetWriter::RunAndWriteFile(const Target* target) { |
CHECK(0) << "Output type of target not handled."; |
} |
- std::string contents = file.str(); |
- base::WriteFile(ninja_file, contents.c_str(), |
- static_cast<int>(contents.size())); |
+ WriteFileIfChanged(ninja_file, file.str(), nullptr); |
} |
void NinjaTargetWriter::WriteEscapedSubstitution(SubstitutionType type) { |