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

Issue 18328028: Enable MQ evaluation off the main thread (Closed)

Created:
7 years, 5 months ago by Yoav Weiss
Modified:
6 years, 9 months ago
CC:
blink-reviews, kenneth.christiansen, eae+blinkwatch, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@threaded_mqe_rebase
Visibility:
Public.

Description

This change came to simplify media query evaluation inside the PreloadScanner, and enable future resource preloading without going through the main thread. I've listed possible improvements to this code below, but I'd like to have it reviewed before I continue work on it. Major changes: * Added a MediaValues class that "freezes" the various media values needed for MQE when it is initialized * Removed use of AtomicString from MediaQueryExp, to make it thread-safe * Initialize MediaValues and provide them to the PreloadScanner during its initialization * Run MQE inside the PreloadScanner, according to provided MediaValues * Removed mediaAttribute passing to the HTMLResourcePreloader Possible improvements: * The added code in MediaQueryEvaluator.cpp can be DRYer. It also adds a lot of conditional statements that may be refactored out later on. * More tests can be added and especially MQ feature specific tests. (Only min/max-width are tested ATM) * Turning MediaQueryExp thread-safe was done by simply eliminating all AtomicString in favor of String. I'm not sure this is the proper way to do that, and if it creates performance implications. It may need refactoring.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+479 lines, -180 lines) Patch
M Source/core/css/CSSParser.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSParser-in.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/MediaQueryEvaluator.h View 4 chunks +64 lines, -0 lines 0 comments Download
M Source/core/css/MediaQueryEvaluator.cpp View 28 chunks +356 lines, -115 lines 0 comments Download
M Source/core/css/MediaQueryExp.h View 3 chunks +4 lines, -5 lines 0 comments Download
M Source/core/css/MediaQueryExp.cpp View 10 chunks +11 lines, -11 lines 1 comment Download
M Source/core/html/parser/HTMLDocumentParser.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLDocumentParser.cpp View 7 chunks +9 lines, -7 lines 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.h View 4 chunks +5 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLPreloadScanner.cpp View 8 chunks +25 lines, -10 lines 0 comments Download
M Source/core/html/parser/HTMLResourcePreloader.h View 3 chunks +2 lines, -9 lines 0 comments Download
M Source/core/html/parser/HTMLResourcePreloader.cpp View 3 chunks +0 lines, -18 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Yoav Weiss
Hi, I'd highly appreciate a review of this change, which enables MQ evaluation in the ...
7 years, 5 months ago (2013-07-05 18:26:40 UTC) #1
darktears
On 2013/07/05 18:26:40, Yoav Weiss wrote: > Hi, > > I'd highly appreciate a review ...
7 years, 5 months ago (2013-07-08 12:56:23 UTC) #2
abarth-chromium
https://codereview.chromium.org/18328028/diff/1/Source/core/css/MediaQueryExp.cpp File Source/core/css/MediaQueryExp.cpp (right): https://codereview.chromium.org/18328028/diff/1/Source/core/css/MediaQueryExp.cpp#newcode196 Source/core/css/MediaQueryExp.cpp:196: || m_mediaFeature == MediaFeatureNames::maxAspectRatioMediaFeature; not lgtm We use AtomicStrings ...
7 years, 5 months ago (2013-07-08 15:12:31 UTC) #3
Yoav Weiss
6 years, 9 months ago (2014-03-17 12:19:20 UTC) #4
Replacing this CL by https://codereview.chromium.org/201813002/
Closing.

Powered by Google App Engine
This is Rietveld 408576698