[Qt] Implement IncrementalSweeper and HeapTimer
https://bugs.webkit.org/show_bug.cgi?id=103996

Reviewed by Simon Hausmann.

Implements the incremental sweeping garbage collection for the Qt platform.

* heap/HeapTimer.cpp:
(JSC::HeapTimer::HeapTimer):
(JSC::HeapTimer::~HeapTimer):
(JSC::HeapTimer::timerEvent):
(JSC::HeapTimer::synchronize):
(JSC::HeapTimer::invalidate):
(JSC::HeapTimer::didStartVMShutdown):
* heap/HeapTimer.h:
(HeapTimer):
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::IncrementalSweeper):
(JSC::IncrementalSweeper::scheduleTimer):
* heap/IncrementalSweeper.h:
(IncrementalSweeper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IDBFactory::webkitGetDatabaseNames should raise DOMExceptions.
https://bugs.webkit.org/show_bug.cgi?id=108154

Reviewed by Jochen Eisinger.

In order to properly support blocking third-party IndexedDB usage,
open(), getDatabaseNames(), and deleteDatabase() should all throw
SECURITY_ERR when used in a blocked third-party context. That's possible
now for open() and deleteDatabase(), but getDatabaseNames() can't
currently raise exceptions.

This patch adjusts the IDL file and implementation. No exceptions are
currently thrown, but that will change as soon as wkbug.com/94171 lands.

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::getDatabaseNames):
* Modules/indexeddb/IDBFactory.h:
(IDBFactory):
* Modules/indexeddb/IDBFactory.idl:
    Add "raises (DOMException)" to getDatabaseNames, and adjust the
    implementation to match.
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNamesForFrame):
    Pass in an ExceptionCode when calling getDatabaseNames, and handle
    possible exceptions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Regression] Search across all sources is broken.
https://bugs.webkit.org/show_bug.cgi?id=108157

Reviewed by Pavel Feldman.

Source/WebCore:

Test: http/tests/inspector/search/scripts-search-scope.html

* inspector/front-end/ScriptsSearchScope.js:
(WebInspector.ScriptsSearchScope.prototype._sortedUISourceCodes):

LayoutTests:

* http/tests/inspector/search/scripts-search-scope-expected.txt: Added.
* http/tests/inspector/search/scripts-search-scope.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Remove misspelled ENABLE(SPEECH_INPUT) guard
https://bugs.webkit.org/show_bug.cgi?id=105683

Patch by Laszlo Gombos <l.gombos@samsung.com> on 2013-01-29
Reviewed by Simon Hausmann.

The ENABLE(SPEECH_INPUT) guard is only used in one location
in the source tree and as such it is always 0.

I believe that this guard is a left over and is not needed any more
as the code guarded is not guarded anywhere else.

* WebProcess/qt/WebProcessQt.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: ChildrenAffectedBy flags lost between siblings which have child elements sharing style
https://bugs.webkit.org/show_bug.cgi?id=105672

Reviewed by Andreas Kling.

Source/WebCore:

Change in how childrenAffectedBy bits were stored made it easier to trigger an issue where childrenAffectedBy bits
were not set due to sharing of styles between cousin elements.

This patch fixes the issue by not sharing styles from children with parents who prevent sharing.

Tests: fast/selectors/cousin-stylesharing-adjacent-selector.html
       fast/selectors/cousin-stylesharing-last-child-selector.html

* css/StyleResolver.cpp:
(WebCore::parentElementPreventsSharing):
(WebCore::StyleResolver::locateCousinList):
* dom/Element.cpp:
(WebCore::Element::hasFlagsSetDuringStylingOfChildren):
* dom/Element.h:
(Element):

LayoutTests:

Two test cases by Philippe Wittenbergh that triggers the issue.

* fast/selectors/cousin-stylesharing-adjacent-selector-expected.html: Added.
* fast/selectors/cousin-stylesharing-adjacent-selector.html: Added.
* fast/selectors/cousin-stylesharing-last-child-selector-expected.html: Added.
* fast/selectors/cousin-stylesharing-last-child-selector.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [CPU Profile] Taking profile crashes renderer.
https://bugs.webkit.org/show_bug.cgi?id=108072

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2013-01-29
Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: inspector/profiler/cpu-profiler-agent-crash-on-start.html

Fixed null-pointer access.

* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::start): Fixed null-pointer access.
(WebCore::ScriptProfiler::stop): Ditto.

LayoutTests:

Added test to check that ProfilerAgent start/stop doesn't crash.

* inspector/profiler/cpu-profiler-agent-crash-on-start-expected.txt: Added.
* inspector/profiler/cpu-profiler-agent-crash-on-start.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, updated my email information.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Implement resources API using injected bundle
https://bugs.webkit.org/show_bug.cgi?id=107457

Reviewed by Sam Weinig.

Source/WebKit2:

The ResourceLoaderClient was removed from the UI process in
r140285, and most of the GTK+ API depends on resources. This patch
implements the same API using the ResourceLoaderClient from
injected bundle. It fixes the resources unit tests, as well as
other 14 unit tests that are timing out because they depend on
resource API.

* GNUmakefile.list.am: Add new files to compilation.
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode): Add support for encoding
WebURLResponse and WebError objects in user messages.
(WebKit::UserMessageDecoder::baseDecode): Add support for decoding
WebURLResponse and WebError objects from user messages.
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp: Added.
(didReceiveWebViewMessageFromInjectedBundle): Handle messages sent
to the WebView. For now it hanldes all the sresource loader client
messages.
(didReceiveMessageFromInjectedBundle): Handle messages received
from injected bundle.
(attachInjectedBundleClientToContext): Initialize the injected
bundle client.
* UIProcess/API/gtk/WebKitInjectedBundleClient.h: Added.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(_WebKitWebContextPrivate): Add a HashMap to map page IDs to
WebKitWebViews.
(createDefaultWebContext): Call
attachInjectedBundleClientToContext() to intialize the injected
bundle client.
(webkitWebContextCreatePageForWebView): Use
webkitWebViewBaseCreateWebPage() to create and initialize a new
WebPageProxy and map the newly created page with the given
WebKitWebView.
(webkitWebContextWebViewDestroyed): Called when the given
WebKitWebView is being destroyed to remove it from the views map.
(webkitWebContextGetWebViewForPage): Returns the WebKitWebView
associated to the given page ID.
* UIProcess/API/gtk/WebKitWebContextPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Use
webkitWebContextCreatePageForWebView() instead of
webkitWebViewBaseCreateWebPage() directly.
(webkitWebViewDispose): Call webkitWebContextWebViewDestroyed() to
notify the context.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(didInitiateLoadForResource): Send a message to the UI process
with the callback parameters encoded.
(willSendRequestForFrame): Ditto.
(didReceiveResponseForResource): Ditto.
(didReceiveContentLengthForResource): Ditto.
(didFinishLoadForResource): Ditto.
(didFailLoadForResource): Ditto.
(webkitWebPageCreate): Initialize the
WKBundlePageResourceLoadClient.

Tools:

* Scripts/run-gtk-tests:
(TestRunner): Unksip resources unit tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix the JSC build on Mac

Unreviewed, build fix.

* heap/HeapTimer.h:
Qt on Mac has USE(CF) true, and should use the CF HeapTimer in that case.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Canvas] support instrumenting canvases in iframes (backend side)
https://bugs.webkit.org/show_bug.cgi?id=107951

Reviewed by Pavel Feldman.

Source/WebCore:

Accept optional FrameId argument for captureFrame and startCapturing commands.
Add event to the protocol to inform about instrumented canvas context creation.

* inspector/Inspector.json:
* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::hasUninstrumentedCanvases):
(WebCore::InspectorCanvasAgent::captureFrame):
(WebCore::InspectorCanvasAgent::startCapturing):
(WebCore::InspectorCanvasAgent::getTraceLog):
(WebCore::InspectorCanvasAgent::replayTraceLog):
(WebCore::InspectorCanvasAgent::getResourceInfo):
(WebCore::InspectorCanvasAgent::getResourceState):
(WebCore::InspectorCanvasAgent::wrapCanvas2DRenderingContextForInstrumentation):
(WebCore::InspectorCanvasAgent::wrapWebGLRenderingContextForInstrumentation):
(WebCore::InspectorCanvasAgent::notifyRenderingContextWasWrapped):
(WebCore):
(WebCore::InspectorCanvasAgent::findFramesWithUninstrumentedCanvases):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::frameDetached):
* inspector/InspectorCanvasAgent.h:
(WebCore):
(WebCore::InspectorCanvasAgent::create):
(InspectorCanvasAgent):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):

LayoutTests:

Stub Canvas dispatcher for now to silence alerts in tests.

* inspector/profiler/canvas-profiler-test.js:
(initialize_CanvasWebGLProfilerTest.InspectorTest.enableCanvasAgent.InspectorBackend.registerCanvasDispatcher):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Compilation warning in JSC
https://bugs.webkit.org/show_bug.cgi?id=108178

Reviewed by Kentaro Hara.

Fixed 'comparison between signed and unsigned integer' warning in JSC::Structure constructor.

* runtime/Structure.cpp:
(JSC::Structure::Structure):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: in inspector-protocol tests do not swallow errors
https://bugs.webkit.org/show_bug.cgi?id=108087

Patch by Peter Rybin <peter.rybin@gmail.com> on 2013-01-29
Reviewed by Pavel Feldman.
Additional checks are added. Debuggee is more aggressive at
when to kill the test.

* http/tests/inspector-protocol/resources/InspectorTest.js:
* http/tests/inspector-protocol/resources/protocol-test.js:
(runTest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening.

* platform/qt/TestExpectations: Skip failing tests. https://bugs.webkit.org/show_bug.cgi?id=108175.
* platform/qt/compositing/overflow/composited-scrolling-creates-a-stacking-container-expected.txt: Added after r140999.
* platform/qt/fast/js/regress/integer-modulo-expected.txt: Added after r141031.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add API to prefetch DNS of a given hostname to WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=99695

Reviewed by Anders Carlsson.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_prefetch_dns): Public method to resolve the
domain name in advance for the given hostname.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add
webkit_web_context_prefetch_dns.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
(webkitWebExtensionDidReceiveMessage): Parse PrefetchDNS message
and call WebCore::prefetchDNS() with the given hostname.
(didReceiveMessage): Call webkitWebExtensionDidReceiveMessage().
(webkitWebExtensionCreate): Add implementation for
didReceiveMessage callback.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed gardening.

Skipping tests broken by r141051.

* platform/efl-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Update generic expected file after r141031.
Remove Chromium, GTK and Qt specific expected files, because they are the same as the  generic expected file.

* fast/js/regress/integer-modulo-expected.txt:
* platform/chromium/fast/js/regress/integer-modulo-expected.txt: Removed after r141044.
* platform/gtk/fast/js/regress/integer-modulo-expected.txt: Removed after r141084.
* platform/qt/fast/js/regress/integer-modulo-expected.txt: Removed after r141101.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening.

Update bindings-tests results after http://trac.webkit.org/changeset/141034.

* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8Float64Array::createWrapper):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestActiveDOMObject::createWrapper):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestCustomNamedGetter::createWrapper):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestEventConstructor::createWrapper):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestEventTarget::createWrapper):
* bindings/scripts/test/V8/V8TestException.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestException::createWrapper):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestInterface::createWrapper):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestMediaQueryListListener::createWrapper):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestNamedConstructor::createWrapper):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestNode::createWrapper):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestObj::createWrapper):
* bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestOverloadedConstructors::createWrapper):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore):
(WebCore::checkTypeOrDieTrying):
(WebCore::V8TestSerializedScriptValueInterface::createWrapper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening.

Patch by Zoltan Arvai <zarvai@inf.u-szeged.hu> on 2013-01-29

* platform/qt-5.0-wk2/TestExpectations: Skip broken plugin tests after r141051.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK1] Fix QObject Bridge tests expected output.
https://bugs.webkit.org/show_bug.cgi?id=107827

Reviewed by Simon Hausmann.

The "not a function" TypeError now includes the call that caused the error.
Correct expected values accordingly.

* tests/qobjectbridge/tst_qobjectbridge.cpp:
(tst_QObjectBridge::connectAndDisconnect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable Workers for WinCE
https://bugs.webkit.org/show_bug.cgi?id=108099

Patch by Laszlo Gombos <l.gombos@samsung.com> on 2013-01-29
Reviewed by Gyuyoung Kim.

WORKERS are enabled for all CMake based ports except WinCE.
Turn on WORKERS for all CMake based ports.

* Source/cmake/OptionsBlackBerry.cmake:
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/WebKitFeatures.cmake:

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