Avoid touching AddressSorterWin::Job's ref count before it's fully constructed

AddressSorterWin::Job's reference count is zero at the beginning of its
constructor, and used to be incremented at base::Bind there implicitly.
However, if PostTaskAndReply there failed, the reference is gone and the
reference count gets to 0 again. And as the result, `new Job` may return
a stale pointer.

This CL adds a static constructor to , and moves the ref count manipulation
part out from the constructor, in order to avoid the unexpected destruction.

Bug: 866456
Change-Id: I1e735d6d0bf427988ba7380569628d4264c755f5
Reviewed-on: https://chromium-review.googlesource.com/1147898
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577767}
1 file changed