And Alexey Proskuryakov  <ap@apple.com>

ASSERT(newestManifest) fails in WebCore::ApplicationCacheGroup::didFinishLoadingManifest()
https://bugs.webkit.org/show_bug.cgi?id=129753
<rdar://problem/12069835>

Reviewed by Alexey Proskuryakov.

Fixes an issue where an assertion failure would occur when visiting a web site whose on-disk
app cache doesn't contain a manifest resource.

For some reason an app cache for a web site may be partially written to disk. In particular, the
app cache may only contain a CacheGroups entry. That is, the manifest resource and origin records
may not be persisted to disk. From looking over the code, we're unclear how such a situation can occur
and hence have been unable to create such an app cache. We were able to reproduce this issue using
an app cache database file that was provided by a person that was affected by this issue.

No test included because it's not straightforward to write a test for this change.

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Assert that m_cacheBeingUpdated->manifestResource()
is non-null. Currently we only document this assumption in a code comment. Also separated a single assertion
expression into two assertion expressions to make it straightforward to identify the failing sub-expression
on failure.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::store): Modified to call ApplicationCacheStorage::deleteCacheGroupRecord()
to remove a cache group and associated cache records (if applicable) before inserting a cache group entry.
This replacement approach will ultimately repair incomplete app cache data for people affected by this bug.
(WebCore::ApplicationCacheStorage::loadCache): Log an error and return nullptr if the cache we loaded doesn't
have a manifest resource.
(WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): Added.
(WebCore::ApplicationCacheStorage::deleteCacheGroup): Extracted deletion logic for cache group record into
ApplicationCacheStorage::deleteCacheGroupRecord().
* loader/appcache/ApplicationCacheStorage.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=129722

And remember to copy the header file!

* WebKitSystemInterface.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Use WKSI to see what the system policy for WebGL is
https://bugs.webkit.org/show_bug.cgi?id=129722
<rdar://problem/15790542>

Reviewed by Tim Horton.

Source/WebKit2:

Use the WebKitSystemInterface methods WKShouldBlockWebGL
and WKShouldSuggestBlockingWebGL to query what the host
system thinks about the hardware. Tell the client about
the result in a new WebPage method setSystemWebGLPolicy.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::setSystemWebGLLoadPolicy): New empty definition.
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI): Convert a WebGLLoadPolicy into a WKWebGLLoadPolicy.
* UIProcess/API/C/WKPage.cpp: Call setSystemWebGLLoadPolicy.
(WKPageSetPageLoaderClient):
* UIProcess/API/C/WKPageLoaderClient.h: New typedef and entry in client structure.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setSystemWebGLPolicy):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Add SetSystemWebGLPolicy.
* Source/WebKit2/Configurations/WebKit2.xcconfig: We have to link against OpenGL now, because WKSI
uses it for hardware detection.
* WebProcess/WebPage/WebPage.cpp: Remove the implementation here, but leave
empty methods for non-Apple platforms.
(WebKit::WebPage::WebPage):
(WebKit::WebPage::webGLPolicyForURL):
(WebKit::WebPage::resolveWebGLPolicyForURL):
* WebProcess/WebPage/WebPage.h: Add m_systemWebGLPolicy.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::webGLPolicyForURL): Moved in from WebPage, but now they call
into WKSI and send the result to the client if necessary.
(WebKit::WebPage::resolveWebGLPolicyForURL):

Tools:

Dummy entry for setSystemWebGLLoadPolicy.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Use thin archives if building on Linux for non-shared-core debug builds
https://bugs.webkit.org/show_bug.cgi?id=108330

Reviewed by Martin Robinson.

In order to get non-shared debug builds, this patch applied T option for
thin archives to the flags passed to ar when cmake based ports build on linux.
In addition, applied u option which avoids adding a file twice.

* Source/cmake/OptionsCommon.cmake: Moved archive options from OptionsGTK.cmake.
* Source/cmake/OptionsEfl.cmake:
Removed error messages for non-shared-core debug builds.
* Source/cmake/OptionsGTK.cmake: Moved archive options to OptionsCommon.cmake.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=129722
Update WKSI, again, to fix the build.

* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMavericks.a:
* libWebKitSystemInterfaceMountainLion.a:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=128625
Add fast mapping from StringImpl to JSString

Unreviewed roll-out.

Reverting r164347, r165054, r165066 - not clear the performance tradeoff was right.

* runtime/JSString.cpp:
* runtime/JSString.h:
* runtime/VM.cpp:
(JSC::VM::createLeaked):
* runtime/VM.h:

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=128625
Add fast mapping from StringImpl to JSString

Unreviewed roll-out.

Reverting r164347, r165054, r165066 - not clear the performance tradeoff was right.

* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
* bindings/js/JSDOMBinding.h:
(WebCore::jsStringWithCache):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* bindings/scripts/StaticString.pm:
(GenerateStrings):

Source/WTF: [Win32][LLINT] Crash when running JSC stress tests.
https://bugs.webkit.org/show_bug.cgi?id=129429

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-03-05
Reviewed by Geoffrey Garen.

* wtf/Platform.h: Enable LLINT on Win32.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when copying content that contains <sup>.
https://bugs.webkit.org/show_bug.cgi?id=129765
<rdar://problem/16139498>
        
Reviewed by Benjamin Poulain.

Adding static definition of NSAttributeSuperscriptName.

* platform/mac/HTMLConverter.mm:



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

* platform/mac/HTMLConverter.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix, take 2.

* platform/mac/HTMLConverter.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL build fix attempt after r165141.

* ftl/FTLCompile.cpp:
(JSC::FTL::fixFunctionBasedOnStackMaps):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another build fix attempt after r165141.

* ftl/FTLCompile.cpp:
(JSC::FTL::fixFunctionBasedOnStackMaps):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Support IOS Accessibility in WK2
https://bugs.webkit.org/show_bug.cgi?id=129527

Address review comments from Simon noted in bug.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
(-[WKAccessibilityWebPageObject init]):
(-[WKAccessibilityWebPageObject dealloc]):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.h:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilitySetValue:forAttribute:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Crash in SourceBuffer::sourceBufferPrivateDidReceiveSample() - received samples after SourceBuffer was removed.
https://bugs.webkit.org/show_bug.cgi?id=129761

Reviewed by Eric Carlson.

Guard against the possibility that SourceBufferPrivates will continue to generate samples even after
a parse error. Bail out early from sourceBufferPrivateDidReceiveInitializationSegment and
sourceBufferPrivateDidReceiveSample if the SourceBuffer has been removed.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update my email in contributors.json

* Scripts/webkitpy/common/config/contributors.json:

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