commit | e3e1ca1ea1f2dcd205ed89816eba5c01584ebbad | [log] [tgz] |
---|---|---|
author | tzik <tzik@chromium.org> | Tue Jul 31 09:26:55 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Jul 31 09:26:55 2018 |
tree | d4142e2da18913de6bc967873e01c80f06fc3751 | |
parent | c2a687a91c5174f4a76923f0b380ded4cdb32b0f [diff] |
Avoid touching ScopedFileOpener::Runner's ref count before it's fully constructed ScopedFileOpener::Runner is a ref counted object, and its first reference used to be made in its constructor through base::Bind. The reference is passed to ProvidedFileSystem::OpenFile, and released when the callback object is destroyed. However, if OpenFile failed, the reference is released before the Runner construction has done. Then `new Runner` returns a stale pointer, instead of newly created object. This CL adds a static consntructor and moves the implicit ref count manipulation out of the real constructor. Bug: 866456 Change-Id: I92d68b3383d8fecd900be080cc23551cddb5f12b Reviewed-on: https://chromium-review.googlesource.com/1156325 Reviewed-by: Tatsuhisa Yamaguchi <yamaguchi@chromium.org> Commit-Queue: Taiju Tsuiki <tzik@chromium.org> Cr-Commit-Position: refs/heads/master@{#579359}
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 .