Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Issue 2905233002: Remove the lifetime hack in ImageLoader where it keeps its assoc element alive (Closed)

Created:
3 years, 7 months ago by hiroshige
Modified:
3 years, 6 months ago
CC:
chromium-reviews, krit, rwlbuis, fs, fmalita+watch_chromium.org, blink-reviews, gyuyoung2, Stephen Chennney, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -85 lines) Patch
M third_party/WebKit/LayoutTests/LeakExpectations View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLEmbedElement.idl View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.h View 1 2 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLInputElement.idl View 1 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMediaElement.h View 1 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLObjectElement.idl View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLPlugInElement.h View 1 2 chunks +8 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.h View 1 3 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 1 3 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.idl View 1 3 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.h View 4 chunks +0 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/loader/ImageLoader.cpp View 8 chunks +0 lines, -64 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGImageElement.h View 2 chunks +10 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGImageElement.idl View 1 chunk +3 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 33 (24 generated)
kouhei (in TOK)
https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h File third_party/WebKit/Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h#newcode343 third_party/WebKit/Source/core/html/HTMLMediaElement.h:343: virtual bool HasPendingActivityInternal() const { return false; } Why ...
3 years, 6 months ago (2017-05-29 05:27:34 UTC) #15
hiroshige
PTAL. https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h File third_party/WebKit/Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h#newcode343 third_party/WebKit/Source/core/html/HTMLMediaElement.h:343: virtual bool HasPendingActivityInternal() const { return false; } ...
3 years, 6 months ago (2017-05-29 10:37:00 UTC) #17
yhirano
lgtm
3 years, 6 months ago (2017-05-30 01:36:45 UTC) #22
kinuko
This looks a lot nicer!
3 years, 6 months ago (2017-05-30 02:06:59 UTC) #23
hiroshige
https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h File third_party/WebKit/Source/core/html/HTMLMediaElement.h (right): https://codereview.chromium.org/2905233002/diff/40001/third_party/WebKit/Source/core/html/HTMLMediaElement.h#newcode343 third_party/WebKit/Source/core/html/HTMLMediaElement.h:343: virtual bool HasPendingActivityInternal() const { return false; } On ...
3 years, 6 months ago (2017-05-30 08:57:06 UTC) #24
kouhei (in TOK)
lgtm thanks!
3 years, 6 months ago (2017-05-30 08:58:03 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2905233002/60001
3 years, 6 months ago (2017-05-30 09:53:15 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2905233002/60001
3 years, 6 months ago (2017-05-30 12:49:12 UTC) #30
commit-bot: I haz the power
3 years, 6 months ago (2017-05-30 12:53:45 UTC) #33
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/da1ebb6c4b424e74296c55b18005...

Powered by Google App Engine
This is Rietveld 408576698