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

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

Issue 10207022: gdata: Simplify InitiateUpload() and ResumeUpload() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 <sys/stat.h> 9 #include <sys/stat.h>
10 10
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 GDataEntry* GetGDataEntryByPath(const FilePath& file_path); 579 GDataEntry* GetGDataEntryByPath(const FilePath& file_path);
580 580
581 // Inits cache directory paths in the provided root. 581 // Inits cache directory paths in the provided root.
582 // Should be called before cache is initialized. 582 // Should be called before cache is initialized.
583 void SetCachePaths(const FilePath& root_path); 583 void SetCachePaths(const FilePath& root_path);
584 584
585 // Initiates upload operation of file defined with |file_name|, 585 // Initiates upload operation of file defined with |file_name|,
586 // |content_type| and |content_length|. The operation will place the newly 586 // |content_type| and |content_length|. The operation will place the newly
587 // created file entity into |destination_directory|. 587 // created file entity into |destination_directory|.
588 // 588 //
589 // Can be called from UI/IO thread. |callback| is run on the calling thread. 589 // Can be called from *UI* thread. |callback| is run on the calling thread.
590 void InitiateUpload(const std::string& file_name, 590 void InitiateUpload(const std::string& file_name,
achuithb 2012/04/24 23:46:14 Could you also please add a TODO to remove these p
satorux1 2012/04/24 23:54:19 Done.
591 const std::string& content_type, 591 const std::string& content_type,
592 int64 content_length, 592 int64 content_length,
593 const FilePath& destination_directory, 593 const FilePath& destination_directory,
594 const FilePath& virtual_path, 594 const FilePath& virtual_path,
595 const InitiateUploadCallback& callback); 595 const InitiateUploadCallback& callback);
596 596
597 // Resumes upload operation for chunk of file defined in |params.. 597 // Resumes upload operation for chunk of file defined in |params..
598 // 598 //
599 // Can be called from UI/IO thread. |callback| is run on the calling thread. 599 // Can be called from *UI* thread. |callback| is run on the calling thread.
600 void ResumeUpload(const ResumeUploadParams& params, 600 void ResumeUpload(const ResumeUploadParams& params,
601 const ResumeFileUploadCallback& callback); 601 const ResumeFileUploadCallback& callback);
602 602
603 // Unsafe (unlocked) version of FindEntryByPathSync method. 603 // Unsafe (unlocked) version of FindEntryByPathSync method.
604 void UnsafeFindEntryByPath(const FilePath& file_path, 604 void UnsafeFindEntryByPath(const FilePath& file_path,
605 FindEntryDelegate* delegate); 605 FindEntryDelegate* delegate);
606 606
607 // Converts document feed from gdata service into DirectoryInfo. On failure, 607 // Converts document feed from gdata service into DirectoryInfo. On failure,
608 // returns NULL and fills in |error| with an appropriate value. 608 // returns NULL and fills in |error| with an appropriate value.
609 GDataDirectory* ParseGDataFeed(GDataErrorCode status, 609 GDataDirectory* ParseGDataFeed(GDataErrorCode status,
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 const GURL& content_url, 781 const GURL& content_url,
782 const FilePath& downloaded_file_path, 782 const FilePath& downloaded_file_path,
783 bool* has_enough_space); 783 bool* has_enough_space);
784 784
785 // Callback for handling internal StoreToCache() calls after downloading 785 // Callback for handling internal StoreToCache() calls after downloading
786 // file content. 786 // file content.
787 void OnDownloadStoredToCache(base::PlatformFileError error, 787 void OnDownloadStoredToCache(base::PlatformFileError error,
788 const std::string& resource_id, 788 const std::string& resource_id,
789 const std::string& md5); 789 const std::string& md5);
790 790
791 // Callback for handling file upload initialization requests.
792 void OnUploadLocationReceived(
793 const InitiateUploadCallback& callback,
794 scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
795 GDataErrorCode code,
796 const GURL& upload_location);
797
798 // Callback for handling file upload resume requests.
799 void OnResumeUpload(
800 scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
801 const ResumeFileUploadCallback& callback,
802 const ResumeUploadResponse& response,
803 scoped_ptr<DocumentEntry> new_entry);
804
805 // Renames a file or directory at |file_path| on in-memory snapshot 791 // Renames a file or directory at |file_path| on in-memory snapshot
806 // of the file system. Returns PLATFORM_FILE_OK if successful. 792 // of the file system. Returns PLATFORM_FILE_OK if successful.
807 base::PlatformFileError RenameFileOnFilesystem( 793 base::PlatformFileError RenameFileOnFilesystem(
808 const FilePath& file_path, const FilePath::StringType& new_name, 794 const FilePath& file_path, const FilePath::StringType& new_name,
809 FilePath* updated_file_path); 795 FilePath* updated_file_path);
810 796
811 // Adds a file or directory at |file_path| to another directory at 797 // Adds a file or directory at |file_path| to another directory at
812 // |dir_path| on in-memory snapshot of the file system. 798 // |dir_path| on in-memory snapshot of the file system.
813 // Returns PLATFORM_FILE_OK if successful. 799 // Returns PLATFORM_FILE_OK if successful.
814 base::PlatformFileError AddEntryToDirectoryOnFilesystem( 800 base::PlatformFileError AddEntryToDirectoryOnFilesystem(
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 }; 1330 };
1345 1331
1346 // Sets the free disk space getter for testing. 1332 // Sets the free disk space getter for testing.
1347 // The existing getter is deleted. 1333 // The existing getter is deleted.
1348 void SetFreeDiskSpaceGetterForTesting( 1334 void SetFreeDiskSpaceGetterForTesting(
1349 FreeDiskSpaceGetterInterface* getter); 1335 FreeDiskSpaceGetterInterface* getter);
1350 1336
1351 } // namespace gdata 1337 } // namespace gdata
1352 1338
1353 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ 1339 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('j') | chrome/browser/chromeos/gdata/gdata_file_system.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698