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

Side by Side Diff: chrome/browser/extensions/settings/settings_api.cc

Issue 9284013: Extension Storage API: expose storage quota information to extensions, via: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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/settings/settings_api.h" 5 #include "chrome/browser/extensions/settings/settings_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extensions_quota_service.h" 10 #include "chrome/browser/extensions/extensions_quota_service.h"
11 #include "chrome/browser/extensions/settings/settings_api.h" 11 #include "chrome/browser/extensions/settings/settings_api.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 bool ClearSettingsFunction::RunWithStorage(SettingsStorage* storage) { 226 bool ClearSettingsFunction::RunWithStorage(SettingsStorage* storage) {
227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 227 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
228 return UseWriteResult(storage->Clear()); 228 return UseWriteResult(storage->Clear());
229 } 229 }
230 230
231 void ClearSettingsFunction::GetQuotaLimitHeuristics( 231 void ClearSettingsFunction::GetQuotaLimitHeuristics(
232 QuotaLimitHeuristics* heuristics) const { 232 QuotaLimitHeuristics* heuristics) const {
233 GetModificationQuotaLimitHeuristics(heuristics); 233 GetModificationQuotaLimitHeuristics(heuristics);
234 } 234 }
235 235
236 bool GetBytesInUseSettingsFunction::RunWithStorage(SettingsStorage* storage) {
237 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
238 result_.reset(Value::CreateIntegerValue(storage->GetBytesInUse()));
239 return true;
240 }
241
236 } // namespace extensions 242 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698