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

Side by Side Diff: chrome/browser/net/sdch_owner_pref_storage.h

Issue 1634653003: Abstract pref storage from net::SdchOwner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@net_prefs
Patch Set: Created 4 years, 11 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
(Empty)
1 // Copyright 2015 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 #ifndef CHROME_BROWSER_NET_SDCH_OWNER_PREF_STORAGE_H_
6 #define CHROME_BROWSER_NET_SDCH_OWNER_PREF_STORAGE_H_
7
8 #include "base/macros.h"
9 #include "base/prefs/pref_store.h"
10 #include "net/sdch/sdch_owner.h"
11
12 class PersistentPrefStore;
13
14 namespace chrome_browser_net {
15
16 // Provides and implementation of SdchOwner::PrefStorage that maps to
17 // Chrome's preferences system.
18 class SdchOwnerPrefStorage
19 : public net::SdchOwner::PrefStorage,
20 public PrefStore::Observer {
21 public:
22 // The storage must outlive this class.
23 explicit SdchOwnerPrefStorage(PersistentPrefStore* storage);
24 ~SdchOwnerPrefStorage() override;
25
26 ReadError GetReadError() const override;
27 bool GetValue(const base::DictionaryValue** result) const override;
28 bool GetMutableValue(base::DictionaryValue** result) override;
29 void SetValue(scoped_ptr<base::DictionaryValue> value) override;
30 void ReportValueChanged() override;
31 bool IsInitializationComplete() override;
32 void StartObservingInit(net::SdchOwner* observer) override;
33 void StopObservingInit() override;
34
35 private:
36 // PrefStore::Observer implementation.
37 void OnPrefValueChanged(const std::string& key) override;
38 void OnInitializationCompleted(bool succeeded) override;
39
40 PersistentPrefStore* storage_; // Non-owning.
41 const std::string storage_key_;
42
43 net::SdchOwner* init_observer_; // Non-owning.
44
45 DISALLOW_COPY_AND_ASSIGN(SdchOwnerPrefStorage);
46 };
47
48 } // namespace chrome_browser_net
49
50 #endif // CHROME_BROWSER_NET_SDCH_OWNER_PREF_STORAGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/sdch_owner_pref_storage.cc » ('j') | chrome/browser/net/sdch_owner_pref_storage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698