| Summary: | Measure cache size more accurately | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||
| Component: | Page Loading | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | cdumez | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Antti Koivisto
2015-02-08 16:59:00 PST
Created attachment 246253 [details]
patch
Comment on attachment 246253 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=246253&action=review r=me with comments > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:458 > + m_approximateSize += bodyOffset + bodySize; Why are we adding an offset to the size here? Maybe it is just a naming issue but it looks wrong. > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:554 > + static const double deletionProbability { 0.25 }; Maybe a ASSERT(RunLoop::isMain()); before this? > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:572 > + bool shouldDelete = randomNumber() < deletionProbability; Is it safe to call randomNumber() from another thread? The implementation seems to call sharedRandomNumberGenerator() which is a singleton.
> Is it safe to call randomNumber() from another thread? The implementation
> seems to call sharedRandomNumberGenerator() which is a singleton.
sharedRandomNumberGenerator() is ARC4RandomNumberGenerator which is thread safe (internal mutex).
|