OLD | NEW |
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/storage_frontend.h" | 5 #include "extensions/browser/api/storage/storage_frontend.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 cache->ShutdownOnUI(); | 108 cache->ShutdownOnUI(); |
109 BrowserThread::DeleteSoon(BrowserThread::FILE, FROM_HERE, cache); | 109 BrowserThread::DeleteSoon(BrowserThread::FILE, FROM_HERE, cache); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 ValueStoreCache* StorageFrontend::GetValueStoreCache( | 113 ValueStoreCache* StorageFrontend::GetValueStoreCache( |
114 settings_namespace::Namespace settings_namespace) const { | 114 settings_namespace::Namespace settings_namespace) const { |
115 CacheMap::const_iterator it = caches_.find(settings_namespace); | 115 CacheMap::const_iterator it = caches_.find(settings_namespace); |
116 if (it != caches_.end()) | 116 if (it != caches_.end()) |
117 return it->second; | 117 return it->second; |
118 return NULL; | 118 return nullptr; |
119 } | 119 } |
120 | 120 |
121 bool StorageFrontend::IsStorageEnabled( | 121 bool StorageFrontend::IsStorageEnabled( |
122 settings_namespace::Namespace settings_namespace) const { | 122 settings_namespace::Namespace settings_namespace) const { |
123 return caches_.find(settings_namespace) != caches_.end(); | 123 return caches_.find(settings_namespace) != caches_.end(); |
124 } | 124 } |
125 | 125 |
126 void StorageFrontend::RunWithStorage( | 126 void StorageFrontend::RunWithStorage( |
127 scoped_refptr<const Extension> extension, | 127 scoped_refptr<const Extension> extension, |
128 settings_namespace::Namespace settings_namespace, | 128 settings_namespace::Namespace settings_namespace, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // static | 172 // static |
173 BrowserContextKeyedAPIFactory<StorageFrontend>* | 173 BrowserContextKeyedAPIFactory<StorageFrontend>* |
174 StorageFrontend::GetFactoryInstance() { | 174 StorageFrontend::GetFactoryInstance() { |
175 return g_factory.Pointer(); | 175 return g_factory.Pointer(); |
176 } | 176 } |
177 | 177 |
178 // static | 178 // static |
179 const char* StorageFrontend::service_name() { return "StorageFrontend"; } | 179 const char* StorageFrontend::service_name() { return "StorageFrontend"; } |
180 | 180 |
181 } // namespace extensions | 181 } // namespace extensions |
OLD | NEW |