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

Side by Side Diff: chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc

Issue 11363098: Added quota_status_code.h/cc file to hold QuotaStatusCode enum and added function to convert enum t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | webkit/quota/quota_status_code.h » ('j') | webkit/quota/webkit_quota.gypi » ('J')
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/extensions/api/sync_file_system/sync_file_system_api.h" 5 #include "chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
140 BrowserThread::PostTask( 140 BrowserThread::PostTask(
141 BrowserThread::UI, 141 BrowserThread::UI,
142 FROM_HERE, 142 FROM_HERE,
143 Bind(&SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota, this, 143 Bind(&SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota, this,
144 status, usage, quota)); 144 status, usage, quota));
145 return; 145 return;
146 } 146 }
147 147
148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
149 // TODO(calvinlo): Convert QuotaStatusCode to error string
150 // (http://crbug.com/156791).
151 if (status != quota::kQuotaStatusOk) { 149 if (status != quota::kQuotaStatusOk) {
152 error_ = base::StringPrintf(kQuotaError, static_cast<int>(status)); 150 error_ = QuotaStatusCodeToString(status);
153 SendResponse(false); 151 SendResponse(false);
154 return; 152 return;
155 } 153 }
156 154
157 api::sync_file_system::StorageInfo info; 155 api::sync_file_system::StorageInfo info;
158 info.usage_bytes = usage; 156 info.usage_bytes = usage;
159 info.quota_bytes = quota; 157 info.quota_bytes = quota;
160 results_ = api::sync_file_system::GetUsageAndQuota::Results::Create(info); 158 results_ = api::sync_file_system::GetUsageAndQuota::Results::Create(info);
161 SendResponse(true); 159 SendResponse(true);
162 } 160 }
163 161
164 } // namespace extensions 162 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/quota_status_code.h » ('j') | webkit/quota/webkit_quota.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698