OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/extensions/api/storage/settings_backend.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "chrome/browser/extensions/api/storage/settings_storage_factory.h" | |
9 #include "content/public/browser/browser_thread.h" | |
10 | |
11 using content::BrowserThread; | |
12 | |
13 namespace extensions { | |
14 | |
15 SettingsBackend::SettingsBackend( | |
16 const scoped_refptr<SettingsStorageFactory>& storage_factory, | |
17 const base::FilePath& base_path, | |
18 const SettingsStorageQuotaEnforcer::Limits& quota) | |
19 : storage_factory_(storage_factory), base_path_(base_path), quota_(quota) { | |
20 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | |
21 } | |
22 | |
23 SettingsBackend::~SettingsBackend() { | |
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | |
25 } | |
26 | |
27 syncer::SyncableService* SettingsBackend::GetAsSyncableService() { | |
28 NOTREACHED(); | |
29 return NULL; | |
30 } | |
31 | |
32 scoped_ptr<SettingsStorageQuotaEnforcer> | |
33 SettingsBackend::CreateStorageForExtension( | |
34 const std::string& extension_id) const { | |
35 scoped_ptr<SettingsStorageQuotaEnforcer> storage( | |
36 new SettingsStorageQuotaEnforcer( | |
37 quota(), storage_factory()->Create(base_path(), extension_id))); | |
38 DCHECK(storage.get()); | |
39 return storage.Pass(); | |
40 } | |
41 | |
42 } // namespace extensions | |
OLD | NEW |