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 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 FROM_HERE, | 766 FROM_HERE, |
767 base::Bind(callback, error, file_path, mime_type, file_type)); | 767 base::Bind(callback, error, file_path, mime_type, file_type)); |
768 } | 768 } |
769 | 769 |
770 // Ditto for GetDownloadDataCallback. | 770 // Ditto for GetDownloadDataCallback. |
771 void RelayGetDownloadDataCallback( | 771 void RelayGetDownloadDataCallback( |
772 scoped_refptr<base::MessageLoopProxy> relay_proxy, | 772 scoped_refptr<base::MessageLoopProxy> relay_proxy, |
773 const GetDownloadDataCallback& callback, | 773 const GetDownloadDataCallback& callback, |
774 GDataErrorCode error, | 774 GDataErrorCode error, |
775 scoped_ptr<std::string> download_data) { | 775 scoped_ptr<std::string> download_data) { |
| 776 // Unlike other callbacks, GetDownloadDataCallback is optional, hence it |
| 777 // can be null here. |
| 778 if (callback.is_null()) |
| 779 return; |
776 relay_proxy->PostTask( | 780 relay_proxy->PostTask( |
777 FROM_HERE, | 781 FROM_HERE, |
778 base::Bind(callback, error, base::Passed(&download_data))); | 782 base::Bind(callback, error, base::Passed(&download_data))); |
779 } | 783 } |
780 | 784 |
781 // Ditto for GetCacheStateCallback. | 785 // Ditto for GetCacheStateCallback. |
782 void RelayGetCacheStateCallback( | 786 void RelayGetCacheStateCallback( |
783 scoped_refptr<base::MessageLoopProxy> relay_proxy, | 787 scoped_refptr<base::MessageLoopProxy> relay_proxy, |
784 const GetCacheStateCallback& callback, | 788 const GetCacheStateCallback& callback, |
785 base::PlatformFileError error, | 789 base::PlatformFileError error, |
(...skipping 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4788 pref_registrar_->Init(profile_->GetPrefs()); | 4792 pref_registrar_->Init(profile_->GetPrefs()); |
4789 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); | 4793 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); |
4790 } | 4794 } |
4791 | 4795 |
4792 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 4796 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
4793 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 4797 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
4794 global_free_disk_getter_for_testing = getter; | 4798 global_free_disk_getter_for_testing = getter; |
4795 } | 4799 } |
4796 | 4800 |
4797 } // namespace gdata | 4801 } // namespace gdata |
OLD | NEW |