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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // | 374 // |
375 // When uploading a new file, adds a new file entry, and store its content | 375 // When uploading a new file, adds a new file entry, and store its content |
376 // from |file_content_path| into the cache. | 376 // from |file_content_path| into the cache. |
377 // | 377 // |
378 // When uploading an existing file, replaces the file entry with a new one, | 378 // When uploading an existing file, replaces the file entry with a new one, |
379 // and clears the dirty bit in the cache. | 379 // and clears the dirty bit in the cache. |
380 // | 380 // |
381 // |callback| will be called on the UI thread upon completion of operation. | 381 // |callback| will be called on the UI thread upon completion of operation. |
382 virtual void AddUploadedFile(UploadMode upload_mode, | 382 virtual void AddUploadedFile(UploadMode upload_mode, |
383 const FilePath& virtual_dir_path, | 383 const FilePath& virtual_dir_path, |
384 DocumentEntry* entry, | 384 scoped_ptr<DocumentEntry> entry, |
385 const FilePath& file_content_path, | 385 const FilePath& file_content_path, |
386 GDataCache::FileOperationType cache_operation, | 386 GDataCache::FileOperationType cache_operation, |
387 const base::Closure& callback) = 0; | 387 const base::Closure& callback) = 0; |
388 }; | 388 }; |
389 | 389 |
390 // The production implementation of GDataFileSystemInterface. | 390 // The production implementation of GDataFileSystemInterface. |
391 class GDataFileSystem : public GDataFileSystemInterface, | 391 class GDataFileSystem : public GDataFileSystemInterface, |
392 public content::NotificationObserver { | 392 public content::NotificationObserver { |
393 public: | 393 public: |
394 GDataFileSystem( | 394 GDataFileSystem( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 const GetFileInfoCallback& callback) OVERRIDE; | 459 const GetFileInfoCallback& callback) OVERRIDE; |
460 virtual void ReadDirectoryByPath( | 460 virtual void ReadDirectoryByPath( |
461 const FilePath& file_path, | 461 const FilePath& file_path, |
462 const ReadDirectoryCallback& callback) OVERRIDE; | 462 const ReadDirectoryCallback& callback) OVERRIDE; |
463 virtual void RequestDirectoryRefresh( | 463 virtual void RequestDirectoryRefresh( |
464 const FilePath& file_path) OVERRIDE; | 464 const FilePath& file_path) OVERRIDE; |
465 virtual void GetAvailableSpace( | 465 virtual void GetAvailableSpace( |
466 const GetAvailableSpaceCallback& callback) OVERRIDE; | 466 const GetAvailableSpaceCallback& callback) OVERRIDE; |
467 virtual void AddUploadedFile(UploadMode upload_mode, | 467 virtual void AddUploadedFile(UploadMode upload_mode, |
468 const FilePath& virtual_dir_path, | 468 const FilePath& virtual_dir_path, |
469 DocumentEntry* entry, | 469 scoped_ptr<DocumentEntry> entry, |
470 const FilePath& file_content_path, | 470 const FilePath& file_content_path, |
471 GDataCache::FileOperationType cache_operation, | 471 GDataCache::FileOperationType cache_operation, |
472 const base::Closure& callback) OVERRIDE; | 472 const base::Closure& callback) OVERRIDE; |
473 | 473 |
474 // content::NotificationObserver implementation. | 474 // content::NotificationObserver implementation. |
475 virtual void Observe(int type, | 475 virtual void Observe(int type, |
476 const content::NotificationSource& source, | 476 const content::NotificationSource& source, |
477 const content::NotificationDetails& details) OVERRIDE; | 477 const content::NotificationDetails& details) OVERRIDE; |
478 | 478 |
479 // Used in tests to inject mock document service. | 479 // Used in tests to inject mock document service. |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 const FilePath& file_path); | 1220 const FilePath& file_path); |
1221 void OnRequestDirectoryRefresh(GetDocumentsParams* params, | 1221 void OnRequestDirectoryRefresh(GetDocumentsParams* params, |
1222 base::PlatformFileError error); | 1222 base::PlatformFileError error); |
1223 void RequestDirectoryRefreshByEntry(const FilePath& directory_path, | 1223 void RequestDirectoryRefreshByEntry(const FilePath& directory_path, |
1224 const std::string& directory_resource_id, | 1224 const std::string& directory_resource_id, |
1225 const FileResourceIdMap& file_map, | 1225 const FileResourceIdMap& file_map, |
1226 GDataEntry* directory_entry); | 1226 GDataEntry* directory_entry); |
1227 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); | 1227 void GetAvailableSpaceOnUIThread(const GetAvailableSpaceCallback& callback); |
1228 void AddUploadedFileOnUIThread(UploadMode upload_mode, | 1228 void AddUploadedFileOnUIThread(UploadMode upload_mode, |
1229 const FilePath& virtual_dir_path, | 1229 const FilePath& virtual_dir_path, |
1230 DocumentEntry* entry, | 1230 scoped_ptr<DocumentEntry> entry, |
1231 const FilePath& file_content_path, | 1231 const FilePath& file_content_path, |
1232 GDataCache::FileOperationType cache_operation, | 1232 GDataCache::FileOperationType cache_operation, |
1233 const base::Closure& callback); | 1233 const base::Closure& callback); |
1234 | 1234 |
1235 // All members should be accessed only on UI thread. Do not post tasks to | 1235 // All members should be accessed only on UI thread. Do not post tasks to |
1236 // other threads with base::Unretained(this). | 1236 // other threads with base::Unretained(this). |
1237 | 1237 |
1238 scoped_ptr<GDataRootDirectory> root_; | 1238 scoped_ptr<GDataRootDirectory> root_; |
1239 | 1239 |
1240 // The profile hosts the GDataFileSystem via GDataSystemService. | 1240 // The profile hosts the GDataFileSystem via GDataSystemService. |
(...skipping 28 matching lines...) Expand all Loading... |
1269 | 1269 |
1270 ObserverList<Observer> observers_; | 1270 ObserverList<Observer> observers_; |
1271 | 1271 |
1272 // The token is used to post tasks to the blocking pool in sequence. | 1272 // The token is used to post tasks to the blocking pool in sequence. |
1273 const base::SequencedWorkerPool::SequenceToken sequence_token_; | 1273 const base::SequencedWorkerPool::SequenceToken sequence_token_; |
1274 }; | 1274 }; |
1275 | 1275 |
1276 } // namespace gdata | 1276 } // namespace gdata |
1277 | 1277 |
1278 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1278 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |