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

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: Hiroki Review #1 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') | 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/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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 181 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
182 BrowserThread::PostTask( 182 BrowserThread::PostTask(
183 BrowserThread::UI, 183 BrowserThread::UI,
184 FROM_HERE, 184 FROM_HERE,
185 Bind(&SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota, this, 185 Bind(&SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota, this,
186 status, usage, quota)); 186 status, usage, quota));
187 return; 187 return;
188 } 188 }
189 189
190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
191 // TODO(calvinlo): Convert QuotaStatusCode to error string
192 // (http://crbug.com/156791).
193 if (status != quota::kQuotaStatusOk) { 191 if (status != quota::kQuotaStatusOk) {
194 error_ = base::StringPrintf(kQuotaError, static_cast<int>(status)); 192 error_ = QuotaStatusCodeToString(status);
195 SendResponse(false); 193 SendResponse(false);
196 return; 194 return;
197 } 195 }
198 196
199 api::sync_file_system::StorageInfo info; 197 api::sync_file_system::StorageInfo info;
200 info.usage_bytes = usage; 198 info.usage_bytes = usage;
201 info.quota_bytes = quota; 199 info.quota_bytes = quota;
202 results_ = api::sync_file_system::GetUsageAndQuota::Results::Create(info); 200 results_ = api::sync_file_system::GetUsageAndQuota::Results::Create(info);
203 SendResponse(true); 201 SendResponse(true);
204 } 202 }
205 203
206 } // namespace extensions 204 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | webkit/quota/quota_status_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698