Fix MQEvaluator::mediaType() related perf regressions.
When we stopped storing the mediaType as a string on m_medium on StyleResolver, we started calling FrameView::mediaType() every time that the mediaType as required. In the related bug's test case, mediaType() was being called a lot, in order to compare it to "print" to see which default style sheet should be used. Since mediaType() calls also call InspectorInstrumentation::applyEmulatedMedia(), they have a certain overhead, that impacted the benchmark's results. I've changed it so that the mediaType() call and the comparison to "print" would be done once, and the result cached. BUG=394275 Review URL: https://codereview.chromium.org/405953002 git-svn-id: svn://svn.chromium.org/blink/trunk@179991 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment