DescriptionRemove the lifetime hack in ImageLoader where it keeps its assoc element alive
Instead of keeping Element alive by |ImageLoader::keep_alive_|, this
CL makes the Elements keep themselves alive by HasPendingActivity().
This makes ImageLoader NOT kept alive after the corresponding context
is destroyed, which is the general behavior of HasPendingActivity().
Previously, ImageLoader is forced to be kept alive until load/error
events are fired, because |keep_alive_| is not cleared, regardless of
whether the context is still valid or not.
This lifetime change fixes memory leaks in tests (Issue 327574 and
Issue 726091).
This CL is based on kouhei@'s CL:
https://codereview.chromium.org/2344563002/.
In addition to that, this CL also applies HasPendingActivity() changes
to Input, PlugIn/Embed/Object, and Media/Video elements because they
create ImageLoader and retain references to ImageLoader.
BUG=383741, 327574, 726091, 726414
Review-Url: https://codereview.chromium.org/2905233002
Cr-Commit-Position: refs/heads/master@{#475505}
Committed: https://chromium.googlesource.com/chromium/src/+/da1ebb6c4b424e74296c55b180055d1a98b73832
Patch Set 1 #Patch Set 2 : Input/Video/PlugIn #Patch Set 3 : Leak Expectation #
Total comments: 3
Patch Set 4 : Rebase #Depends on Patchset: Messages
Total messages: 33 (24 generated)
|