Commit 1104930d authored by jdonnelly's avatar jdonnelly Committed by Commit bot

Revert of Add a default task runner argument to the constructor of...

Revert of Add a default task runner argument to the constructor of JsonPrefStore. (patchset #3 id:40001 of https://codereview.chromium.org/2876643003/ )

Reason for revert:
Broke compile step on ChromiumOS x86-generic Compile:

https://uberchromegw.corp.google.com/i/chromium.chromiumos/builders/ChromiumOS%20x86-generic%20Compile/builds/35463

Original issue's description:
> Add a default task runner argument to the constructor of JsonPrefStore.
>
> Callers that don't need to run tasks on the same sequence as the
> JsonPrefStore will be able to use the default argument.
>
> BUG=667892
>
> Review-Url: https://codereview.chromium.org/2876643003
> Cr-Commit-Position: refs/heads/master@{#471428}
> Committed: https://chromium.googlesource.com/chromium/src/+/22f197b4c0399140f9cf118136a8c96b8ad8af9a

TBR=gab@chromium.org,fdoray@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=667892

Review-Url: https://codereview.chromium.org/2884473002
Cr-Commit-Position: refs/heads/master@{#471450}
parent be738df8
......@@ -143,13 +143,13 @@ scoped_refptr<base::SequencedTaskRunner> JsonPrefStore::GetTaskRunnerForFile(
JsonPrefStore::JsonPrefStore(
const base::FilePath& pref_filename,
scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
std::unique_ptr<PrefFilter> pref_filter)
: path_(pref_filename),
sequenced_task_runner_(std::move(sequenced_task_runner)),
sequenced_task_runner_(sequenced_task_runner),
prefs_(new base::DictionaryValue()),
read_only_(false),
writer_(pref_filename, sequenced_task_runner_),
writer_(pref_filename, sequenced_task_runner),
pref_filter_(std::move(pref_filter)),
initialized_(false),
filtering_in_progress_(false),
......
......@@ -19,7 +19,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/non_thread_safe.h"
#include "components/prefs/base_prefs_export.h"
#include "components/prefs/persistent_pref_store.h"
......@@ -63,18 +62,13 @@ class COMPONENTS_PREFS_EXPORT JsonPrefStore
const base::FilePath& pref_filename,
base::SequencedWorkerPool* worker_pool);
// |pref_filename| is the path to the file to read prefs from. It is incorrect
// to create multiple JsonPrefStore with the same |pref_filename|.
// |sequenced_task_runner| is used for asynchronous reads and writes. It must
// have the base::TaskShutdownBehavior::BLOCK_SHUTDOWN and base::MayBlock()
// traits. Unless external tasks need to run on the same sequence as
// JsonPrefStore tasks, keep the default value.
JsonPrefStore(const base::FilePath& pref_filename,
scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner =
base::CreateSequencedTaskRunnerWithTraits(
{base::MayBlock(),
base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
std::unique_ptr<PrefFilter> pref_filter = nullptr);
// |sequenced_task_runner| must be a shutdown-blocking task runner, ideally
// created by the GetTaskRunnerForFile() method above.
// |pref_filename| is the path to the file to read prefs from.
JsonPrefStore(
const base::FilePath& pref_filename,
const scoped_refptr<base::SequencedTaskRunner>& sequenced_task_runner,
std::unique_ptr<PrefFilter> pref_filter);
// PrefStore overrides:
bool GetValue(const std::string& key,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment