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

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

Issue 189263013: Move extensions storage API implementation to src/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (move_storage) 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
(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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/storage/settings_backend.h ('k') | chrome/browser/extensions/api/storage/settings_frontend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698