Skip memcmp()ing fully downloaded resources after they become mmap()able.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 22:22:40 +0000 (22:22 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jun 2014 22:22:40 +0000 (22:22 +0000)
commitb8aae6ec6d1e3c55c80cdb9da12ebfd59dd7dab0
tree60a6709a7abc430dacf523907dd248cf2d8b2ed9
parent89533e1d84240230478862f007a5a538ee11a9ea
Skip memcmp()ing fully downloaded resources after they become mmap()able.
<https://webkit.org/b/134362>

When we receive word that a downloaded resource is now available for mmap()ing
from the file system, we don't need to compare against the buffered data,
since even if there were a mismatch, the cached version should be the canonical one.

This was added as belt-and-suspenders while the supporting mechanism was being
developed in CFNetwork, and there's no evidence of a race today. This change
turns the runtime checks into debug-only assertions.

Saves ~300ms of main thread time on PLT.

Reviewed by Geoff Garen.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::tryReplaceEncodedData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedResource.cpp