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

Side by Side Diff: chrome/browser/chromeos/drive/file_system.cc

Issue 1125123008: Files.app: Use quotaBytesUsedAggregate to know the actual available space. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/drive/drive_api_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/drive/drive_api_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698