Summary: | Replace DEPRECATED_DEFINE_STATIC_LOCAL by static NeverDestroyed<T> in loader | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sergio Villar Senin <svillar> | ||||||||
Component: | New Bugs | Assignee: | Sergio Villar Senin <svillar> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | ap, bfulgham, buildbot, commit-queue, darin, japhet, mjs, rniwa, simon.fraser, svillar | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 130185 | ||||||||||
Attachments: |
|
Description
Sergio Villar Senin
2014-03-28 05:14:28 PDT
Created attachment 228041 [details]
Patch
Comment on attachment 228041 [details] Patch Attachment 228041 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6330830213349376 New failing tests: compositing/columns/composited-rl-paginated-repaint.html Created attachment 228045 [details]
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-02 Port: mac-mountainlion Platform: Mac OS X 10.8.5
I just tried it on my Windows machine. If you use “friend class WTF::NeverDestroyed<blah blah>;” it should compile properly. Created attachment 228058 [details]
Patch (with win build fix)
Comment on attachment 228058 [details] Patch (with win build fix) View in context: https://bugs.webkit.org/attachment.cgi?id=228058&action=review > Source/WebCore/loader/cache/CachedRawResource.cpp:202 > static bool shouldIgnoreHeaderForCacheReuse(AtomicString headerName) I think const AtomicString& would be better for this argument. > Source/WebCore/loader/cache/CachedRawResource.cpp:215 > + static NeverDestroyed<HashSet<AtomicString>> m_headers; > + if (m_headers.get().isEmpty()) { > + m_headers.get().add("Accept"); > + m_headers.get().add("Cache-Control"); > + m_headers.get().add("Origin"); > + m_headers.get().add("Pragma"); > + m_headers.get().add("Purpose"); > + m_headers.get().add("Referer"); > + m_headers.get().add("User-Agent"); > } > - return m_headers.contains(headerName); > + return m_headers.get().contains(headerName); This is a bad idiom. For one thing, we don’t want to call isEmpty every time; this should be one-time initialization, not an empty check every time through. For another, calling add multiple times results in an unrolled loop. We should loop through an array instead. And generally speaking the setup should be in a separate function. Committed r166488: <http://trac.webkit.org/changeset/166488> |