OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/prefs/json_pref_store.h" | 5 #include "base/prefs/json_pref_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/json/json_file_value_serializer.h" | 12 #include "base/json/json_file_value_serializer.h" |
13 #include "base/json/json_string_value_serializer.h" | 13 #include "base/json/json_string_value_serializer.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/message_loop_proxy.h" | 15 #include "base/message_loop_proxy.h" |
16 #include "base/sequenced_task_runner.h" | 16 #include "base/task/sequenced_task_runner.h" |
17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // Some extensions we'll tack on to copies of the Preferences files. | 22 // Some extensions we'll tack on to copies of the Preferences files. |
23 const base::FilePath::CharType* kBadExtension = FILE_PATH_LITERAL("bad"); | 23 const base::FilePath::CharType* kBadExtension = FILE_PATH_LITERAL("bad"); |
24 | 24 |
25 // Differentiates file loading between origin thread and passed | 25 // Differentiates file loading between origin thread and passed |
26 // (aka file) thread. | 26 // (aka file) thread. |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 copy->Set(key, new base::ListValue); | 348 copy->Set(key, new base::ListValue); |
349 } else if (value->IsType(base::Value::TYPE_DICTIONARY)) { | 349 } else if (value->IsType(base::Value::TYPE_DICTIONARY)) { |
350 const base::DictionaryValue* dict = NULL; | 350 const base::DictionaryValue* dict = NULL; |
351 if (value->GetAsDictionary(&dict) && dict->empty()) | 351 if (value->GetAsDictionary(&dict) && dict->empty()) |
352 copy->Set(key, new base::DictionaryValue); | 352 copy->Set(key, new base::DictionaryValue); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 return serializer.Serialize(*(copy.get())); | 356 return serializer.Serialize(*(copy.get())); |
357 } | 357 } |
OLD | NEW |