persistent_pref_store.cc 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2017 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. #include "components/prefs/persistent_pref_store.h"
  5. #include <utility>
  6. #include "base/threading/sequenced_task_runner_handle.h"
  7. void PersistentPrefStore::CommitPendingWrite(
  8. base::OnceClosure reply_callback,
  9. base::OnceClosure synchronous_done_callback) {
  10. // Default behavior for PersistentPrefStore implementation that don't issue
  11. // disk operations: schedule the callback immediately.
  12. // |synchronous_done_callback| is allowed to be invoked synchronously (and
  13. // must be here since we have no other way to post it which isn't the current
  14. // sequence).
  15. if (synchronous_done_callback)
  16. std::move(synchronous_done_callback).Run();
  17. if (reply_callback) {
  18. base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE,
  19. std::move(reply_callback));
  20. }
  21. }
  22. bool PersistentPrefStore::IsInMemoryPrefStore() const {
  23. return false;
  24. }