Source/WebCore: Release FastMalloc thread caches on memory warning
https://bugs.webkit.org/show_bug.cgi?id=106471

Reviewed by Geoff Garen.
        
FastMalloc keeps some memory in per-thread caches (currently 2MB each). We currently flush these caches on memory warning 
for the main thread only. We should do it for other WebKit threads that use FastMalloc too.

Call WTF::releaseFastMallocFreeMemory in a bunch of WebCore support threads on memory warning. Unfortunately we don't have 
an uniform way of doing threads so this requires bunch of thread type specific code.
        
Looks to be ~1% progression in membuster3 final and maximum numbers.

* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::releaseMemory):
* storage/StorageTask.cpp:
(WebCore::StorageTask::performTask):
* storage/StorageTask.h:
(WebCore::StorageTask::createReleaseFastMallocFreeMemory):
* storage/StorageThread.cpp:
(WebCore::storageThreads):
(WebCore):
(WebCore::StorageThread::StorageThread):
(WebCore::StorageThread::~StorageThread):
(WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThread):
* storage/StorageThread.h:
(StorageThread):
* workers/WorkerThread.cpp:
(WebCore::threadSetMutex):
(WebCore::workerThreads):
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThread):
(WebCore):
* workers/WorkerThread.h:
(WorkerThread):

Source/WTF: Release FastMalloc thread caches on memory warning
https://bugs.webkit.org/show_bug.cgi?id=106471
        
Reviewed by Geoff Garen.

Use TCMalloc_ThreadCache::Cleanup() instead of calling Scavenge() twice. This releases all the memory
and looks nicer too.

* wtf/FastMalloc.cpp:
(WTF::releaseFastMallocFreeMemory):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Remove unnecessary tests from storage/indexeddb/key-type-array.html
https://bugs.webkit.org/show_bug.cgi?id=106472

Patch by Michael Pruett <michael@68k.org> on 2013-01-09
Reviewed by Tony Chang.

The tests which verify that JSON.stringify() throws an exception
for cyclic objects produce different error messages on JSC and
V8 and do nothing to test IndexedDB functionality. These tests
should be removed.

* storage/indexeddb/key-type-array-expected.txt:
* storage/indexeddb/resources/key-type-array.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add stub for CanvasProxy
https://bugs.webkit.org/show_bug.cgi?id=106275

Patch by Gregg Tavares <gman@google.com> on 2013-01-09
Reviewed by Dean Jackson.

No new tests as no new fuctionality exposed.

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/CanvasProxy.cpp: Added.
* html/canvas/CanvasProxy.h: Added.
* html/canvas/CanvasProxy.idl: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/forms/min-content-form-controls.html fails on some platforms
https://bugs.webkit.org/show_bug.cgi?id=106482

Reviewed by Eric Seidel.

The text dump for some form controls (menulists?) has different whitespace
output on different platforms. Remove the form controls to avoid adding
platform-specific expectations for this test.

* fast/forms/min-content-form-controls-expected.txt:
* fast/forms/min-content-form-controls.html:
* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change ARCHS to generic setting to work with multiple platforms.
https://bugs.webkit.org/show_bug.cgi?id=106478

Patch by David Farler <dfarler@apple.com> on 2013-01-09
Reviewed by Anders Carlsson.

* gtest/xcode/Config/General.xcconfig: ARCHS = $(ARCHS_STANDARD_32_64_BIT);

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r111439): Focus ring is rendered incorrectly in fast/inline/continuation-outlines-with-layers.html
https://bugs.webkit.org/show_bug.cgi?id=106064

Reviewed by David Hyatt.

Source/WebCore:

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):

LayoutTests:

* platform/chromium-linux/fast/inline/continuation-outlines-with-layers-expected.png:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkitpy cleanup: Merge additional_comment_text into comment_text
https://bugs.webkit.org/show_bug.cgi?id=106421

Reviewed by Adam Barth.

* Scripts/webkitpy/common/config/committervalidator.py:
(CommitterValidator.reject_patch_from_commit_queue):
(CommitterValidator.reject_patch_from_review_queue):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.set_flag_on_attachment):
* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzilla.set_flag_on_attachment):
* Scripts/webkitpy/tool/bot/feeders_unittest.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(AbstractEarlyWarningSystem._post_reject_message_on_bug):
* Scripts/webkitpy/tool/commands/queues_unittest.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Useless if statement check
https://bugs.webkit.org/show_bug.cgi?id=106113

Patch by Genevieve Mak <gmak@rim.com> on 2013-01-09
Reviewed by Yong Li.

Remove stray ! in if statement which was mistakenly left in during
refactoring. Since Injected events are checked before they are sent to
webkit, it didn't have an effect on behaviour.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::touchEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Rebaseline some accessibility test results on Win7 port.

* platform/win/accessibility/canvas-fallback-content-2-expected.txt:
* platform/win/platform/win/accessibility: Added.
* platform/win/platform/win/accessibility/option-element-selection-and-focus-events-expected.txt: Added.
* platform/win/platform/win/accessibility/select-element-valuechange-event-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Update some #includes in WebKit/chromium/public/ for new Platform directory
https://bugs.webkit.org/show_bug.cgi?id=106227

Reviewed by Darin Fisher.

Part of a larger refactoring series. See tracking bug 82948.

* public/WebAccessibilityObject.h:
* public/WebAccessibilityRole.h:
* public/WebActiveWheelFlingParameters.h:
* public/WebAnimationController.h:
* public/WebApplicationCacheHost.h:
* public/WebApplicationCacheHostClient.h:
* public/WebArrayBuffer.h:
* public/WebAudioSourceProvider.h:
* public/WebBatteryStatus.h:
* public/WebBindings.h:
* public/WebBlob.h:
* public/WebCache.h:
* public/WebCachedURLRequest.h:
* public/WebColorChooser.h:
* public/WebColorChooserClient.h:
* public/WebColorName.h:
* public/WebCommonWorkerClient.h:
* public/WebCompositionUnderline.h:
* public/WebCompositorInputHandler.h:
* public/WebConsoleMessage.h:
* public/WebContentDetectionResult.h:
* public/WebContextMenuData.h:
* public/WebCrossOriginPreflightResultCache.h:
* public/WebCursorInfo.h:
* public/WebDOMEvent.h:
* public/WebDOMEventListener.h:
* public/WebDOMStringList.h:
* public/WebDataSource.h:
* public/WebDatabase.h:
* public/WebDateTimeChooserCompletion.h:
* public/WebDateTimeChooserParams.h:
* public/WebDeliveredIntentClient.h:
* public/WebDevToolsAgent.h:
* public/WebDevToolsAgentClient.h:
* public/WebDevToolsFrontend.h:
* public/WebDeviceOrientationClient.h:
* public/WebDeviceOrientationClientMock.h:
* public/WebDeviceOrientationController.h:
* public/WebDocument.h:
* public/WebDraggableRegion.h:
* public/WebExternalPopupMenuClient.h:
* public/WebFileChooserCompletion.h:
* public/WebFileChooserParams.h:
* public/WebFileSystemCallbacks.h:
* public/WebFileSystemEntry.h:
* public/WebFileWriter.h:
* public/WebFileWriterClient.h:
* public/WebFindOptions.h:
* public/WebFont.h:
* public/WebFontCache.h:
* public/WebFontDescription.h:
* public/WebFormControlElement.h:
* public/WebFormElement.h:
* public/WebFrame.h:
* public/WebFrameClient.h:
* public/WebGeolocationClientMock.h:
* public/WebGeolocationController.h:
* public/WebGeolocationError.h:
* public/WebGeolocationPermissionRequest.h:
* public/WebGeolocationPermissionRequestManager.h:
* public/WebGeolocationPosition.h:
* public/WebGlyphCache.h:
* public/WebHelperPlugin.h:
* public/WebHistoryItem.h:
* public/WebHitTestResult.h:
* public/WebIDBCallbacks.h:
* public/WebIDBCursor.h:
* public/WebIDBDatabase.h:
* public/WebIDBDatabaseCallbacks.h:
* public/WebIDBDatabaseError.h:
* public/WebIDBFactory.h:
* public/WebIDBIndex.h:
* public/WebIDBKey.h:
* public/WebIDBKeyPath.h:
* public/WebIDBKeyRange.h:
* public/WebIDBMetadata.h:
* public/WebIDBObjectStore.h:
* public/WebIDBTransaction.h:
* public/WebIDBTransactionCallbacks.h:
* public/WebIconURL.h:
* public/WebImageDecoder.h:
* public/WebInputEvent.h:
* public/WebIntent.h:
* public/WebIntentRequest.h:
* public/WebIntentServiceInfo.h:
* public/WebMediaPlayer.h:
* public/WebMediaStreamRegistry.h:
* public/WebMenuItemInfo.h:
* public/WebNetworkStateNotifier.h:
* public/WebNode.h:
* public/WebNodeCollection.h:
* public/WebNodeList.h:
* public/WebNotification.h:
* public/WebNotificationPresenter.h:
* public/WebOptionElement.h:
* public/WebPageOverlay.h:
* public/WebPagePopup.h:
* public/WebPageSerializer.h:
* public/WebPasswordFormData.h:
* public/WebPerformance.h:
* public/WebPlugin.h:
* public/WebPluginContainer.h:
* public/WebPluginParams.h:
* public/WebPopupMenu.h:
* public/WebPopupMenuInfo.h:
* public/WebPrerendererClient.h:
* public/WebPrintParams.h:
* public/WebRange.h:
* public/WebRegularExpression.h:
* public/WebRuntimeFeatures.h:
* public/WebScopedMicrotaskSuppression.h:
* public/WebScopedUserGesture.h:
* public/WebScriptController.h:
* public/WebScriptSource.h:
* public/WebSearchableFormData.h:
* public/WebSecurityOrigin.h:
* public/WebSecurityPolicy.h:
* public/WebSelectElement.h:
* public/WebSettings.h:
* public/WebSharedWorker.h:
* public/WebSharedWorkerRepository.h:
* public/WebSpeechGrammar.h:
* public/WebSpeechInputController.h:
* public/WebSpeechInputResult.h:
* public/WebSpeechRecognitionHandle.h:
* public/WebSpeechRecognitionParams.h:
* public/WebSpeechRecognitionResult.h:
* public/WebSpeechRecognizer.h:
* public/WebSpeechRecognizerClient.h:
* public/WebSpellCheckClient.h:
* public/WebStorageEventDispatcher.h:
* public/WebSurroundingText.h:
* public/WebTestingSupport.h:
* public/WebTextCheckingCompletion.h:
* public/WebTextCheckingResult.h:
* public/WebTextFieldDecoratorClient.h:
* public/WebTextInputInfo.h:
* public/WebTextRun.h:
* public/WebTimeRange.h:
* public/WebTouchPoint.h:
* public/WebUserMediaRequest.h:
* public/WebView.h:
* public/WebViewBenchmarkSupport.h:
* public/WebViewClient.h:
* public/WebWidget.h:
* public/WebWidgetClient.h:
* public/WebWindowFeatures.h:
* public/WebWorkerInfo.h:


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion Failure in WebCore::RenderLayerCompositor::updateCompositingLayers
https://bugs.webkit.org/show_bug.cgi?id=106419

Reviewed by Simon Fraser.

Source/WebCore:

No new tests added, just un-skipped 3 existing tests.

RenderLayerCompositor::updateCompositingLayers is being called with a pending layout, so computing the
layers at that point would be useless & error-prone as they will be using incorrect layout values. If a layout is pending it means that
RenderLayerCompositor::updateCompositingLayers would get called again after the pending layout ends, so any values calculated at that point would be
overwritten immediately. This patch removes the old ASSERT and makes it a return instead.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):

LayoutTests:

Re-added skipped tests as this patch resolves the flakiness.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Assertion failure in SubresourceLoader::didFail when reloading
        https://bugs.webkit.org/show_bug.cgi?id=101416

        Reviewed by Nate Chapin.

        Test: http/tests/cache/network-error-during-revalidation.html

        * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFail): Handle revalidation.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] move dumpcreateview methods to testrunner library
https://bugs.webkit.org/show_bug.cgi?id=106434

Patch by Dan Carney <dcarney@google.com> on 2013-01-09
Reviewed by Adam Barth.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::reset):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner::WebTestRunner::shouldDumpCreateView):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::shouldDumpCreateView):
(WebTestRunner):
(WebTestRunner::TestRunner::dumpCreateView):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139231 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Tweak webaduio test expectations once more.

* platform/chromium/TestExpectations: Tweaked.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] inspector/geolocation-error.html is flaky in Win.
https://bugs.webkit.org/show_bug.cgi?id=106487

* platform/chromium/TestExpectations: Marked as flaky.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] move resource load callback dumping to TestRunner library
https://bugs.webkit.org/show_bug.cgi?id=106449

Reviewed by Adam Barth.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::reset):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebKit):
(WebTestRunner::WebTestDelegate::makeURLErrorDescription):
* DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h:
(WebKit):
(WebTestProxyBase):
(WebTestRunner::WebTestProxy::assignIdentifierToRequest):
(WebTestRunner::WebTestProxy::willRequestResource):
(WebTestRunner::WebTestProxy::willSendRequest):
(WebTestRunner::WebTestProxy::didReceiveResponse):
(WebTestRunner::WebTestProxy::didFinishResourceLoad):
(WebTestRunner::WebTestProxy::didFailResourceLoad):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner::WebTestRunner::shouldDumpResourceLoadCallbacks):
(WebTestRunner::WebTestRunner::shouldDumpResourceRequestCallbacks):
(WebTestRunner::WebTestRunner::shouldDumpResourceResponseMIMETypes):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner::TestRunner::TestRunner):
(WebTestRunner::TestRunner::reset):
(WebTestRunner::TestRunner::shouldDumpResourceLoadCallbacks):
(WebTestRunner::TestRunner::shouldDumpResourceRequestCallbacks):
(WebTestRunner::TestRunner::shouldDumpResourceResponseMIMETypes):
(WebTestRunner):
(WebTestRunner::TestRunner::dumpResourceLoadCallbacks):
(WebTestRunner::TestRunner::dumpResourceRequestCallbacks):
(WebTestRunner::TestRunner::dumpResourceResponseMIMETypes):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::reset):
(WebTestRunner):
(WebTestRunner::WebTestProxyBase::assignIdentifierToRequest):
(WebTestRunner::WebTestProxyBase::willRequestResource):
(WebTestRunner::WebTestProxyBase::willSendRequest):
(WebTestRunner::WebTestProxyBase::didReceiveResponse):
(WebTestRunner::WebTestProxyBase::didFinishResourceLoad):
(WebTestRunner::WebTestProxyBase::didFailResourceLoad):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::willSendRequest):
(WebViewHost::makeURLErrorDescription):
(WebViewHost::reset):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Land expectations for r139197.

* platform/chromium-linux/fast/regions/selecting-text-through-different-region-flows-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/regions/selecting-text-through-different-region-flows-expected.png: Added.
* platform/chromium-mac/fast/regions/selecting-text-through-different-region-flows-expected.png:
* platform/chromium-win/fast/regions/selecting-text-through-different-region-flows-expected.png: Added.
* platform/chromium-win/fast/regions/selecting-text-through-different-region-flows-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG-as-image: Throw out cached bitmap renderings after they sit unused for some time.
<http://webkit.org/b/106484>
<rdar://problem/12983216>

Reviewed by Antti Koivisto.

Add a one-shot timer to SVGImageCache to self-clear the bitmap cache 30 seconds after last access.
This prevents us from keeping huge ImageBuffers around in memory for the lifetime of the elements
referencing that particular SVG file. (The ownership model is actually a bit more complicated
but that's irrelevant to this issue.)

10234kB progression on Membuster3.

* svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::SVGImageCache):
(WebCore::SVGImageCache::~SVGImageCache):
(WebCore::SVGImageCache::clearBitmapCache):
(WebCore::SVGImageCache::cacheClearTimerFired):
(WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer):
* svg/graphics/SVGImageCache.h:
(SVGImageCache):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WebPreferences for Seamless IFrames on Windows port.
https://bugs.webkit.org/show_bug.cgi?id=106468.

Rubberstamped by Eric Seidel.

* Interfaces/IWebPreferences.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::areSeamlessIFramesEnabled):
(WebPreferences::setSeamlessIFramesEnabled):
* WebPreferences.h:
(WebPreferences):
* WebView.cpp:
(WebView::notifyPreferencesChanged):


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