It seems like these enums are almost equivalent, but not quite overlapping. Currently, ResourceRequestCachePolicy overloads ReloadIgnoringCacheData to mean both a typical reload (revalidate all cached items) and shift-reload (remove all items from cache and fetch everything again). If these were split out, CachePolicy would be a subset of ResourceRequestCachePolicy and could presumably be deleted. It would also allow us to remove the overloaded definition of a reload (see, e.g., http://trac.webkit.org/browser/trunk/WebCore/loader/FrameLoader.cpp?rev=69432#L1585).
Does this seem reasonable? Will post a patch soon.
Created attachment 70479 [details]
I tried to find all the places where ResourceRequestCachePolicy is used in the webkit repo and disambiguate between ReloadIgnoringCacheData and RevalidateCacheData, but I make no promises that I found al of them :)
> I make no promises that I found al of them :)
You can rename enum and the compiler will help you find them all.
I'm not sure if these should be the same. One policy is about what is being sent in requests over the wire, and another is how WebCore handles cached data that it has.
There is a lot of confusion because CFNetwork cache behaves like a remote caching proxy, so it's logically "over the wire", although it really isn't. But there's also WebCore cache, which can have different policies. It can also encode different WebCore responses to the same network responses (e.g. "just use stale data" vs. "use it, but warn the user" - there is no difference for ResourceRequest, but there is for WebCore).
Attachment 70479 [details] did not build on chromium:
Build output: http://queues.webkit.org/results/4353022
I agree with Alexey. CachePolicy (which should perhaps become CachedResource::CachePolicy) is about WebCore internal caching. Using ResourceRequestCachePolicy in this level seems wrong.
Comment on attachment 70479 [details]
Sounds like we shouldn't do this change.