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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.h

Issue 10538071: gdata: Convert FindEntryByResourceIdSync() to asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/observer_list.h"
16 #include "base/platform_file.h" 16 #include "base/platform_file.h"
17 #include "base/timer.h" 17 #include "base/timer.h"
18 #include "base/synchronization/lock.h" 18 #include "base/synchronization/lock.h"
19 #include "base/threading/sequenced_worker_pool.h" 19 #include "base/threading/sequenced_worker_pool.h"
20 #include "chrome/browser/chromeos/gdata/find_entry_callback.h"
21 #include "chrome/browser/chromeos/gdata/gdata_cache.h" 20 #include "chrome/browser/chromeos/gdata/gdata_cache.h"
22 #include "chrome/browser/chromeos/gdata/gdata_files.h" 21 #include "chrome/browser/chromeos/gdata/gdata_files.h"
23 #include "chrome/browser/prefs/pref_change_registrar.h" 22 #include "chrome/browser/prefs/pref_change_registrar.h"
24 #include "content/public/browser/notification_observer.h" 23 #include "content/public/browser/notification_observer.h"
25 24
26 namespace base { 25 namespace base {
27 class WaitableEvent; 26 class WaitableEvent;
28 } 27 }
29 28
30 namespace gdata { 29 namespace gdata {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 }; 175 };
177 176
178 // Authenticates the user by fetching the auth token as 177 // Authenticates the user by fetching the auth token as
179 // needed. |callback| will be run with the error code and the auth 178 // needed. |callback| will be run with the error code and the auth
180 // token, on the thread this function is run. 179 // token, on the thread this function is run.
181 // 180 //
182 // Must be called on UI thread. 181 // Must be called on UI thread.
183 virtual void Authenticate(const AuthStatusCallback& callback) = 0; 182 virtual void Authenticate(const AuthStatusCallback& callback) = 0;
184 183
185 // Finds file info by using |resource_id|. This call does not initiate 184 // Finds file info by using |resource_id|. This call does not initiate
186 // content refreshing and will invoke one of |callback| methods directly as 185 // content refreshing.
187 // it executes.
188 // 186 //
189 // Can be called from UI/IO thread. |callback| is run on the calling thread 187 // Can be called from UI/IO thread. |callback| is run on the calling thread.
190 // synchronously. 188 virtual void FindEntryByResourceIdAsync(
hashimoto 2012/06/11 09:44:34 nit: Just 'FindEntryByResourceId'?
hshi1 2012/06/11 17:48:53 Done. Removed the suffix "Async" from all occurenc
191 virtual void FindEntryByResourceIdSync(const std::string& resource_id, 189 const std::string& resource_id,
192 const FindEntryCallback& callback) = 0; 190 const FindEntryCallback& callback) = 0;
193 191
194 // Initiates transfer of |remote_src_file_path| to |local_dest_file_path|. 192 // Initiates transfer of |remote_src_file_path| to |local_dest_file_path|.
195 // |remote_src_file_path| is the virtual source path on the gdata file system. 193 // |remote_src_file_path| is the virtual source path on the gdata file system.
196 // |local_dest_file_path| is the destination path on the local file system. 194 // |local_dest_file_path| is the destination path on the local file system.
197 // 195 //
198 // Must be called from *UI* thread. |callback| is run on the calling thread. 196 // Must be called from *UI* thread. |callback| is run on the calling thread.
199 virtual void TransferFileFromRemoteToLocal( 197 virtual void TransferFileFromRemoteToLocal(
200 const FilePath& remote_src_file_path, 198 const FilePath& remote_src_file_path,
201 const FilePath& local_dest_file_path, 199 const FilePath& local_dest_file_path,
202 const FileOperationCallback& callback) = 0; 200 const FileOperationCallback& callback) = 0;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 virtual ~GDataFileSystem(); 425 virtual ~GDataFileSystem();
428 426
429 // GDataFileSystem overrides. 427 // GDataFileSystem overrides.
430 virtual void Initialize() OVERRIDE; 428 virtual void Initialize() OVERRIDE;
431 virtual void AddObserver(Observer* observer) OVERRIDE; 429 virtual void AddObserver(Observer* observer) OVERRIDE;
432 virtual void RemoveObserver(Observer* observer) OVERRIDE; 430 virtual void RemoveObserver(Observer* observer) OVERRIDE;
433 virtual void StartUpdates() OVERRIDE; 431 virtual void StartUpdates() OVERRIDE;
434 virtual void StopUpdates() OVERRIDE; 432 virtual void StopUpdates() OVERRIDE;
435 virtual void CheckForUpdates() OVERRIDE; 433 virtual void CheckForUpdates() OVERRIDE;
436 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; 434 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE;
437 virtual void FindEntryByResourceIdSync( 435 virtual void FindEntryByResourceIdAsync(
438 const std::string& resource_id, 436 const std::string& resource_id,
439 const FindEntryCallback& callback) OVERRIDE; 437 const FindEntryCallback& callback) OVERRIDE;
440 virtual void SearchAsync(const std::string& search_query, 438 virtual void SearchAsync(const std::string& search_query,
441 const ReadDirectoryCallback& callback) OVERRIDE; 439 const ReadDirectoryCallback& callback) OVERRIDE;
442 virtual void TransferFileFromRemoteToLocal( 440 virtual void TransferFileFromRemoteToLocal(
443 const FilePath& remote_src_file_path, 441 const FilePath& remote_src_file_path,
444 const FilePath& local_dest_file_path, 442 const FilePath& local_dest_file_path,
445 const FileOperationCallback& callback) OVERRIDE; 443 const FileOperationCallback& callback) OVERRIDE;
446 virtual void TransferFileFromLocalToRemote( 444 virtual void TransferFileFromLocalToRemote(
447 const FilePath& local_src_file_path, 445 const FilePath& local_src_file_path,
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 void GetFileByResourceIdOnUIThread( 1439 void GetFileByResourceIdOnUIThread(
1442 const std::string& resource_id, 1440 const std::string& resource_id,
1443 const GetFileCallback& get_file_callback, 1441 const GetFileCallback& get_file_callback,
1444 const GetDownloadDataCallback& get_download_data_callback); 1442 const GetDownloadDataCallback& get_download_data_callback);
1445 void GetEntryInfoByPathAsyncOnUIThread( 1443 void GetEntryInfoByPathAsyncOnUIThread(
1446 const FilePath& file_path, 1444 const FilePath& file_path,
1447 const GetEntryInfoCallback& callback); 1445 const GetEntryInfoCallback& callback);
1448 void GetFileInfoByPathAsyncOnUIThread( 1446 void GetFileInfoByPathAsyncOnUIThread(
1449 const FilePath& file_path, 1447 const FilePath& file_path,
1450 const GetFileInfoCallback& callback); 1448 const GetFileInfoCallback& callback);
1449 void FindEntryByResourceIdAsyncOnUIThread(
1450 const std::string& resource_id,
1451 const FindEntryCallback& callback);
1451 void ReadDirectoryByPathAsyncOnUIThread( 1452 void ReadDirectoryByPathAsyncOnUIThread(
1452 const FilePath& file_path, 1453 const FilePath& file_path,
1453 const ReadDirectoryCallback& callback); 1454 const ReadDirectoryCallback& callback);
1454 void RequestDirectoryRefreshOnUIThread( 1455 void RequestDirectoryRefreshOnUIThread(
1455 const FilePath& file_path); 1456 const FilePath& file_path);
1456 void OnRequestDirectoryRefresh(GetDocumentsParams* params, 1457 void OnRequestDirectoryRefresh(GetDocumentsParams* params,
1457 base::PlatformFileError error); 1458 base::PlatformFileError error);
1458 void GetCacheStateOnUIThread(const std::string& resource_id, 1459 void GetCacheStateOnUIThread(const std::string& resource_id,
1459 const std::string& md5, 1460 const std::string& md5,
1460 const GetCacheStateCallback& callback); 1461 const GetCacheStateCallback& callback);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 }; 1528 };
1528 1529
1529 // Sets the free disk space getter for testing. 1530 // Sets the free disk space getter for testing.
1530 // The existing getter is deleted. 1531 // The existing getter is deleted.
1531 void SetFreeDiskSpaceGetterForTesting( 1532 void SetFreeDiskSpaceGetterForTesting(
1532 FreeDiskSpaceGetterInterface* getter); 1533 FreeDiskSpaceGetterInterface* getter);
1533 1534
1534 } // namespace gdata 1535 } // namespace gdata
1535 1536
1536 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 1537 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698