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

Side by Side Diff: chrome/browser/extensions/settings/failing_settings_storage.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: comments 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/failing_settings_storage.h" 5 #include "chrome/browser/extensions/settings/failing_settings_storage.h"
6 6
7 #include "base/logging.h"
8
7 namespace extensions { 9 namespace extensions {
8 10
9 namespace { 11 namespace {
10 12
11 const char* kGenericErrorMessage = "Failed to initialize settings"; 13 const char* kGenericErrorMessage = "Failed to initialize settings";
12 14
13 SettingsStorage::ReadResult ReadResultError() { 15 SettingsStorage::ReadResult ReadResultError() {
14 return SettingsStorage::ReadResult(kGenericErrorMessage); 16 return SettingsStorage::ReadResult(kGenericErrorMessage);
15 } 17 }
16 18
17 SettingsStorage::WriteResult WriteResultError() { 19 SettingsStorage::WriteResult WriteResultError() {
18 return SettingsStorage::WriteResult(kGenericErrorMessage); 20 return SettingsStorage::WriteResult(kGenericErrorMessage);
19 } 21 }
20 22
21 } // namespace 23 } // namespace
22 24
25 size_t FailingSettingsStorage::GetBytesInUse(const std::string& key) {
26 // Let SettingsStorageQuotaEnforcer implement this.
27 NOTREACHED() << "Not implemented";
28 return 0;
29 }
30
31 size_t FailingSettingsStorage::GetBytesInUse(
32 const std::vector<std::string>& keys) {
33 // Let SettingsStorageQuotaEnforcer implement this.
34 NOTREACHED() << "Not implemented";
35 return 0;
36 }
37
38 size_t FailingSettingsStorage::GetBytesInUse() {
39 // Let SettingsStorageQuotaEnforcer implement this.
40 NOTREACHED() << "Not implemented";
41 return 0;
42 }
43
23 SettingsStorage::ReadResult FailingSettingsStorage::Get( 44 SettingsStorage::ReadResult FailingSettingsStorage::Get(
24 const std::string& key) { 45 const std::string& key) {
25 return ReadResultError(); 46 return ReadResultError();
26 } 47 }
27 48
28 SettingsStorage::ReadResult FailingSettingsStorage::Get( 49 SettingsStorage::ReadResult FailingSettingsStorage::Get(
29 const std::vector<std::string>& keys) { 50 const std::vector<std::string>& keys) {
30 return ReadResultError(); 51 return ReadResultError();
31 } 52 }
32 53
(...skipping 19 matching lines...) Expand all
52 SettingsStorage::WriteResult FailingSettingsStorage::Remove( 73 SettingsStorage::WriteResult FailingSettingsStorage::Remove(
53 const std::vector<std::string>& keys) { 74 const std::vector<std::string>& keys) {
54 return WriteResultError(); 75 return WriteResultError();
55 } 76 }
56 77
57 SettingsStorage::WriteResult FailingSettingsStorage::Clear() { 78 SettingsStorage::WriteResult FailingSettingsStorage::Clear() {
58 return WriteResultError(); 79 return WriteResultError();
59 } 80 }
60 81
61 } // namespace extensions 82 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698