commit | fbd27cfaeee3b95ac5d374310eb3639c8acae054 | [log] [tgz] |
---|---|---|
author | tzik <tzik@chromium.org> | Thu Jul 26 16:20:22 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jul 26 16:20:22 2018 |
tree | 32a9c458546e6fe0c508b4de6ff25d548a053b40 | |
parent | 2e968cc22f4733af3897c084c20d54a52d7586bb [diff] |
Avoid touching TimeZoneMonitor's ref count before it's fully constructed TimeZoneMonitorLinuxImpl is a ref counted type, and its first reference used to be made by base::Bind implicitly. The reference was passed to |file_task_runner_| and released on the task destruction. However, if the PostTask failed or the posted task ran soon before the ctor of TimeZoneMonitorLinuxImpl has finished, the instance is destroyed immediately, and `new TimeZoneMonitorLinuxImpl` returns a stale pointer. This CL adds a static constructor to move the problematic ref count manipulation out of the constructor. Bug: 866456 Change-Id: I5000cfa493cabe8858f20517328fe1d6e27795ff Reviewed-on: https://chromium-review.googlesource.com/1150959 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#578327}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .