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/drive/file_system.h" | 5 #include "chrome/browser/chromeos/drive/file_system.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/chromeos/drive/change_list_loader.h" | 10 #include "chrome/browser/chromeos/drive/change_list_loader.h" |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 705 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
706 DCHECK(!callback.is_null()); | 706 DCHECK(!callback.is_null()); |
707 | 707 |
708 FileError error = GDataToFileError(status); | 708 FileError error = GDataToFileError(status); |
709 if (error != FILE_ERROR_OK) { | 709 if (error != FILE_ERROR_OK) { |
710 callback.Run(error, -1, -1); | 710 callback.Run(error, -1, -1); |
711 return; | 711 return; |
712 } | 712 } |
713 DCHECK(about_resource); | 713 DCHECK(about_resource); |
714 | 714 |
715 callback.Run(FILE_ERROR_OK, | 715 callback.Run(FILE_ERROR_OK, about_resource->quota_bytes_total(), |
716 about_resource->quota_bytes_total(), | 716 about_resource->quota_bytes_used_aggregate()); |
717 about_resource->quota_bytes_used()); | |
718 } | 717 } |
719 | 718 |
720 void FileSystem::GetShareUrl(const base::FilePath& file_path, | 719 void FileSystem::GetShareUrl(const base::FilePath& file_path, |
721 const GURL& embed_origin, | 720 const GURL& embed_origin, |
722 const GetShareUrlCallback& callback) { | 721 const GetShareUrlCallback& callback) { |
723 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 722 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
724 DCHECK(!callback.is_null()); | 723 DCHECK(!callback.is_null()); |
725 | 724 |
726 // Resolve the resource id. | 725 // Resolve the resource id. |
727 ResourceEntry* entry = new ResourceEntry; | 726 ResourceEntry* entry = new ResourceEntry; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 int64 num_bytes, | 1049 int64 num_bytes, |
1051 const FreeDiskSpaceCallback& callback) { | 1050 const FreeDiskSpaceCallback& callback) { |
1052 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1051 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1053 DCHECK(!callback.is_null()); | 1052 DCHECK(!callback.is_null()); |
1054 base::PostTaskAndReplyWithResult( | 1053 base::PostTaskAndReplyWithResult( |
1055 blocking_task_runner_.get(), FROM_HERE, | 1054 blocking_task_runner_.get(), FROM_HERE, |
1056 base::Bind(&FreeDiskSpaceIfNeededForOnBlockingPool, cache_, num_bytes), | 1055 base::Bind(&FreeDiskSpaceIfNeededForOnBlockingPool, cache_, num_bytes), |
1057 callback); | 1056 callback); |
1058 } | 1057 } |
1059 } // namespace drive | 1058 } // namespace drive |
OLD | NEW |