Cherry pick: Cleanup comments, unit tests and unnecessary early out.

Clean cherry-pick of chromium:

https://crrev.com/947fb1c405943173d09e721efcde628dee896e36

BUG: 17369933
Original description:
Cleanup comments, unit tests and unnecessary early out.

Review URL: https://codereview.chromium.org/545663002
Change-Id: Ia3050dfe65b406b2677f9e10de43ac6665cf953d
Cr-Commit-Position: refs/heads/master@{#294206}
3 files changed