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

Side by Side Diff: extensions/browser/api/storage/local_value_store_cache.cc

Issue 1226353004: Generate all extension schema namespaces as "api" and instead vary the generated bundle names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/storage/local_value_store_cache.h" 5 #include "extensions/browser/api/storage/local_value_store_cache.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 12 matching lines...) Expand all
23 using content::BrowserThread; 23 using content::BrowserThread;
24 24
25 namespace extensions { 25 namespace extensions {
26 26
27 namespace { 27 namespace {
28 28
29 // Returns the quota limit for local storage, taken from the schema in 29 // Returns the quota limit for local storage, taken from the schema in
30 // extensions/common/api/storage.json. 30 // extensions/common/api/storage.json.
31 SettingsStorageQuotaEnforcer::Limits GetLocalQuotaLimits() { 31 SettingsStorageQuotaEnforcer::Limits GetLocalQuotaLimits() {
32 SettingsStorageQuotaEnforcer::Limits limits = { 32 SettingsStorageQuotaEnforcer::Limits limits = {
33 static_cast<size_t>(core_api::storage::local::QUOTA_BYTES), 33 static_cast<size_t>(api::storage::local::QUOTA_BYTES),
34 std::numeric_limits<size_t>::max(), 34 std::numeric_limits<size_t>::max(), std::numeric_limits<size_t>::max()};
35 std::numeric_limits<size_t>::max()
36 };
37 return limits; 35 return limits;
38 } 36 }
39 37
40 } // namespace 38 } // namespace
41 39
42 LocalValueStoreCache::LocalValueStoreCache( 40 LocalValueStoreCache::LocalValueStoreCache(
43 const scoped_refptr<SettingsStorageFactory>& factory, 41 const scoped_refptr<SettingsStorageFactory>& factory,
44 const base::FilePath& profile_path) 42 const base::FilePath& profile_path)
45 : storage_factory_(factory), 43 : storage_factory_(factory),
46 extension_base_path_( 44 extension_base_path_(
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 linked_ptr<SettingsStorageQuotaEnforcer> storage( 88 linked_ptr<SettingsStorageQuotaEnforcer> storage(
91 new SettingsStorageQuotaEnforcer( 89 new SettingsStorageQuotaEnforcer(
92 quota_, storage_factory_->Create(file_path, extension->id()))); 90 quota_, storage_factory_->Create(file_path, extension->id())));
93 DCHECK(storage.get()); 91 DCHECK(storage.get());
94 92
95 storage_map_[extension->id()] = storage; 93 storage_map_[extension->id()] = storage;
96 return storage.get(); 94 return storage.get();
97 } 95 }
98 96
99 } // namespace extensions 97 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc ('k') | extensions/browser/api/storage/storage_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698