Commit minimal migration status to local state prefs

Commit minimal migration status to local state PrefService.
Introduces a CommitPendingWrite function with a callback to be sure that
prefs landed on disk.

BUG=747907

Change-Id: I565ffbae7b8a1e934875101012c39c8a9841a139
Reviewed-on: https://chromium-review.googlesource.com/647454
Reviewed-by: Xiyuan Xia <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Commit-Queue: Pavol Marko <[email protected]>
Cr-Commit-Position: refs/heads/master@{#499693}
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc
index a03daa04..fd1dea3b 100644
--- a/components/prefs/pref_service.cc
+++ b/components/prefs/pref_service.cc
@@ -104,8 +104,12 @@
 }
 
 void PrefService::CommitPendingWrite() {
+  CommitPendingWrite(base::OnceClosure());
+}
+
+void PrefService::CommitPendingWrite(base::OnceClosure done_callback) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  user_pref_store_->CommitPendingWrite();
+  user_pref_store_->CommitPendingWrite(std::move(done_callback));
 }
 
 void PrefService::SchedulePendingLossyWrites() {