Chromium Code Reviews| Index: components/drive/chromeos/file_cache.cc |
| diff --git a/components/drive/chromeos/file_cache.cc b/components/drive/chromeos/file_cache.cc |
| index 1e6c145d8124d6ff25c04a5f50d414ace9e35c8b..892d95b176d669ff40d7523b71fff3ad4c070cb7 100644 |
| --- a/components/drive/chromeos/file_cache.cc |
| +++ b/components/drive/chromeos/file_cache.cc |
| @@ -94,20 +94,36 @@ FileAttributes GetFileAttributes(const base::FilePath& path) { |
| // Marks the cache file to be removable by cryptohome. |
| bool SetRemovable(const base::FilePath& path) { |
| + // Returns always true as a quick fix for http://crbug.com/650268. |
| + // TODO(oka): Ideally we should avoid to call the method if the underlying |
| + // filesystem does not support file attributes, as tmpfs for ephemeral mode. |
|
fukino
2016/10/12 10:34:29
Can we just return at the beginning of this functi
oka
2016/10/13 05:55:51
That's right. I updated the TODO comment.
|
| FileAttributes flags = GetFileAttributes(path); |
| - if (flags < 0) return false; |
| + if (flags < 0) { |
| + // TODO(oka): false should be returned. |
| + return true; |
| + } |
| if ((flags & FS_NODUMP_FL) == FS_NODUMP_FL) return true; |
| - return SetFileAttributes(path, flags | FS_NODUMP_FL); |
| + SetFileAttributes(path, flags | FS_NODUMP_FL); |
| + // TODO(oka): Return value of the above method should be returned. |
| + return true; |
| } |
| // Marks the cache file to be unremovable by cryptohome. |
| bool UnsetRemovable(const base::FilePath& path) { |
| + // Returns always true as a quick fix for http://crbug.com/650268. |
| + // TODO(oka): Ideally we should avoid to call the method if the underlying |
| + // filesystem does not support file attributes, as tmpfs for ephemeral mode. |
| FileAttributes flags = GetFileAttributes(path); |
| - if (flags < 0) return false; |
| + if (flags < 0) { |
| + // TODO(oka): false should be returned. |
| + return true; |
| + } |
| if ((flags & FS_NODUMP_FL) == 0) return true; |
| - return SetFileAttributes(path, flags & ~FS_NODUMP_FL); |
| + SetFileAttributes(path, flags & ~FS_NODUMP_FL); |
| + // TODO(oka): Return value of the above method should be returned. |
| + return true; |
| } |
| // Marks |path| as drive cache dir. |
| @@ -649,7 +665,10 @@ bool FileCache::Initialize() { |
| // Run this every time to resolve inconsistency between metadata |
| // and file attributes which possibly occurs on abrupt power failure. |
| if (!FixMetadataAndFileAttributes()) { |
| - return false; |
| + // Returning true as a quick fix for http://crbug.com/650268. |
| + // TODO(oka): Ideally we should avoid to call the method if the underlying |
| + // filesystem does not support file attributes, as tmpfs for ephemeral mode. |
| + return true; |
| } |
| return true; |