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

Side by Side Diff: components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h

Issue 1662843002: Revert of Delete base/prefs and update callers to use components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_ 5 #ifndef COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_
6 #define COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_ 6 #define COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "base/prefs/base_prefs_export.h"
22 #include "base/prefs/persistent_pref_store.h"
23 #include "base/prefs/pref_filter.h"
21 #include "base/threading/non_thread_safe.h" 24 #include "base/threading/non_thread_safe.h"
22 #include "components/filesystem/public/interfaces/directory.mojom.h" 25 #include "components/filesystem/public/interfaces/directory.mojom.h"
23 #include "components/filesystem/public/interfaces/file.mojom.h" 26 #include "components/filesystem/public/interfaces/file.mojom.h"
24 #include "components/filesystem/public/interfaces/file_system.mojom.h" 27 #include "components/filesystem/public/interfaces/file_system.mojom.h"
25 #include "components/filesystem/public/interfaces/types.mojom.h" 28 #include "components/filesystem/public/interfaces/types.mojom.h"
26 #include "components/prefs/base_prefs_export.h"
27 #include "components/prefs/persistent_pref_store.h"
28 #include "components/prefs/pref_filter.h"
29 #include "mojo/public/cpp/bindings/binding.h" 29 #include "mojo/public/cpp/bindings/binding.h"
30 30
31 class PrefFilter; 31 class PrefFilter;
32 32
33 namespace base { 33 namespace base {
34 class Clock; 34 class Clock;
35 class DictionaryValue; 35 class DictionaryValue;
36 class FilePath; 36 class FilePath;
37 class JsonPrefStoreLossyWriteTest; 37 class JsonPrefStoreLossyWriteTest;
38 class Value; 38 class Value;
39 } 39 }
40 40
41 namespace filesystem { 41 namespace filesystem {
42 42
43 // A forked, hack'n'slashed copy of base::JsonPrefStore which writes its 43 // A forked, hack'n'slashed copy of base::JsonPrefStore which writes its
44 // preference data to the mojo filesystem instead of the real 44 // preference data to the mojo filesystem instead of the real
45 // filesystem. Unlike base::JsonPrefStore, this class can safely be used inside 45 // filesystem. Unlike base::JsonPrefStore, this class can safely be used inside
46 // a sandboxed process. 46 // a sandboxed process.
47 // 47 //
48 // In the long run, we'll want to replace the current PrefService code with 48 // In the long run, we'll want to replace the current base::PrefService code
49 // something very different, especially since this component hard punts on all 49 // with something very different, especially since this component hard punts on
50 // the hard things that the preference service does (enterprise management, 50 // all the hard things that the preference service does (enterprise management,
51 // parental controls, extension integration, etc.) and its interface is really 51 // parental controls, extension integration, etc.) and its interface is really
52 // not optimal for a mojoified world--there are a few places where we assume 52 // not optimal for a mojoified world--there are a few places where we assume
53 // that writing to disk is synchronous...but it no longer is! 53 // that writing to disk is synchronous...but it no longer is!
54 // 54 //
55 // Removing this class is a part of crbug.com/580652. 55 // Removing this class is a part of crbug.com/580652.
56 class FilesystemJsonPrefStore 56 class FilesystemJsonPrefStore
57 : public PersistentPrefStore, 57 : public PersistentPrefStore,
58 public filesystem::FileSystemClient, 58 public filesystem::FileSystemClient,
59 public base::SupportsWeakPtr<FilesystemJsonPrefStore>, 59 public base::SupportsWeakPtr<FilesystemJsonPrefStore>,
60 public base::NonThreadSafe { 60 public base::NonThreadSafe {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 bool filtering_in_progress_; 168 bool filtering_in_progress_;
169 bool pending_lossy_write_; 169 bool pending_lossy_write_;
170 PrefReadError read_error_; 170 PrefReadError read_error_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(FilesystemJsonPrefStore); 172 DISALLOW_COPY_AND_ASSIGN(FilesystemJsonPrefStore);
173 }; 173 };
174 174
175 } // namespace filesystem 175 } // namespace filesystem
176 176
177 #endif // COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_ 177 #endif // COMPONENTS_FILESYSTEM_PUBLIC_CPP_PREFS_FILESYSTEM_JSON_PREF_STORE_H_
OLDNEW
« no previous file with comments | « components/filesystem/DEPS ('k') | components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698