Chromium Code Reviews| Index: components/sync/engine_impl/loopback_server/loopback_server.cc |
| diff --git a/components/sync/engine_impl/loopback_server/loopback_server.cc b/components/sync/engine_impl/loopback_server/loopback_server.cc |
| index ef701df388764d1e214a5a27655260a578f109eb..4e87763b591f7949e753af1664d14acd9acc1cfb 100644 |
| --- a/components/sync/engine_impl/loopback_server/loopback_server.cc |
| +++ b/components/sync/engine_impl/loopback_server/loopback_server.cc |
| @@ -523,6 +523,7 @@ bool LoopbackServer::SaveStateToFile(const base::FilePath& filename) const { |
| SerializeState(&proto); |
| std::string serialized = proto.SerializeAsString(); |
| + CHECK(base::CreateDirectory(filename.DirName())); |
|
pavely
2016/10/27 23:53:39
Failure to create directory is the same as failure
pastarmovj
2016/11/02 13:39:25
Agree and it should not crash for this reason imho
|
| int result = base::WriteFile(filename, serialized.data(), serialized.size()); |
| return result == static_cast<int>(serialized.size()); |
| } |