[Merge M61] Make profile directory creation always synchronous.
[Merge M61] Make ios browser state directory creation always synchronous.

This requires allowing IO on the main thread for two lightweight I/O
operations (PathExists + CreateDirectory). The tradeoff is worth it as
it ensures the directory is up before any of the asynchronous I/O from
every service starts touching their portion of the profile directory.
Sequencing all of these operations on the directory creation would be a
herculian task and isn't worth it.

NOPRESUBMIT=True (for intentional ScopedAllowIO usage)

Bug: 755157, 689520
Change-Id: I81498d20e91cae79ea3a1948b3d84d255adb6bd6
Reviewed-on: https://chromium-review.googlesource.com/613683
Reviewed-by: Anthony Vallee-Dubois <anthonyvd@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494517}
(cherry picked from commit 0b08bf2eaee22458d459ef824e644d4493b29c20)

TBR=anthonyvd@chromium.org, rch@chromium.org, sdefresne@chromium.org

(cherry picked from commit 1abda036eaee58bcb8aee1c2704b93b45a773ea8)

Change-Id: I856a31ce1e2fc930587e04e5b32c49b19161e155
Reviewed-on: https://chromium-review.googlesource.com/618087
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#495138}
Reviewed-on: https://chromium-review.googlesource.com/624455
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#707}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
3 files changed