OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 << "\", " << error; | 138 << "\", " << error; |
139 } else { | 139 } else { |
140 DVLOG(1) << "Created dir " << paths_to_create[i].value(); | 140 DVLOG(1) << "Created dir " << paths_to_create[i].value(); |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 return error; | 144 return error; |
145 } | 145 } |
146 | 146 |
147 // Modifies cache state of file on IO thread pool, which involves: | 147 // Modifies cache state of file on IO thread pool, which involves: |
148 // - moving file from |source_path| to |dest_path| if they're different | 148 // - moving or copying file (per |file_operation_type|) from |source_path| to |
| 149 // |dest_path| if they're different |
149 // - deleting symlink if |symlink_path| is not empty | 150 // - deleting symlink if |symlink_path| is not empty |
150 // - creating symlink if |symlink_path| is not empty and |create_symlink| is | 151 // - creating symlink if |symlink_path| is not empty and |create_symlink| is |
151 // true. | 152 // true. |
152 base::PlatformFileError ModifyCacheState( | 153 base::PlatformFileError ModifyCacheState( |
153 const FilePath& source_path, | 154 const FilePath& source_path, |
154 const FilePath& dest_path, | 155 const FilePath& dest_path, |
155 gdata::GDataFileSystem::FileOperationType file_operation_type, | 156 gdata::GDataFileSystem::FileOperationType file_operation_type, |
156 const FilePath& symlink_path, | 157 const FilePath& symlink_path, |
157 bool create_symlink) { | 158 bool create_symlink) { |
158 // Move or copy |source_path| to |dest_path| if they are different. | 159 // Move or copy |source_path| to |dest_path| if they are different. |
(...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3561 const bool posted = BrowserThread::PostTask( | 3562 const bool posted = BrowserThread::PostTask( |
3562 BrowserThread::FILE, | 3563 BrowserThread::FILE, |
3563 from_here, | 3564 from_here, |
3564 base::Bind(&GDataFileSystem::RunTaskOnIOThreadPool, | 3565 base::Bind(&GDataFileSystem::RunTaskOnIOThreadPool, |
3565 base::Unretained(this), | 3566 base::Unretained(this), |
3566 task)); | 3567 task)); |
3567 DCHECK(posted); | 3568 DCHECK(posted); |
3568 } | 3569 } |
3569 | 3570 |
3570 } // namespace gdata | 3571 } // namespace gdata |
OLD | NEW |