[BlackBerry] Prevent window.close() from closing pages that are not opened by JS
https://bugs.webkit.org/show_bug.cgi?id=98190

Reviewed by Antonio Gomes.

RIM PR# 217812.
Only pages opened by JS can be closed by JS.

* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::closeWindowSoon):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some more flaky tests.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
isMainThread() should only be called by NoEventDispatchAssertion in debug builds
https://bugs.webkit.org/show_bug.cgi?id=98191

This fixes a performance regression and matches the original code from
before the refactor in http://trac.webkit.org/changeset/130077.

* dom/ContainerNode.h:
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to simplify IPC message dispatching logic in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=98097

Reviewed by Sam Weinig.

Move the Connection::MessageReceiver class to its own header file. Add a MessageReceiverMap helper class
that will be used for dispatching messages based on message class (and eventually destination ID).

Convert AuthenticationManager and WebGeolocationManager over to this new mechanism.

* CMakeLists.txt:
* GNUmakefile.list.am:
Add new files.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::dispatchMessage):
Check with the message receiver map first before calling Connection::Client::didReceiveMessage.

* Platform/CoreIPC/Connection.h:
(CoreIPC::Connection::addMessageReceiver):
Call through to the message receiver map.

* Platform/CoreIPC/MessageID.h:
(CoreIPC::MessageID::messageClass):
Rename MessageClassReserved to MessageClassInvalid.

(MessageID):
* Platform/CoreIPC/MessageReceiver.h:
Move MessageReceiver from Connection.h to its own file.

* Platform/CoreIPC/MessageReceiverMap.cpp:
New helper class.

(CoreIPC::MessageReceiverMap::addMessageReceiver):
Add the receiver to the map of receivers.

(CoreIPC::MessageReceiverMap::dispatchMessage):
Check if we have any registered receivers for this message class.

* Platform/CoreIPC/MessageReceiverMap.h:
New file.

* Target.pri:
Add new files.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

* WebProcess/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::AuthenticationManager):
* WebProcess/Authentication/AuthenticationManager.h:
(AuthenticationManager):
Register the authentication manager as a message receiver.

* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::WebGeolocationManager):
* WebProcess/Geolocation/WebGeolocationManager.h:
(WebGeolocationManager):
Register the geolocation manager as a message receiver.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
Remove checks for authentication manager and geolocation manager messages.

* win/WebKit2.vcproj:
Add new files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow LayerTreeHost subclasses to return a custom GraphicsLayerFactory
https://bugs.webkit.org/show_bug.cgi?id=98179

Reviewed by Andreas Kling.

Implement ChromeClient::graphicsLayerFactory and have it call the DrawingArea's graphicsLayerFactory which
for DrawingAreaImpl then calls down to the layer tree host. Make LayerTreeCoordinator implement GraphicsLayerFactory and
make it create CoordinatedGraphicsLayers.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
(WebKit):
* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::createGraphicsLayer):
(WebKit):
(WebKit::LayerTreeCoordinator::graphicsLayerFactory):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):
* WebProcess/WebPage/DrawingArea.h:
(WebCore):
(WebKit::DrawingArea::graphicsLayerFactory):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::graphicsLayerFactory):
(WebKit):
* WebProcess/WebPage/DrawingAreaImpl.h:
(DrawingAreaImpl):
* WebProcess/WebPage/LayerTreeHost.h:
(WebCore):
(WebKit::LayerTreeHost::graphicsLayerFactory):
(LayerTreeHost):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, skip a failing test.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the last bits of MSYS support from webkitperl.
https://bugs.webkit.org/show_bug.cgi?id=98195

Patch by Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> on 2012-10-02
Reviewed by Eric Seidel.

No ports currently need MinGW/MSYS support, so remove the last
hackish bits related to it from our Perl code.

* Scripts/commit-log-editor:
(createCommitMessage):
* Scripts/old-run-webkit-tests:
* Scripts/webkitdirs.pm:
(isAnyWindows):
(isWindows):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, skip one more failing test.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Block freeing thread should sleep indefinitely when there's no work to do
https://bugs.webkit.org/show_bug.cgi?id=98084

Reviewed by Geoffrey Garen.

Currently the block freeing thread wakes up once a second to check if there are any blocks 
for it to release back to the OS. This is wasteful. We should change it to sleep when it 
realizes there are no more blocks to free. Any thread that returns a block to the BlockAllocator 
should then notify the block freeing thread that there is more work to do now.

* heap/BlockAllocator.cpp:
(JSC::BlockAllocator::BlockAllocator):
(JSC::BlockAllocator::blockFreeingThreadMain):
* heap/BlockAllocator.h:
(BlockAllocator):
(JSC::BlockAllocator::deallocate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more flaky tests.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        <rdar://problem/12407139> WebKit2 should provide API that returns all pages in the same process as a given page
        https://bugs.webkit.org/show_bug.cgi?id=98193

        Reviewed by Sam Weinig.

        * UIProcess/API/C/WKPage.cpp:
        (WKPageCopyRelatedPages):
        * UIProcess/API/C/WKPagePrivate.h:
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::relatedPages):
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebProcessProxy.cpp:
        (WebKit::WebProcessProxy::pages):
        * UIProcess/WebProcessProxy.h:
        Added. This should work once a process has crashed, too.



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

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginHostManager.mm:
(WebKit::NetscapePluginHostManager::spawnPluginHost):
(WebKit::NetscapePluginHostManager::didCreateWindow):
* Plugins/Hosted/NetscapePluginHostProxy.h:
(NetscapePluginHostProxy):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::didEnterFullscreen):
(WebKit::NetscapePluginHostProxy::didExitFullscreen):
(WebKit::NetscapePluginHostProxy::applicationDidBecomeActive):
(WebKit::NetscapePluginHostProxy::endModal):
(WebKit):
(WebKit::NetscapePluginHostProxy::makeCurrentProcessFrontProcess):
(WebKit::NetscapePluginHostProxy::makePluginHostProcessFrontProcess):
(WebKit::NetscapePluginHostProxy::isPluginHostProcessFrontProcess):

Source/WebKit2:

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::beginModal):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
(WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
(WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
(WebKit::PluginProcessProxy::exitFullscreen):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Move some tiled backing store/viewport functions from Qt to generic WebKit2 sources
https://bugs.webkit.org/show_bug.cgi?id=98199

Reviewed by Noam Rosenthal.

Move commitPageTransitionViewport from Qt to WebKit2.

* UIProcess/WebPageProxy.cpp:
(WebKit):
(WebKit::WebPageProxy::commitPageTransitionViewport):
* UIProcess/qt/WebPageProxyQt.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit):
(WebKit::WebPage::commitPageTransitionViewport):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/qt/WebPageQt.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix infinite recursion inside WebProcess constructor
https://bugs.webkit.org/show_bug.cgi?id=98206

Reviewed by Brian Weinstein.

Don't call WebProcess::shared from the WebGeolocationManager constructor since it is invoked from the WebProcess constructor.

* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::WebGeolocationManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Comment additions after r130109

Rubber stamped by Geoffrey Garen.

Updated comments to how array storage works.

* runtime/ArrayStorage.h:
* runtime/JSArray.cpp:


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

* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::WebGeolocationManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
check-webkit-style can't handle qt-arm, qt-win, qt-mac, qt-5.0, qt-5.0-wk1 and qt-5.0-wk2 TestExpecatations
https://bugs.webkit.org/show_bug.cgi?id=98140

Reviewed by Eric Seidel.

Fix a bug where we were always using the host OS rather than using what was passed in as part of the
port name on Qt.

There's also a bug with being able to test for qt-5.0 expectations files when on a system with
Qt 4.8 installed. I'm not sure how to solve that, so for now, stop emitting a style warning about
not checking a file.

* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort._search_paths): Use passed in OS.
* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker.check): Don't warn if we don't know about the TestExpectations file.
* Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
(TestExpectationsTestCase.test_determine_port_from_expectations_path): Added a test case for the OS fix.
Add a commented out test for the version case.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Ignore failing line of SpacebarScrolling API test on Windows.
https://bugs.webkit.org/show_bug.cgi?id=84961

Reviewed by Anders Carlsson.

Test is failing because of https://bugs.webkit.org/show_bug.cgi?id=97946.
Ignoring the line that fails on Windows for now until the larger problem at hand is fixed.

* TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp:
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix crash in WebGeolocationManager constructor.

Defer adding the location manager until there actually is a connection.

* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::WebGeolocationManager):
(WebKit::WebGeolocationManager::registerWebPage):
* WebProcess/Geolocation/WebGeolocationManager.h:
(WebGeolocationManager):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
executive_unittest.py fails on Apple Windows bots but not when run locally.
https://bugs.webkit.org/show_bug.cgi?id=98196

Reviewed by Eric Seidel.

Making the test more flexible to check for cygwin and allow different outputs from process.wait().

* Scripts/webkitpy/common/system/executive_unittest.py:
(ExecutiveTest.serial_test_kill_process):


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