MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / cache

Method cache

src/main/java/org/htmlunit/Cache.java:202–206  ·  view source on GitHub ↗

Caches the parsed version of the specified CSS snippet. We key the cache based on CSS snippets (rather than requests and responses as is done above) because a) this allows us to cache inline CSS, b) CSS is extremely expensive to parse, so we want to avoid it as much as possible, c) CSS files aren't

(final String css, final CSSStyleSheetImpl styleSheet)

Source from the content-addressed store, hash-verified

200 * @param styleSheet the parsed version of <code>css</code>
201 */
202 public void cache(final String css, final CSSStyleSheetImpl styleSheet) {
203 final Entry entry = new Entry(css, null, styleSheet);
204 entries_.put(entry.key_, entry);
205 deleteOverflow();
206 }
207
208 /**
209 * Truncates the cache to the maximal number of entries.

Callers 1

getSheetMethod · 0.95

Calls 2

deleteOverflowMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected