Web Inspector: Remove shared PageScriptDebugServer, create per-Page
https://bugs.webkit.org/show_bug.cgi?id=131523

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-11
Reviewed by Timothy Hatcher.

Having a shared PageScriptDebugServer was causing issues when we called
JSC::Debugger::clearBreakpoints() closing one inspector while another
is open for another WebCore::Page in the same process. Having the same
JSC::Debugger underlying multiple InspectorDebuggerAgent instances
means that when clearBreakpoints is called, the real JSC breakpoints
underlying other InspectorDebuggerAgent's get removed. When those
InspectorDebuggerAgents attempt to remove their breakpoints they
encounter unexpected issues.

This entirely rebuilds PageScriptDebugServer to be per-Page instead
of shared across all pages. So take this opportunity to move the
file from WebCore/bindings/js to WebCore/inspector.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/PageScriptDebugServer.h: Removed.
* inspector/InspectorAllInOne.cpp:
Move PageScriptDebugServer.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
Set the ScriptDebugServer directly on some other agents that
were previously using the global debug server.

* inspector/InspectorProfilerAgent.h:
(WebCore::InspectorProfilerAgent::scriptDebugServer):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
(WebCore::InspectorProfilerAgent::setScriptDebugServer):
(WebCore::InspectorProfilerAgent::start):
(WebCore::InspectorProfilerAgent::willDestroyFrontendAndBackend): Deleted.
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::setPageScriptDebugServer):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
Refactor these two agents to take in a script debug server.
The server is expected to be set during initialization and
to always be valid (like debug server on RuntimeAgent).

* inspector/PageDebuggerAgent.h:
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::startListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::stopListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::scriptDebugServer):
Have PageDebuggerAgent hold the PageScriptDebugServer.
Update for the simplified interfaces.

* inspector/PageScriptDebugServer.h: Added.
* inspector/PageScriptDebugServer.cpp: Renamed from Source/WebCore/bindings/js/PageScriptDebugServer.cpp.
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
(WebCore::PageScriptDebugServer::addListener):
(WebCore::PageScriptDebugServer::removeListener):
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):
(WebCore::PageScriptDebugServer::didContinue):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
(WebCore::PageScriptDebugServer::isContentScript):
(WebCore::PageScriptDebugServer::reportException):
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
Model after JSGlobalObjectScriptDebugServer, the PageScriptDebugServer
holds a reference to a Page.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid Vector copies in RenderGrid::placeItemsOnGrid()
https://bugs.webkit.org/show_bug.cgi?id=131452

Reviewed by Sergio Villar Senin.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Take in a const reference to the
Vector object. Make the for-loop that iterates through it range-based.
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
* rendering/RenderGrid.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WebCore::SpeechSynthesisUtterance::startTime
https://bugs.webkit.org/show_bug.cgi?id=131482

Reviewed by David Kilzer.

Source/WebCore: 

Hold onto the utterance until it has time to fire, in case other references have been removed.

Merged from Blink r171077 by <dmazzoni@chromium.org>

Test: platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash.html

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::handleSpeakingCompleted):

LayoutTests: 

* platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash-expected.txt: Added.
* platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 18
https://bugs.webkit.org/show_bug.cgi?id=131522

Reviewed by Anders Carlsson.

Protect against documents that have had their render tree destroyed, and no longer return a valid cache.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add BuiltinLog function to make debugging builtins easier
https://bugs.webkit.org/show_bug.cgi?id=131550

Reviewed by Andreas Kling.

Add a logging function that builtins can use for debugging.

* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncBuiltinLog):
* runtime/JSGlobalObjectFunctions.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pipe initial scale factor to TileController
https://bugs.webkit.org/show_bug.cgi?id=131521

Reviewed by Tim Horton.

Source/WebCore: 

* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setZoomedOutPageScaleFactor):
* page/Page.h:
(WebCore::Page::zoomedOutPageScaleFactor):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::zoomedOutPageScaleFactor):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsScale):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::setZoomedOutContentsScale):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::zoomedOutPageScaleFactor):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::zoomedOutPageScaleFactor):
* rendering/RenderLayerCompositor.h:

Source/WebKit2: 

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportConfigurationChanged):



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

Support for audio and video tracks was added on r158436. Stop skipping the following tests:
  media/track/audio-track.html
  media/track/video-track.html

Update bug number for media/track/track*in-band*.html tests

Report and update text expectations for new failing tests:
  media/track/track-remove-track.html
  fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-svg.html
  media/media-event-listeners.html

Update timeout expectation for media/video-controls-captions.html

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-04-11

* platform/gtk/TestExpectations:

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