Support throttling of DOMTimers using nested setTimeout() calls
https://bugs.webkit.org/show_bug.cgi?id=138262

Reviewed by Gavin Barraclough.

Extend DOMTimers throttling support to timers that are using nested
setTimeout() calls instead of a setInterval(). To achieve this, this
patch introduces a NestedTimersVector singleton class where nested
timers are appended, and for which we potentially update the next
firing time, after the parent timer is done executing.

I have verified this helps on cnn.com for example, which has timers
interacting with non-visible plugins that are scheduled using nested
setTimeout() calls with a frequency of 150 / 200 ms.

* page/DOMTimer.cpp:
(WebCore::NestedTimersVector::NestedTimersVector):
(WebCore::NestedTimersVector::~NestedTimersVector):
(WebCore::NestedTimersVector::registerTimer):
(WebCore::NestedTimersVector::begin):
(WebCore::NestedTimersVector::end):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::updateThrottlingStateIfNecessary):
(WebCore::DOMTimer::fired):
* page/DOMTimer.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
No way to specify target os or architecture when using the --no-copy option with run-jsc-stress-tests
https://bugs.webkit.org/show_bug.cgi?id=138268

Reviewed by Andreas Kling.

Added a --arch and --os option to set or override the values that are
normally computed based on examining the JavaScriptCore we want to test.

* Scripts/run-jsc-stress-tests:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use std::unique_ptr for TypeCountSet
https://bugs.webkit.org/show_bug.cgi?id=138242

Reviewed by Andreas Kling.

Source/JavaScriptCore:

* heap/Heap.cpp:
(JSC::Heap::protectedObjectTypeCounts):
Use std::unique_ptr<> instead of PassOwnPtr|OwnPtr.
(JSC::Heap::objectTypeCounts): ditto.
* heap/Heap.h:

Source/WebKit/mac:

* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): Use std::unique_ptr<> instead of OwnPtr.
(+[WebCoreStatistics javaScriptObjectTypeCounts]): ditto.

Source/WebKit/win:

* WebCoreStatistics.cpp:
(WebCoreStatistics::javaScriptProtectedObjectTypeCounts): Use std::unique_ptr<> instead of OwnPtr.
(WebCoreStatistics::javaScriptObjectTypeCounts): ditto.

Source/WebKit2:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add bundle SPI to customize the action menu
<rdar://problem/18830771>
https://bugs.webkit.org/show_bug.cgi?id=138271

Reviewed by Anders Carlsson.

- Adds a new function to the WKBundlePageContextMenuClient that allows the client to pass construct
  user data in the bundle that can be available when customizing the menu in -[WKView _actionMenuItemsForHitTestResult...].
- Changes the signature of  -[WKView _actionMenuItemsForHitTestResult...] to add userData.
- Makes the actual hit test result available in the second invocation of -[WKView _actionMenuItemsForHitTestResult...]
  by serializing it in the ActionMenuHitTestResult.

* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
Adds the WebHitTestResult and the original hit test request location.
        
* UIProcess/API/Cocoa/WKViewPrivate.h:
Adds a new version of _actionMenuItemsForHitTestResult that passes userData along.

* UIProcess/API/mac/WKView.mm:
(-[WKView _didPerformActionMenuHitTest:userData:]):
(-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformActionMenuHitTest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformActionMenuHitTest):
Pipe the user data through to the WKView.

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController prepareForMenu:withEvent:]):
(-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
(-[WKActionMenuController menuNeedsUpdate:]):
(-[WKActionMenuController _updateActionMenuItemsForStage:]):
Differentiate between the two times _updateActionMenuItems was called via a new stage parameter,
(it is called once in prepareForMenu, and once in menuNeedsUpdate). Use the last mouse move hit
test result in the prepareForMenu case (as we don't have a real result yet), and the hit result
passed in via didPerformActionMenuHitTest in the menuNeedsUpdate case (assuming we didn't time out)
waiting on the web process.

* WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
* WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
(WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
* WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Adds new bundle SPI to collect user data to pass to the -[WKView _actionMenuItemsForHitTestResult...] method.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StyleBuilder: Stop using custom code for -webkit-hyphenate-limit-lines
https://bugs.webkit.org/show_bug.cgi?id=138270

Reviewed by Antti Koivisto.

Stop using custom code for -webkit-hyphenate-limit-lines in the new
StyleBuilder. We don't really need to, we can just have a Converter
specific to this property.

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertWebkitHyphenateLimitLines):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::applyValueWebkitHyphenateLimitLines): Deleted.


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