Memory instrumentation: extract MemoryObjectInfo declaration into a separate file
https://bugs.webkit.org/show_bug.cgi?id=102510

Reviewed by Pavel Feldman.

Source/JavaScriptCore:

Added new symbols for the methods that have moved into .../wtf/MemoryInstrumentation.cpp

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

Source/WebCore:

Added necessary includes where MemoryObjectInfo declaration is required.

* platform/audio/FFTFrame.cpp:
* rendering/style/RenderStyle.cpp:
* rendering/style/StyleRareInheritedData.cpp:
* rendering/style/StyleRareNonInheritedData.cpp:

Source/WTF:

Moved MemoryObjectInfo into separate header. Moved definition of MemoryInstrumentation
methods that depend on MemoryObjectInfo declaration into MemoryInstrumentation.cpp to
make MemoryInstrumentation require only forward declaration of MemoryObjectInfo.

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* wtf/CMakeLists.txt:
* wtf/MemoryInstrumentation.cpp: Added.
(WTF):
(WTF::MemoryInstrumentation::MemoryInstrumentation):
(WTF::MemoryInstrumentation::~MemoryInstrumentation):
(WTF::MemoryInstrumentation::getObjectType): this method allows to get object type without
pulling in MemoryObjectInfo.h and all its dependencies.
(WTF::MemoryInstrumentation::callReportObjectInfo):
(WTF::MemoryInstrumentation::InstrumentedPointerBase::InstrumentedPointerBase):
(WTF::MemoryInstrumentation::InstrumentedPointerBase::process):
(WTF::MemoryClassInfo::init):
(WTF::MemoryClassInfo::addRawBuffer):
(WTF::MemoryClassInfo::addPrivateBuffer):
* wtf/MemoryInstrumentation.h:
(MemoryInstrumentation):
(WTF::MemoryInstrumentation::addRootObject):
(InstrumentedPointerBase):
(WTF::MemoryInstrumentation::reportObjectMemoryUsage):
(InstrumentedPointer):
(WTF::MemoryInstrumentation::addObject): we now pass owner's MemoryObjectInfo in all places
where we report objects pointed by the owner.
(WTF::MemoryInstrumentation::OwningTraits::addObject):
(WTF::MemoryClassInfo::MemoryClassInfo):
(WTF::MemoryClassInfo::addMember):
(MemoryClassInfo):
(WTF::MemoryInstrumentation::addObjectImpl):
(WTF::::InstrumentedPointer):
(WTF::::callReportMemoryUsage):
* wtf/MemoryObjectInfo.h: Added.
(WTF):
(MemoryObjectInfo):
(WTF::MemoryObjectInfo::MemoryObjectInfo):
(WTF::MemoryObjectInfo::objectType):
(WTF::MemoryObjectInfo::objectSize):
(WTF::MemoryObjectInfo::reportedPointer):
(WTF::MemoryObjectInfo::memoryInstrumentation):
(WTF::MemoryObjectInfo::reportObjectInfo):

Tools:

Added missing includes.

* TestWebKitAPI/Tests/WTF/MemoryInstrumentationTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][AC] Mouse cursor is not updated when accelerated compositing is enabled
https://bugs.webkit.org/show_bug.cgi?id=103131

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-23
Reviewed by Kenneth Rohde Christiansen.

Make sure we try to get the Ecore_X_Window using ecore_evas_gl_x11_window_get()
in applyFallbackCursor() if accelerated compositing is enabled instead of
using ecore_evas_software_x11_window_get(). This fixes mouse cursor update
when accelerated compositing is enabled.

No new tests, no behavior change for layout tests.

* platform/efl/EflScreenUtilities.cpp:
(WebCore::applyFallbackCursor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayer minor clean-up: replace raw pointers with OwnPtrs.
https://bugs.webkit.org/show_bug.cgi?id=103134

Reviewed by Eric Seidel.

I found that RenderLayer still uses raw pointers to the objects which it owns.
Looks like these pointers could be replaced with OwnPtrs.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::collectLayers):
(WebCore::RenderLayer::styleChanged):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::marquee):
(WebCore::RenderLayer::posZOrderList):
(WebCore::RenderLayer::negZOrderList):
(WebCore::RenderLayer::normalFlowList):
(RenderLayer):
(WebCore::RenderLayer::clearZOrderLists):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: damaging last chunk does not remove its garbage from DOM
https://bugs.webkit.org/show_bug.cgi?id=103132

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Removing everything between undamaged chunks, not registered chunk rows.

* inspector/front-end/DefaultTextEditor.js:
(WebInspector.TextEditorMainPanel.prototype._insertSpanBefore):
(WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges):
(WebInspector.TextEditorMainChunk.prototype.updateCollapsedLineRow):
(WebInspector.TextEditorMainChunk.prototype.firstElement):
(WebInspector.TextEditorMainChunk.prototype.lastElement):

LayoutTests:

* inspector/editor/editor-test.js:
(initialize_EditorTests.InspectorTest.createTestEditor):
(initialize_EditorTests.InspectorTest.dumpEditorChunks):
(initialize_EditorTests.InspectorTest.dumpEditorModel):
(initialize_EditorTests.InspectorTest.dumpEditorDOM):
(initialize_EditorTests):
* inspector/editor/text-editor-remove-chunks-from-dom-expected.txt: Added.
* inspector/editor/text-editor-remove-chunks-from-dom.html: Added.
* inspector/editor/text-editor-selection-expected.txt:
* inspector/editor/text-editor-selection.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] GraphicsContext3DQt should not overwrite glClearColor of sharing context.
https://bugs.webkit.org/show_bug.cgi?id=103135

In case we use GraphicsContext3DQt to render into or
read from an existing context, we should not reset
the glClearColor on construction.
Otherwise we might overwrite an existing definition from
the sharing context.

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: remove total item from NMI snapshot grid
https://bugs.webkit.org/show_bug.cgi?id=101926

Patch by Alexei Filippov <alph@chromium.org> on 2012-11-23
Reviewed by Yury Semikhatsky.

* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.NativeSnapshotDataGrid):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2][AC] EwkViewImpl::transformToScreen() does not retrieve the Ecore_X_Window properly
https://bugs.webkit.org/show_bug.cgi?id=103133

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-23
Reviewed by Kenneth Rohde Christiansen.

If accelerated compositing is enabled, EwkViewImpl::transformToScreen() should
attempt to retrieve the Ecore_X_Window using ecore_evas_gl_x11_window_get() first
and only fall back to ecore_evas_software_x11_window_get().

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::transformToScreen):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the ARM traditional build after r135330
https://bugs.webkit.org/show_bug.cgi?id=102871

Patch by Gabor Ballabas <gaborb@inf.u-szeged.hu> on 2012-11-23
Reviewed by Zoltan Herczeg.

Added missing functionality to traditional ARM architecture.

* assembler/ARMAssembler.h:
(JSC::ARMAssembler::revertJump):
(ARMAssembler):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::startOfPatchableBranchPtrWithPatchOnAddress):
(JSC::MacroAssemblerARM::startOfBranchPtrWithPatchOnRegister):
(MacroAssemblerARM):
(JSC::MacroAssemblerARM::revertJumpReplacementToBranchPtrWithPatch):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] GraphicsContext3DQt makes wrong surface current.
https://bugs.webkit.org/show_bug.cgi?id=103136

blitMultisampleFramebufferAndRestoreContext restores
the wrong surface in case the currentContext is the same
as m_platformContext.
In this case we would reset the bound surface to NULL.
Instead we should just leave the context unchanged.

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Define WTF_PLATFORM_EFL in Platform.h
https://bugs.webkit.org/show_bug.cgi?id=101482

Patch by Laszlo Gombos <l.gombos@samsung.com> on 2012-11-23
Reviewed by Kenneth Rohde Christiansen.

.:

Remove the definition of WTF_PLATFORM_EFL from the build system to
make the EFL port consistent with other ports.

* Source/cmake/OptionsEfl.cmake:

Source/WTF:

Define WTF_PLATFORM_EFL in Platform.h to be consistent with
other ports.

* wtf/Platform.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Drop Synchronous Mouse Events
https://bugs.webkit.org/show_bug.cgi?id=102980

Patch by Genevieve Mak <gmak@rim.com> on 2012-11-23
Reviewed by Rob Buis.

Reviewed Internally by George Staikos and Mike Lattanzio.
Don't send actual Touch Events to fullscreen plugins unless
its a Touch Cancel, DoubleTap or TouchHold.
Instead send mouse events as long as its a single finger.
PR #242781

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::touchPointAsMouseEvent):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin):
(WebKit):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening: update expectations for now crashing test
visibility-simple-canvas2d-layer.html
https://bugs.webkit.org/show_bug.cgi?id=98086

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Meta viewport can't be changed dynamically
https://bugs.webkit.org/show_bug.cgi?id=103098

Patch by Jacky Jiang  <zhajiang@rim.com>.
Reviewed by Rob Buis.
Internally reviewed by Arvid Nilsson.

PR: 237072
Reset m_userPerformedManualZoom and enable
m_shouldZoomToInitialScaleAfterLoadFinished so that we can relayout the
page and zoom it to fit the screen when we dynamically change the meta
viewport after the load is finished.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r135486): ASSERT(isMainThread()) hit in LayerTreeRenderer::setActive(bool)
https://bugs.webkit.org/show_bug.cgi?id=103077

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-23
Reviewed by Noam Rosenthal.

Currently, the painting thread uses purgeGLResources() and setActive().
QQuickWebPage::updatePaintNode() indirectly calls both methods after
locking the main thread.

This patch changes two points.
1. Remove ASSERT(isMainThread()) in methods that the painting thread can
call.
2. Make purgeGLResources() and setActive() call methods of
LayerTreeCoordinatorProxy via dispatchOnMainThread().

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::LayerTreeRenderer):
(WebKit::LayerTreeRenderer::renderNextFrame):
(WebKit::LayerTreeRenderer::purgeGLResources):
(WebKit):
(WebKit::LayerTreeRenderer::purgeBackingStores):
(WebKit::LayerTreeRenderer::setActive):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening: test expectations failures.
https://bugs.webkit.org/show_bug.cgi?id=103148

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ENCHANT] Infinite loop when end word position is not found
https://bugs.webkit.org/show_bug.cgi?id=103139

Reviewed by Martin Robinson.

Covered by existing tests in editing/spelling.

* editing/visible_units.cpp:
(WebCore::isLogicalStartOfWord): Make it private again.
(WebCore::islogicalEndOfWord): Ditto.
* editing/visible_units.h:
* platform/text/enchant/TextCheckerEnchant.cpp:
(WebCore::TextCheckerEnchant::checkSpellingOfWord): Helper funtion
to check a word inside a string using the loaded dictionaries.
(WebCore::TextCheckerEnchant::checkSpellingOfString): Optimize and
simply the code by using the word iterator to iterate the
words.
* platform/text/enchant/TextCheckerEnchant.h:
(TextCheckerEnchant):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][GTK] Adapt accessibility feature to WebKitTestRunner.
https://bugs.webkit.org/show_bug.cgi?id=100757

Patch by Mateusz Leszko <m.leszko@samsung.com> on 2012-11-23
Reviewed by Laszlo Gombos.

Tools:

Allow to build accessibility feature in WebkitTestRunner for EFL Platform.
Updating CMake files due to changes from Bug 99011.

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::AccessibilityController):
(WTR):
* WebKitTestRunner/InjectedBundle/AccessibilityController.h:
(AccessibilityController):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
(AccessibilityUIElement):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: - Removed gtk/gtk.h dependency.
* WebKitTestRunner/PlatformEfl.cmake: - Adding atk includes.

LayoutTests:

Unskipping EFL Accessiblity tests for wk2.

* platform/efl-wk1/TestExpectations:
* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TexMap] Remove dependency of TextureMapperLayer on GraphicsLayerTextureMapper.
https://bugs.webkit.org/show_bug.cgi?id=103046

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-23
Reviewed by Noam Rosenthal.

Source/WebCore:

It is a preparation patch for Threaded Coordinated Graphics on WK1.

We want to make TextureMapperLayer into an actor model. After making an actor
model, GraphicsLayerTextureMapper and LayerTreeRenderer will communicate with
TextureMapperLayer using message passing. In the first step, we want to hide
GraphicsLayerTextureMapper from TextureMapperLayer.

There are 2 kinds of dependencies of TextureMapperLayer in GraphicsLayerTextureMapper.
1. To query layer states
2. To paint layer contents

In this patch, we removed the second dependency. Currently, TextureMapperLayer
requests painting contents to GraphicsLayerTextureMapper in WK1 while
Coordinated Graphics prepares the contents in LayerTreeRenderer. This patch
makes WK1 prepare the contents in GraphicsLayerTextureMapper like
LayerTreeRenderer.

We will remove the first dependency in a follow-up patch.

Covered by existing layout tests.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerTextureMapper::flushCompositingState):
(WebCore):
(WebCore::GraphicsLayerTextureMapper::didFlushCompositingState):
(WebCore::GraphicsLayerTextureMapper::didFlushCompositingStateRecursive):
(WebCore::GraphicsLayerTextureMapper::updateBackingStore):
(WebCore::GraphicsLayerTextureMapper::prepareBackingStore):
(WebCore::GraphicsLayerTextureMapper::shouldHaveBackingStore):
(WebCore::GraphicsLayerTextureMapper::drawRepaintCounter):
(WebCore::GraphicsLayerTextureMapper::setDebugBorder):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::setHasOwnBackingStore):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::rootLayer):
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::textureMapper):
(WebCore):
(WebCore::TextureMapperLayer::flushCompositingState):
(WebCore::TextureMapperLayer::flushCompositingStateSelf):
* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore):
(WebCore::TextureMapperLayer::TextureMapperLayer):
(TextureMapperLayer):
(WebCore::TextureMapperLayer::setBackingStore):
(State):
(WebCore::TextureMapperLayer::State::State):

Source/WebKit2:

This patch makes GraphicsLayerTextureMapper create its own backing
store. However, LayerTreeRenderer also creates its own backing store. So
when LayerTreeRenderer uses GraphicsLayerTextureMapper,
LayerTreeRenderer needs GraphicsLayerTextureMapper to not create its own
backing store.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::createLayer):
(WebKit::LayerTreeRenderer::getBackingStore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Add support for winflexbison distribution
https://bugs.webkit.org/show_bug.cgi?id=102551

Reviewed by Laszlo Gombos.

Since GnuWin32 does not provide recent versions of bision and flex supporting
the alternative winflexbison distribution is the prefered option.

* Source/cmake/WebKitMacros.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: LayerTreeRenderer::removeTile() does not remove tiles actually.
https://bugs.webkit.org/show_bug.cgi?id=103030

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-23
Reviewed by Noam Rosenthal.

LayerTreeRenderer::removeTile() must add a backing store into
m_backingStoresWithPendingBuffers. Otherwise, tiles are not removed.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::removeTile):

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