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

Issue 179873014: Move StyleSheetContents cache to StyleEngine. (Closed)

Created:
6 years, 10 months ago by tasak
Modified:
6 years, 9 months ago
Reviewers:
esprehn, dglazkov
CC:
adamk, blink-reviews, Inactive, dglazkov, eae, rwlbuis, sof
Visibility:
Public.

Description

Move StyleSheetContents cache to StyleEngine. Blink should not share StyleSheetContents cache between different WebFrames. If shares, WebFrameImpl::reload uses StyleSheetContents created by another WebFrameImpl. So when changing allowImage setting (controlled by chrome) and reloading some page, the reloaded frame might use StyleSheetContents cache. Since StyleImages are cached in CSSValues and are not managed by FrameLoader, allowImage change doesn't work. BUG=346264 TEST=fast/css/background-image-reload.html, fast/css/two-different-iframe-not-share-style-image.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169414

Patch Set 1 #

Patch Set 2 : clear per localFrame #

Patch Set 3 : per-LocalFrame StyleSheetContents cache #

Patch Set 4 : Move StyleSheetContents cache to StyleEngine #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : Rebased #

Total comments: 7

Patch Set 7 : Added activeClients to StyleSheetContents #

Patch Set 8 : Trace m_activeClients #

Total comments: 13

Patch Set 9 : Changed m_clients to have only active CSSStyleSheets #

Total comments: 2

Patch Set 10 : Fixed patch conflict and added layout test #

Patch Set 11 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -51 lines) Patch
A LayoutTests/fast/css/background-image-reload.html View 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/background-image-reload-expected.html View 1 chunk +24 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/resources/a/background-image.html View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/resources/a/box.png View 1 2 3 4 5 6 7 8 9 Binary file 0 comments Download
A LayoutTests/fast/css/resources/b/background-image.html View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
A + LayoutTests/fast/css/resources/b/box.png View 1 2 3 4 5 6 7 8 9 Binary file 0 comments Download
A LayoutTests/fast/css/two-different-iframe-not-share-style-image.html View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/two-different-iframe-not-share-style-image-expected.html View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/css/CSSStyleSheet.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/css/CSSStyleSheet.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -4 lines 0 comments Download
M Source/core/css/StyleSheetContents.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -1 line 0 comments Download
M Source/core/css/StyleSheetContents.cpp View 1 2 3 4 5 6 7 8 9 10 7 chunks +50 lines, -7 lines 0 comments Download
M Source/core/dom/StyleElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/StyleEngine.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -2 lines 0 comments Download
M Source/core/dom/StyleEngine.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -35 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
tasak
6 years, 10 months ago (2014-02-27 07:29:30 UTC) #1
esprehn
This isnt right, you're clearing the cache for all documents in the entire process. Reload ...
6 years, 10 months ago (2014-02-27 09:25:11 UTC) #2
tasak
Thank you for comments. On 2014/02/27 09:25:11, esprehn wrote: > This isnt right, you're clearing ...
6 years, 9 months ago (2014-02-28 02:45:31 UTC) #3
tasak
On 2014/02/28 02:45:31, tasak wrote: > (2) reload is executed in per-tab manner, i.e. resetting ...
6 years, 9 months ago (2014-02-28 05:21:07 UTC) #4
tasak
I chatted with shinyak@ and I found I missed the case where multiple tabs share ...
6 years, 9 months ago (2014-03-04 03:04:28 UTC) #5
tasak
Would you review this CL? The newest patch clears StyleContentsContents Cache only for a given ...
6 years, 9 months ago (2014-03-05 09:09:25 UTC) #6
esprehn
sure, I'll look today. To unsubscribe from this group and stop receiving emails from it, ...
6 years, 9 months ago (2014-03-05 09:58:08 UTC) #7
tasak
On 2014/03/05 09:58:08, esprehn wrote: > sure, I'll look today. > > To unsubscribe from ...
6 years, 9 months ago (2014-03-05 11:32:41 UTC) #8
tasak
I'm sorry. I found a mistake. I have to disable sharing StyleSheetContents between different frames. ...
6 years, 9 months ago (2014-03-05 13:06:58 UTC) #9
esprehn
Instead lets just move the cache to Document (or StyleEngine), that also lets us fix ...
6 years, 9 months ago (2014-03-06 06:52:39 UTC) #10
tasak
Thank you for reviewing. On 2014/03/06 06:52:39, esprehn wrote: > Instead lets just move the ...
6 years, 9 months ago (2014-03-06 07:35:38 UTC) #11
tasak
I have just uploaded the new patch: moving StyleSheetContents cache to StyleEngine.
6 years, 9 months ago (2014-03-06 12:33:19 UTC) #12
dglazkov
https://codereview.chromium.org/179873014/diff/70001/Source/core/css/CSSStyleSheet.h File Source/core/css/CSSStyleSheet.h (right): https://codereview.chromium.org/179873014/diff/70001/Source/core/css/CSSStyleSheet.h#newcode88 Source/core/css/CSSStyleSheet.h:88: Document* ownerDocument(bool force = false) const; EEek. A wild ...
6 years, 9 months ago (2014-03-06 18:43:59 UTC) #13
tasak
https://codereview.chromium.org/179873014/diff/70001/Source/core/css/CSSStyleSheet.h File Source/core/css/CSSStyleSheet.h (right): https://codereview.chromium.org/179873014/diff/70001/Source/core/css/CSSStyleSheet.h#newcode88 Source/core/css/CSSStyleSheet.h:88: Document* ownerDocument(bool force = false) const; On 2014/03/06 18:44:00, ...
6 years, 9 months ago (2014-03-07 08:08:28 UTC) #14
tasak
Would you review this CL? I moved StyleSheetContents cache to StyleEngine. So, - Made CSSStyleSheet ...
6 years, 9 months ago (2014-03-11 08:55:47 UTC) #15
dglazkov
Overall, I think you have the right approach going. I have quibbles about the tactics. ...
6 years, 9 months ago (2014-03-11 16:30:18 UTC) #16
tasak
Thank you for reviewing. I think, we should clear all m_ownerDocument in CSSStyleSheet when document ...
6 years, 9 months ago (2014-03-12 13:02:32 UTC) #17
tasak
https://codereview.chromium.org/179873014/diff/120001/Source/core/css/CSSStyleSheet.cpp File Source/core/css/CSSStyleSheet.cpp (right): https://codereview.chromium.org/179873014/diff/120001/Source/core/css/CSSStyleSheet.cpp#newcode400 Source/core/css/CSSStyleSheet.cpp:400: Document* CSSStyleSheet::ownerDocumentIgnoringDetached() const On 2014/03/12 13:02:33, tasak wrote: > ...
6 years, 9 months ago (2014-03-12 13:04:13 UTC) #18
dglazkov
lgtm with nits: https://codereview.chromium.org/179873014/diff/160001/Source/core/css/CSSStyleSheet.cpp File Source/core/css/CSSStyleSheet.cpp (right): https://codereview.chromium.org/179873014/diff/160001/Source/core/css/CSSStyleSheet.cpp#newcode134 Source/core/css/CSSStyleSheet.cpp:134: if (ownerNode) This all can be ...
6 years, 9 months ago (2014-03-13 16:51:59 UTC) #19
esprehn
https://codereview.chromium.org/179873014/diff/160001/Source/core/css/StyleSheetContents.cpp File Source/core/css/StyleSheetContents.cpp (right): https://codereview.chromium.org/179873014/diff/160001/Source/core/css/StyleSheetContents.cpp#newcode551 Source/core/css/StyleSheetContents.cpp:551: m_activeClients.add(sheet); This seems like it overlaps with what Mads ...
6 years, 9 months ago (2014-03-13 21:11:57 UTC) #20
tasak
Thank you for reviewing. https://codereview.chromium.org/179873014/diff/160001/Source/core/css/CSSStyleSheet.cpp File Source/core/css/CSSStyleSheet.cpp (right): https://codereview.chromium.org/179873014/diff/160001/Source/core/css/CSSStyleSheet.cpp#newcode134 Source/core/css/CSSStyleSheet.cpp:134: if (ownerNode) On 2014/03/13 16:52:00, ...
6 years, 9 months ago (2014-03-14 07:16:19 UTC) #21
dglazkov
lgtm++, esprehn what do you think? https://codereview.chromium.org/179873014/diff/180001/Source/core/css/StyleSheetContents.h File Source/core/css/StyleSheetContents.h (right): https://codereview.chromium.org/179873014/diff/180001/Source/core/css/StyleSheetContents.h#newcode143 Source/core/css/StyleSheetContents.h:143: bool hasOneClient() { ...
6 years, 9 months ago (2014-03-14 16:05:00 UTC) #22
esprehn
lgtm, at some point we need to simplify this system way down and get rid ...
6 years, 9 months ago (2014-03-14 17:05:17 UTC) #23
esprehn
I've been pondering this more, and there's a much bigger issue here that's not related ...
6 years, 9 months ago (2014-03-14 23:23:22 UTC) #24
tasak
Thank you for reviewing. I fixed patch conflict caused by loading/loadCompleted clients' patch. > Can ...
6 years, 9 months ago (2014-03-17 11:59:50 UTC) #25
tasak
The CQ bit was checked by tasak@google.com
6 years, 9 months ago (2014-03-18 02:53:10 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tasak@google.com/179873014/220001
6 years, 9 months ago (2014-03-18 03:17:26 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-18 04:02:47 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_rel
6 years, 9 months ago (2014-03-18 04:02:48 UTC) #29
esprehn
The CQ bit was checked by esprehn@chromium.org
6 years, 9 months ago (2014-03-18 04:46:37 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tasak@google.com/179873014/220001
6 years, 9 months ago (2014-03-18 04:46:43 UTC) #31
commit-bot: I haz the power
6 years, 9 months ago (2014-03-18 05:14:32 UTC) #32
Message was sent while issue was closed.
Change committed as 169414

Powered by Google App Engine
This is Rietveld 408576698