1 // Copyright 2017 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "components/prefs/persistent_pref_store.h" 6 #include "base/task/sequenced_task_runner.h" 7 8 #include <utility> 9 CommitPendingWrite(base::OnceClosure reply_callback,base::OnceClosure synchronous_done_callback)10void PersistentPrefStore::CommitPendingWrite( 11 base::OnceClosure reply_callback, 12 base::OnceClosure synchronous_done_callback) { 13 // Default behavior for PersistentPrefStore implementation that don't issue 14 // disk operations: schedule the callback immediately. 15 // |synchronous_done_callback| is allowed to be invoked synchronously (and 16 // must be here since we have no other way to post it which isn't the current 17 // sequence). 18 19 if (synchronous_done_callback) 20 std::move(synchronous_done_callback).Run(); 21 22 if (reply_callback) { 23 base::SequencedTaskRunner::GetCurrentDefault()->PostTask( 24 FROM_HERE, std::move(reply_callback)); 25 } 26 } 27 IsInMemoryPrefStore() const28bool PersistentPrefStore::IsInMemoryPrefStore() const { 29 return false; 30 } 31