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

Issue 1937033002: Fix crash in CSSStyleSheetResource::appendData (Closed)

Created:
4 years, 7 months ago by Charlie Harrison
Modified:
4 years, 7 months ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, blink-reviews-style_chromium.org, gavinp+loader_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, hiroshige
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This patch removes the preloader resource client from a resources clients before it is completely destroyed. BUG=608310

Patch Set 1 #

Total comments: 4

Patch Set 2 : Remove client in destructor #

Total comments: 2

Patch Set 3 : Move CSSPreloaderResourceClient to the Oilpan heap, make it a ResourceOwner #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -14 lines) Patch
M third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp View 1 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h View 1 2 2 chunks +8 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp View 1 2 2 chunks +11 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h View 1 2 1 chunk +1 line, -1 line 2 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp View 1 2 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
Charlie Harrison
japhet, PTAL. I'm not sure if this is the cause of the crashes, but I ...
4 years, 7 months ago (2016-05-02 13:58:55 UTC) #3
Charlie Harrison
cc hiroshige@
4 years, 7 months ago (2016-05-02 13:59:33 UTC) #4
Nate Chapin
If the problem is either of the theories mentioned in the comments below, it should ...
4 years, 7 months ago (2016-05-02 19:00:43 UTC) #5
Charlie Harrison
Thanks for the comments. Now I'm not sure either of these options can happen. So, ...
4 years, 7 months ago (2016-05-02 19:27:56 UTC) #7
Charlie Harrison
Thanks for the comments. Now I'm not sure either of these options can happen. So, ...
4 years, 7 months ago (2016-05-02 19:27:58 UTC) #8
Charlie Harrison
As described in the bug, I've confirmed that this solution fixes the repro I triggered ...
4 years, 7 months ago (2016-05-03 18:22:23 UTC) #10
Nate Chapin
https://codereview.chromium.org/1937033002/diff/20001/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp File third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp (right): https://codereview.chromium.org/1937033002/diff/20001/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp#newcode255 third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp:255: stopObserving(); Alternately, you can have CSSPreloaderResourceClient inherit ResourceOwner<CSSStyleSheetResource>.
4 years, 7 months ago (2016-05-03 18:25:30 UTC) #11
Nate Chapin
4 years, 7 months ago (2016-05-03 18:25:31 UTC) #12
Charlie Harrison
I've converted the client to be a resource owner. I can only repro this with ...
4 years, 7 months ago (2016-05-03 20:32:11 UTC) #13
Nate Chapin
On 2016/05/03 20:32:11, csharrison wrote: > I've converted the client to be a resource owner. ...
4 years, 7 months ago (2016-05-03 20:52:02 UTC) #14
Nate Chapin
https://codereview.chromium.org/1937033002/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h File third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h (right): https://codereview.chromium.org/1937033002/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h#newcode54 third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h:54: HeapVector<Member<CSSPreloaderResourceClient>> m_cssPreloaders; Why not HeapHashSet?
4 years, 7 months ago (2016-05-03 20:52:13 UTC) #15
Charlie Harrison
4 years, 7 months ago (2016-05-04 13:26:36 UTC) #16
Going to close this, as I'm reverting the original patch. I'll merge this change
in with the original in a re-land and try to get some unit tests up.

https://codereview.chromium.org/1937033002/diff/40001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h (right):

https://codereview.chromium.org/1937033002/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h:54:
HeapVector<Member<CSSPreloaderResourceClient>> m_cssPreloaders;
On 2016/05/03 20:52:13, Nate Chapin wrote:
> Why not HeapHashSet?

I don't think it's necessary, so I just went with the simplest expandable data
structure available.

Powered by Google App Engine
This is Rietveld 408576698