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

Side by Side Diff: chrome/browser/extensions/api/storage/storage_api.cc

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase for storage_api Created 6 years, 9 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) 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/storage/storage_api.h" 5 #include "chrome/browser/extensions/api/storage/storage_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 29 matching lines...) Expand all
40 40
41 bool SettingsFunction::RunImpl() { 41 bool SettingsFunction::RunImpl() {
42 std::string settings_namespace_string; 42 std::string settings_namespace_string;
43 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &settings_namespace_string)); 43 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &settings_namespace_string));
44 args_->Remove(0, NULL); 44 args_->Remove(0, NULL);
45 settings_namespace_ = 45 settings_namespace_ =
46 settings_namespace::FromString(settings_namespace_string); 46 settings_namespace::FromString(settings_namespace_string);
47 EXTENSION_FUNCTION_VALIDATE( 47 EXTENSION_FUNCTION_VALIDATE(
48 settings_namespace_ != settings_namespace::INVALID); 48 settings_namespace_ != settings_namespace::INVALID);
49 49
50 SettingsFrontend* frontend = SettingsFrontend::Get(context()); 50 SettingsFrontend* frontend = SettingsFrontend::Get(browser_context());
51 if (!frontend->IsStorageEnabled(settings_namespace_)) { 51 if (!frontend->IsStorageEnabled(settings_namespace_)) {
52 error_ = base::StringPrintf( 52 error_ = base::StringPrintf(
53 "\"%s\" is not available in this instance of Chrome", 53 "\"%s\" is not available in this instance of Chrome",
54 settings_namespace_string.c_str()); 54 settings_namespace_string.c_str());
55 return false; 55 return false;
56 } 56 }
57 57
58 observers_ = frontend->GetObservers(); 58 observers_ = frontend->GetObservers();
59 frontend->RunWithStorage( 59 frontend->RunWithStorage(
60 extension_id(), 60 extension_id(),
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool StorageStorageAreaClearFunction::RunWithStorage(ValueStore* storage) { 295 bool StorageStorageAreaClearFunction::RunWithStorage(ValueStore* storage) {
296 return UseWriteResult(storage->Clear(), storage); 296 return UseWriteResult(storage->Clear(), storage);
297 } 297 }
298 298
299 void StorageStorageAreaClearFunction::GetQuotaLimitHeuristics( 299 void StorageStorageAreaClearFunction::GetQuotaLimitHeuristics(
300 QuotaLimitHeuristics* heuristics) const { 300 QuotaLimitHeuristics* heuristics) const {
301 GetModificationQuotaLimitHeuristics(heuristics); 301 GetModificationQuotaLimitHeuristics(heuristics);
302 } 302 }
303 303
304 } // namespace extensions 304 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/sockets_udp/udp_socket_event_dispatcher.h ('k') | chrome/browser/extensions/api/usb/usb_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698