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 <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
610 base::Value* data, | 610 base::Value* data, |
611 base::PlatformFileError *error); | 611 base::PlatformFileError *error); |
612 | 612 |
613 // Checks if a local file at |local_file_path| is a JSON file referencing a | |
614 // hosted document on IO thread poll, and if so, gets the resource ID of the | |
615 // document. | |
616 static void GetDocumentResourceIdOnIOThreadPool( | |
617 const FilePath& local_file_path, | |
618 std::string* resource_id); | |
619 | |
620 // Creates a temporary JSON file representing a document with |edit_url| | |
621 // and |resource_id| under |document_dir| on IO thread pool. | |
622 static void CreateDocumentJsonFileOnIOThreadPool( | |
623 const FilePath& document_dir, | |
624 const GURL& edit_url, | |
625 const std::string& resource_id, | |
626 base::PlatformFileError* error, | |
627 FilePath* temp_file_path, | |
628 std::string* mime_type, | |
629 GDataFileType* file_type); | |
630 | |
631 // Initiates transfer of |local_file_path| with |resource_id| to | 613 // Initiates transfer of |local_file_path| with |resource_id| to |
632 // |remote_dest_file_path|. |local_file_path| must be a file from the local | 614 // |remote_dest_file_path|. |local_file_path| must be a file from the local |
633 // file system, |remote_dest_file_path| is the virtual destination path within | 615 // file system, |remote_dest_file_path| is the virtual destination path within |
634 // gdata file system. If |resource_id| is a non-empty string, the transfer is | 616 // gdata file system. If |resource_id| is a non-empty string, the transfer is |
635 // handled by CopyDocumentToDirectory. Otherwise, the transfer is handled by | 617 // handled by CopyDocumentToDirectory. Otherwise, the transfer is handled by |
636 // TransferRegularFile. | 618 // TransferRegularFile. |
637 // | 619 // |
638 // Must be called from *UI* thread. |callback| is run on the calling thread. | 620 // Must be called from *UI* thread. |callback| is run on the calling thread. |
639 void TransferFileForResourceId(const FilePath& local_file_path, | 621 void TransferFileForResourceId(const FilePath& local_file_path, |
640 const FilePath& remote_dest_file_path, | 622 const FilePath& remote_dest_file_path, |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 }; | 1326 }; |
1345 | 1327 |
1346 // Sets the free disk space getter for testing. | 1328 // Sets the free disk space getter for testing. |
1347 // The existing getter is deleted. | 1329 // The existing getter is deleted. |
1348 void SetFreeDiskSpaceGetterForTesting( | 1330 void SetFreeDiskSpaceGetterForTesting( |
1349 FreeDiskSpaceGetterInterface* getter); | 1331 FreeDiskSpaceGetterInterface* getter); |
1350 | 1332 |
1351 } // namespace gdata | 1333 } // namespace gdata |
1352 | 1334 |
1353 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1335 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
OLD | NEW |