Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: components/drive/chromeos/file_cache.cc

Issue 2412063002: Fixed the bug that Drive doesn't appear on Files App on epehmeral mode. (Closed)
Patch Set: fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698