Chromium Code Reviews| Index: ios/web_view/internal/web_view_browser_state.mm |
| diff --git a/ios/web_view/internal/web_view_browser_state.mm b/ios/web_view/internal/web_view_browser_state.mm |
| index bdc2c63e4d2a4f207ed1973aa4990da2f327ce9a..90eb2ba7ff00938d1133d574b3c17914b55c55c0 100644 |
| --- a/ios/web_view/internal/web_view_browser_state.mm |
| +++ b/ios/web_view/internal/web_view_browser_state.mm |
| @@ -13,6 +13,7 @@ |
| #include "base/sequenced_task_runner.h" |
| #include "base/threading/thread_restrictions.h" |
| #include "components/pref_registry/pref_registry_syncable.h" |
| +#include "components/prefs/in_memory_pref_store.h" |
| #include "components/prefs/json_pref_store.h" |
| #include "components/prefs/pref_filter.h" |
| #include "components/prefs/pref_service_factory.h" |
| @@ -56,8 +57,13 @@ WebViewBrowserState::WebViewBrowserState(bool off_the_record) |
| JsonPrefStore::GetTaskRunnerForFile(path_, |
| web::WebThread::GetBlockingPool()); |
| - scoped_refptr<PersistentPrefStore> user_pref_store = new JsonPrefStore( |
| - path_.Append(kPreferencesFilename), sequenced_task_runner, nullptr); |
| + scoped_refptr<PersistentPrefStore> user_pref_store; |
| + if (off_the_record) { |
| + user_pref_store = new InMemoryPrefStore(); |
|
Eugene But (OOO till 7-30)
2017/07/10 16:17:43
nit: s/new/base::MakeUnique
jzw1
2017/07/10 18:51:40
Does this mean you want to use std::unique_ptrs in
Eugene But (OOO till 7-30)
2017/07/10 20:45:49
Sorry, did not notice that this is not std::unique
|
| + } else { |
| + user_pref_store = new JsonPrefStore(path_.Append(kPreferencesFilename), |
| + sequenced_task_runner, nullptr); |
| + } |
| PrefServiceFactory factory; |
| factory.set_user_prefs(user_pref_store); |