Safari crashes when you set Malloc environment variables
https://bugs.webkit.org/show_bug.cgi?id=139656

Reviewed by Michael Saboff.

I forgot to cover the realloc() case. Whoops. (OoPS?)

This time around, I ran the full MallocBench test suite in Malloc=1
mode, and it passed.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::reallocate):
* bmalloc/Allocator.h: Pushed realloc() logic down into the allocator.
It needs to be down there so that we can do the short-circuiting check
for whether bmalloc is enabled first.

Also added the check.

* bmalloc/Cache.cpp:
(bmalloc::Cache::scavenge):
(bmalloc::Cache::Cache):
(bmalloc::Cache::reallocateSlowCaseNullCache):
* bmalloc/Cache.h:
(bmalloc::Cache::deallocator):
(bmalloc::Cache::reallocate): Ditto.

* bmalloc/bmalloc.h:
(bmalloc::api::free):
(bmalloc::api::realloc): Ditto.

(bmalloc::api::scavenge): Pushed this down into Cache to match the
surrounding functions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Separate counted and hysteresis activities in PageThrottler
https://bugs.webkit.org/show_bug.cgi?id=139657

Reviewed by Sam Weinig.

Currently all activities funnel into a common hysteresis mechanism, the result of
which is combined with the visually idle state, the result of which in turn drives
a UserActivity::Impl.

This is a first refactoring towards moving the UserActivity out to WebKit2. Use
m_hysteresis only of the impulse activities (plugin evaluation, user input), and
flatten the three types of activities (impulse, counted, ViewState) to all directly
control a UserActivity. Switch from a UserActivity::Impl to a UserActivity since
this will provide hysteresis for media activity.

* page/PageThrottler.cpp:
(WebCore::m_pageActivityCounter):
    - when the RefCounter changes just call updateUserActivity directly, removeed redundant call to updateUserActivity.
(WebCore::PageThrottler::createUserActivity):
    - m_activity is now a UserActivity.
(WebCore::PageThrottler::updateUserActivity):
    - previously just checked m_hysteresis for activity; now check m_pageActivityCounter too.
(WebCore::PageThrottler::pageActivityCounterValueDidChange): Deleted.
    - no longer needed; when the RefCounter changes just call updateUserActivity directly.
* page/PageThrottler.h:
    - removed pageActivityCounterValueDidChange, m_activity is now a UserActivity.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
https://bugs.webkit.org/show_bug.cgi?id=139613

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in:
Update symbols.

* WebCore.xcodeproj/project.pbxproj:
Remove -Wno-deprecated-declarations from the WebCoreObjCExtras.mm build flags.

* platform/mac/WebCoreObjCExtras.h:
If OBJC_NO_GC is defined to 1, just make WebCoreObjCFinalizeOnMainThread a no-op inline function.

* platform/mac/WebCoreObjCExtras.mm:
(WebCoreObjCFinalizeOnMainThread):
Move this to the .h file for easier inlining.

(WebCoreObjCScheduleDeallocateOnMainThread):
Use a lambda.

Source/WTF:

* wtf/Platform.h:
Remove the #define.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSSStyleDeclarationTextEditor fails to update if computed properties changed from empty to non-empty
https://bugs.webkit.org/show_bug.cgi?id=139610

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

The CSSStyleDeclarationTextEditor for Computed Style Properties always has
empty DOMNodeStyles text. However we would not reset contents if properties
changed and the actualy content was empty. So once empty, we could never
recover. In fact, we should always refresh for Computed Styles.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._propertiesChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make lookup an immediate action instead of an action menu item
https://bugs.webkit.org/show_bug.cgi?id=139661
-and corresponding-
rdar://problem/19198414

Reviewed by Tim Horton.

Source/WebCore:

New SPI.
* platform/spi/mac/LookupSPI.h:

Source/WebKit/mac:

Remove the lookup menu items and non-unused static function associated with 
lookup.
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForText]):
(-[WebActionMenuController _defaultMenuItemsForEditableText]):
(-[WebActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
(-[WebActionMenuController _createActionMenuItemForTag:]):
(-[WebActionMenuController _lookupText:]): Deleted.
(performDictionaryLookupForSelection): Deleted.
(performDictionaryLookupForRange): Deleted.

Set the defaultAnimationController to the lookup-provided animation controller 
when appropriate.
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _defaultAnimationController]):
(dictionaryPopupInfoForRange):
(-[WebImmediateActionController _animationControllerForText]):

New type.
* WebView/WebUIDelegatePrivate.h:

New function to get the lookup animation controller.
* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
* WebView/WebViewInternal.h:

Source/WebKit2:

New type.
* Shared/API/c/WKImmediateActionTypes.h:

ActionMenuHitTestResult now includes a DictionaryPopupInfo.
* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):

Remove all lookup menu items.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForText]):
(-[WKActionMenuController _defaultMenuItemsForEditableText]):
(-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(-[WKActionMenuController _lookupText:]): Deleted.

Set the defaultAnimationController to the lookup-provided animation controller 
when appropriate.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _animationControllerForText]):

Re-factor performDictionaryLookupForRange() so that most of the work is done in a 
new function called dictionaryPopupInfoForRange(). This was that code can be used 
for both performing a dictionary lookup and just getting the DictionaryPopupInfo 
for the ActionMenuHitTest.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::lookupTextAtLocation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Switching src of <video> with clipping layer results in empty black square.
https://bugs.webkit.org/show_bug.cgi?id=139650

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/video-clip-change-src.html

When the contentsLayer changes after a contentsClippingLayer has already been created, make sure to parent the
new contentsLayer, as updateRects() will only reparent when first creating a contentsClippingLayer.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToPlatformLayer):

LayoutTests:

* compositing/video-clip-change-src-expected.html: Added.
* compositing/video-clip-change-src.html: Added.


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

* platform/spi/mac/LookupSPI.h:



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

Source/WebCore:

* platform/spi/mac/LookupSPI.h:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
* WebView/WebViewInternal.h:



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