CFNetwork cache partitioning does not work properly on subdomains
https://bugs.webkit.org/show_bug.cgi?id=111772

Reviewed by David Kilzer.

Source/WebCore:

Ensure that the cache partitioning is done over the top privately-controlled domain for the NSURLRequest.

Not possible to test with current automated test tools, must be tested manually.

* loader/cache/MemoryCache.cpp: Remove extraneous calls to partitionName
(WebCore):
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
(WebCore::MemoryCache::evict):
(WebCore::MemoryCache::removeResourcesWithOrigin):
* platform/network/cf/ResourceRequest.h: Put top privately-controlled domain reduction code into ResourceRequest::partitionName
(ResourceRequest):
(WebCore::ResourceRequest::cachePartition):
(WebCore::ResourceRequest::setCachePartition): Pre-process the partition name
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore):
(WebCore::ResourceRequest::partitionName):
* platform/network/mac/ResourceRequestMac.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): Use a UTF-8 version of the cache partition name

Source/WebKit2:

Ensure that the CFString is UTF-8 so that WKCFURLCacheCopyAllHostNamesInPersistentStoreForPartition will always work.

* WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
(WebKit::partitionName): Create a UTF-8 CFString explicitly

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WebCore::HTMLMediaElement::~HTMLMediaElement
https://bugs.webkit.org/show_bug.cgi?id=110623

Reviewed by Kentaro Hara.

Source/WebCore:

Test: http/tests/misc/delete-frame-during-readystatechange-with-gc-after-video-removal.html

* bindings/v8/V8GCController.cpp: Fix MinorGCWrapperVisitor so it doesn't collect ActiveDOMObjects
                                  that have pending activity.
* html/HTMLAudioElement.h:
(HTMLAudioElement): Removed hasPendingActivity() now that this is handled by the base class.
* html/HTMLAudioElement.idl: Removed ActiveDOMObject annotation since HTMLMediaElement now has it.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::hasPendingActivity): Update implementation to return true if the media
                                                 has audio and is playing. This brings the code into
                                                 compliance with the detached element behavior outlined
                                                 in the HTML5 spec.
* html/HTMLMediaElement.idl: Added ActiveDOMObject annotation so that all derived classes are
                             considered ActiveDOMObjects.

LayoutTests:

* http/tests/misc/delete-frame-during-readystatechange-with-gc-after-video-removal-expected.txt: Added.
* http/tests/misc/delete-frame-during-readystatechange-with-gc-after-video-removal.html: Added.
* http/tests/misc/resources/delete-frame-during-readystatechange-frame-with-gc-after-video-removal.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145162 268f45cc-cd09-0410-ab3c-d52691b4dbfc