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 <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" |
15 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
16 #include "base/timer.h" | 17 #include "base/timer.h" |
17 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
18 #include "base/threading/sequenced_worker_pool.h" | 19 #include "base/threading/sequenced_worker_pool.h" |
19 #include "chrome/browser/chromeos/gdata/find_entry_callback.h" | 20 #include "chrome/browser/chromeos/gdata/find_entry_callback.h" |
20 #include "chrome/browser/chromeos/gdata/gdata_cache.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
21 #include "chrome/browser/chromeos/gdata/gdata_files.h" | 22 #include "chrome/browser/chromeos/gdata/gdata_files.h" |
22 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" | |
23 #include "chrome/browser/prefs/pref_change_registrar.h" | 23 #include "chrome/browser/prefs/pref_change_registrar.h" |
24 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
25 | 25 |
26 namespace base { | 26 namespace base { |
27 class WaitableEvent; | 27 class WaitableEvent; |
28 } | 28 } |
29 | 29 |
30 namespace gdata { | 30 namespace gdata { |
31 | 31 |
32 class DocumentsServiceInterface; | 32 class DocumentsServiceInterface; |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 // Gets a file by the given |resource_id| from the gdata server. Used for | 335 // Gets a file by the given |resource_id| from the gdata server. Used for |
336 // fetching pinned-but-not-fetched files. | 336 // fetching pinned-but-not-fetched files. |
337 // | 337 // |
338 // Can be called from UI/IO thread. |get_file_callback| and | 338 // Can be called from UI/IO thread. |get_file_callback| and |
339 // |get_download_data_callback| are run on the calling thread. | 339 // |get_download_data_callback| are run on the calling thread. |
340 virtual void GetFileByResourceId( | 340 virtual void GetFileByResourceId( |
341 const std::string& resource_id, | 341 const std::string& resource_id, |
342 const GetFileCallback& get_file_callback, | 342 const GetFileCallback& get_file_callback, |
343 const GetDownloadDataCallback& get_download_data_callback) = 0; | 343 const GetDownloadDataCallback& get_download_data_callback) = 0; |
344 | 344 |
345 // Gets the operation registry that manages all operations performed through | |
346 // the GDataFileSystem object. | |
347 virtual GDataOperationRegistry* GetOperationRegistry() = 0; | |
348 | |
349 // Gets the cache state of file corresponding to |resource_id| and |md5| if it | 345 // Gets the cache state of file corresponding to |resource_id| and |md5| if it |
350 // exists on disk. | 346 // exists on disk. |
351 // Initializes cache if it has not been initialized. | 347 // Initializes cache if it has not been initialized. |
352 // Upon completion, |callback| is invoked on the thread where this method was | 348 // Upon completion, |callback| is invoked on the thread where this method was |
353 // called with the cache state if file exists in cache or CACHE_STATE_NONE | 349 // called with the cache state if file exists in cache or CACHE_STATE_NONE |
354 // otherwise. | 350 // otherwise. |
355 virtual void GetCacheState(const std::string& resource_id, | 351 virtual void GetCacheState(const std::string& resource_id, |
356 const std::string& md5, | 352 const std::string& md5, |
357 const GetCacheStateCallback& callback) = 0; | 353 const GetCacheStateCallback& callback) = 0; |
358 | 354 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 bool is_recursive, | 494 bool is_recursive, |
499 const FileOperationCallback& callback) OVERRIDE; | 495 const FileOperationCallback& callback) OVERRIDE; |
500 virtual void GetFileByPath( | 496 virtual void GetFileByPath( |
501 const FilePath& file_path, | 497 const FilePath& file_path, |
502 const GetFileCallback& get_file_callback, | 498 const GetFileCallback& get_file_callback, |
503 const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; | 499 const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; |
504 virtual void GetFileByResourceId( | 500 virtual void GetFileByResourceId( |
505 const std::string& resource_id, | 501 const std::string& resource_id, |
506 const GetFileCallback& get_file_callback, | 502 const GetFileCallback& get_file_callback, |
507 const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; | 503 const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; |
508 virtual GDataOperationRegistry* GetOperationRegistry() OVERRIDE; | |
509 virtual void GetCacheState(const std::string& resource_id, | 504 virtual void GetCacheState(const std::string& resource_id, |
510 const std::string& md5, | 505 const std::string& md5, |
511 const GetCacheStateCallback& callback) OVERRIDE; | 506 const GetCacheStateCallback& callback) OVERRIDE; |
512 virtual void GetEntryInfoByPathAsync( | 507 virtual void GetEntryInfoByPathAsync( |
513 const FilePath& file_path, | 508 const FilePath& file_path, |
514 const GetEntryInfoCallback& callback) OVERRIDE; | 509 const GetEntryInfoCallback& callback) OVERRIDE; |
515 virtual void GetFileInfoByPathAsync( | 510 virtual void GetFileInfoByPathAsync( |
516 const FilePath& file_path, | 511 const FilePath& file_path, |
517 const GetFileInfoCallback& callback) OVERRIDE; | 512 const GetFileInfoCallback& callback) OVERRIDE; |
518 virtual void ReadDirectoryByPathAsync( | 513 virtual void ReadDirectoryByPathAsync( |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 }; | 1548 }; |
1554 | 1549 |
1555 // Sets the free disk space getter for testing. | 1550 // Sets the free disk space getter for testing. |
1556 // The existing getter is deleted. | 1551 // The existing getter is deleted. |
1557 void SetFreeDiskSpaceGetterForTesting( | 1552 void SetFreeDiskSpaceGetterForTesting( |
1558 FreeDiskSpaceGetterInterface* getter); | 1553 FreeDiskSpaceGetterInterface* getter); |
1559 | 1554 |
1560 } // namespace gdata | 1555 } // namespace gdata |
1561 | 1556 |
1562 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1557 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |