Improve profile stats performace.

Collecting stats on prefs can take a lot of allocations and times to copy the whole preferences tree.

Adds an iterator-with-callback API to read the preferences without copying. This is now used in prefs stats. The other two similar APIs in the preferences service have been coalesced with a flag controlling whether you want default prefs.

BUG=708793

Review-Url: https://codereview.chromium.org/2799143002
Cr-Commit-Position: refs/heads/master@{#465374}
9 files changed