Memory instrumentation: report memory occupied by ResourceRequest instead of its base ResourceRequestBase
https://bugs.webkit.org/show_bug.cgi?id=100497

Reviewed by Alexander Pavlov.

Source/WebCore:

Added memory reporting method to chromium implementation of ResourceRequest.

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::reportMemoryUsageBase): Renamed reportMemoryUsage
on ResourceRequestBase to reportMemoryUsageBase and made it protected. I'd
rather make ResourceRequestBase::reportMemoryUsage virtual and override it
in the descendant but ResourceRequestBase doesn't have any virtual methods
and shouldn't be used directly(ResourceRequest should be used instead).
* platform/network/ResourceRequestBase.h:
(ResourceRequestBase):
* platform/network/chromium/ResourceRequest.cpp:
(WebCore::ResourceRequest::reportMemoryUsage):
(WebCore):
* platform/network/chromium/ResourceRequest.h:
(ResourceRequest):

Source/WebKit/chromium:

Updated MemoryInstrumentationTest.ImageObserver so that it doesn't fail
when instrumentation of objects referenced by CachedImage changes.

* tests/MemoryInstrumentationTest.cpp:

Source/WTF:

* wtf/MemoryInstrumentation.h:
(WTF::MemoryClassInfo::addPrivateBuffer): do not report memory usage for empty buffer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add new baseline for exif-orientation-css.html on linux.

* platform/chromium-linux/platform/chromium/virtual/deferred/fast/images/exif-orientation-css-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add DeviceController base-class to remove duplication of DeviceXXXControler
https://bugs.webkit.org/show_bug.cgi?id=96894

Reviewed by Hajime Morita.

Source/WebCore:

Add DeviceController which is extracted from DeviceOrientationController to remove duplication.
And soon-to-be-added DeviceMotionController and ProximityController.

Covered by existing tests.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DeviceOrientationClient.h:
* dom/DeviceOrientationController.cpp:
Remove member functions to move to DeviceController.
- addListener(), removeListener(), removeAllListeners(), isActive()
(WebCore::DeviceOrientationController::DeviceOrientationController):
(WebCore::DeviceOrientationController::didChangeDeviceOrientation):
(WebCore::DeviceOrientationController::client):
(WebCore::DeviceOrientationController::hasLastData):
(WebCore::DeviceOrientationController::getLastEvent):
(WebCore::DeviceOrientationController::from):
(WebCore):
* dom/DeviceOrientationController.h:
(WebCore):
(WebCore::DeviceOrientationController::~DeviceOrientationController):
(DeviceOrientationController):
* dom/Document.cpp:
Remove suspendEventsForAllListeners() and resumeEventsForAllListeners() function calls.
These calls can be made by checking activeDOMObjectsAreSuspended() and activeDOMObjectsAreStopped() before dispatchEvent.
(WebCore::Document::suspendActiveDOMObjects):
(WebCore::Document::resumeActiveDOMObjects):
* loader/EmptyClients.h:
(EmptyDeviceClient):
(WebCore::EmptyDeviceClient::startUpdating):
(WebCore::EmptyDeviceClient::stopUpdating):
(WebCore):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DeviceClient.h: Added.
(WebCore):
(DeviceClient):
(WebCore::DeviceClient::~DeviceClient):
* page/DeviceController.cpp: Added.
DeviceController has extracted functions from DeviceOrientationController and DeviceMotionController.
- addDeviceEventListener(), removeDeviceEventlistener(), removeAllDeviceEventListeners(), dispatchDeviceEvent()
All kind of device event controller which has DeviceClient can be inherited from DeviceController.
(WebCore):
(WebCore::DeviceController::DeviceController):
(WebCore::DeviceController::addDeviceEventListener):
(WebCore::DeviceController::removeDeviceEventListener):
(WebCore::DeviceController::removeAllDeviceEventListeners):
(WebCore::DeviceController::dispatchDeviceEvent):
(WebCore::DeviceController::fireDeviceEvent):
* page/DeviceController.h: Added.
(WebCore):
(DeviceController):
(WebCore::DeviceController::~DeviceController):
(WebCore::DeviceController::isActive):
(WebCore::DeviceController::client):
(WebCore::DeviceController::hasLastData):
(WebCore::DeviceController::getLastEvent):

Source/WebKit/qt:

Change client() to deviceOrientationClient() to get DeviceOrientationClient*.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setMockDeviceOrientation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[AC][EFL][WK2] Rename PageViewportControllerClientEfl::m_pageViewportController to m_controller
https://bugs.webkit.org/show_bug.cgi?id=100933

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-01
Reviewed by Kenneth Rohde Christiansen.

PageViewportControllerClientEfl::m_pageViewportController has to be renamed to m_controller
to keep consistency with other ports. Assertinons were also added.

* UIProcess/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
(WebKit::PageViewportControllerClientEfl::updateViewportSize):
(WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
(WebKit::PageViewportControllerClientEfl::didResumeContent):
(WebKit::PageViewportControllerClientEfl::setController):
* UIProcess/efl/PageViewportControllerClientEfl.h:
(PageViewportControllerClientEfl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Memory instrumentation: do not report memory occupied by RenderObjects referenced from CSSImageGeneratorValue
https://bugs.webkit.org/show_bug.cgi?id=100934

Reviewed by Alexander Pavlov.

* css/CSSImageGeneratorValue.cpp:
(WTF): Skip rederences to RenderObjects from CSSImageGeneratorValue when collecting
memory usage data.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions]Former auto-height regions should not ignore their defined height
https://bugs.webkit.org/show_bug.cgi?id=100749

Reviewed by Julien Chaffraix.

Source/WebCore:

When a region with height auto has its height defined, we should also clear the override logical content height.
Otherwise, the region will use the wrong height when laying out content from the associated render flow thread.

Test: fast/regions/autoheight-definedheight-changenotdetected.html

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::updateRegionHasAutoLogicalHeightFlag):

LayoutTests:

Add a test in which we flow content into a region chain with 2 regions, the first one having height auto.
After a first layout, the region with height auto has an override logical content height, which should be
cleared when the first region has its height changed from auto to defined.

* fast/regions/autoheight-definedheight-changenotdetected-expected.html: Added.
* fast/regions/autoheight-definedheight-changenotdetected.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][Qt][AC] Remove an unnecessary connection to X-Server.
https://bugs.webkit.org/show_bug.cgi?id=100628.

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2012-11-01
Reviewed by Kenneth Rohde Christiansen.

With Changset: https://bugs.webkit.org/show_bug.cgi?id=100523
GraphicsSurfacePrivate should always use the Display returned by offscreenwindow.
However, in GraphicsSurfacePrivate constructor we call XOpenDisplay before asking
display from offscreenwindow.
This patch removes unnecessary call to XOpenDisplay made in GraphicsSurfacePrivate.

* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update average StylePropertySet size estimation.
<http://webkit.org/b/100940>

Reviewed by Antti Koivisto.

Use sizeForImmutableStylePropertySetWithPropertyCount(2) as the average StylePropertySet
size to keep it in sync with the changed object memory layout.

* css/StylePropertySet.cpp:
(WebCore::sizeForImmutableStylePropertySetWithPropertyCount):
(WebCore::StylePropertySet::createImmutable):
(WebCore::StylePropertySet::averageSizeInBytes):
(WebCore::StylePropertySet::reportMemoryUsage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove obsolete code from JavaScriptSourceFrame
https://bugs.webkit.org/show_bug.cgi?id=100594

Reviewed by Yury Semikhatsky.

Removed obsolete WorkingCopyCommitted listener.
Removed redundant code that removes breakpoints from _innerSetContent.

* inspector/front-end/JavaScriptSourceFrame.js:
(WebInspector.JavaScriptSourceFrame):
(WebInspector.JavaScriptSourceFrame.prototype._innerSetContent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Output code evaluated in the console the same as console.log
https://bugs.webkit.org/show_bug.cgi?id=100695

Reviewed by Pavel Feldman.

Source/WebCore:

Added an option to return object preview from evaluation commands in the protocol.
The option is used to generate preview for console eval results.

* inspector/InjectedScript.cpp:
(WebCore::InjectedScript::evaluate):
(WebCore::InjectedScript::callFunctionOn):
(WebCore::InjectedScript::evaluateOnCallFrame):
* inspector/InjectedScript.h:
(InjectedScript):
* inspector/InjectedScriptSource.js:
(.):
* inspector/Inspector.json:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::evaluateOnCallFrame):
* inspector/InspectorDebuggerAgent.h:
(InspectorDebuggerAgent):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::evaluate):
(WebCore::InspectorRuntimeAgent::callFunctionOn):
* inspector/InspectorRuntimeAgent.h:
(InspectorRuntimeAgent):
* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype.useArrayPreviewInFormatter):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleCommandResult.prototype.useArrayPreviewInFormatter):
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.prototype.evaluateOnSelectedCallFrame):
(WebInspector.DebuggerModel.CallFrame.prototype.evaluate):
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype.evaluate):
* inspector/front-end/JavaScriptSourceFrame.js:
(WebInspector.JavaScriptSourceFrame.prototype._resolveObjectForPopover):
* inspector/front-end/RemoteObject.js:
(WebInspector.RemoteObject.prototype.):
(WebInspector.RemoteObject.prototype.callFunction):
(WebInspector.RemoteObject.prototype.callFunctionJSON):
* inspector/front-end/RuntimeModel.js:
(WebInspector.RuntimeModel.prototype.evaluate):
(WebInspector.RuntimeModel.prototype.evaluated):
* inspector/front-end/WatchExpressionsSidebarPane.js:
(WebInspector.WatchExpressionsSection.prototype.update):

LayoutTests:

Rebaselined some tests after object preview is started beeing used for
console eval results.

* inspector/console/command-line-api-expected.txt:
* inspector/console/command-line-api-inspect-expected.txt:
* inspector/console/console-eval-global-expected.txt:
* inspector/console/console-eval-undefined-override-expected.txt:
* platform/chromium/inspector/console/console-eval-undefined-override-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Restoring breakpoints for formatted UISourceCode should be triggered by BreakpointManager, not ScriptsPanel.
https://bugs.webkit.org/show_bug.cgi?id=100593

Reviewed by Pavel Feldman.

Source/WebCore:

BreakpointManager now listen for FormattedChanged event and restores formatted breakpoints on it.
Removed now redundant callback from UISourceCode.setFormatted().

* inspector/front-end/BreakpointManager.js:
(WebInspector.BreakpointManager.prototype._restoreBreakpoints):
(WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
(WebInspector.BreakpointManager.prototype._uiSourceCodeFormatted):
(WebInspector.BreakpointManager.prototype._uiSourceCodeRemoved):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._addUISourceCode):
(WebInspector.ScriptsPanel.prototype._revealExecutionLine):
(WebInspector.ScriptsPanel.prototype._toggleFormatSource):
* inspector/front-end/UISourceCode.js:
(WebInspector.UISourceCode.prototype._fireContentAvailable):
(WebInspector.UISourceCode.prototype.setFormatted.formattedChanged):
(WebInspector.UISourceCode.prototype.setFormatted.didGetContent):
(WebInspector.UISourceCode.prototype.setFormatted):

LayoutTests:

* inspector/debugger/script-formatter-breakpoints.html:
* inspector/debugger/script-formatter-console.html:
* inspector/debugger/script-formatter-search-expected.txt:
* inspector/debugger/script-formatter-search.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: introduce Inspector.detached message containing termination cause.
https://bugs.webkit.org/show_bug.cgi?id=100948

Reviewed by Yury Semikhatsky.

Now protocol clients have more information to process connection termination.

* English.lproj/localizedStrings.js:
* inspector/Inspector.json:
* inspector/front-end/InspectorFrontendHostStub.js:
(WebInspector.RemoteDebuggingTerminatedScreen):
* inspector/front-end/inspector.js:
(WebInspector.loaded.WebInspector.socket.onopen):
(WebInspector.loaded):
(WebInspector.detached):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Double clicks/taps aren't passed down to the page
https://bugs.webkit.org/show_bug.cgi?id=100949

Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Since we are passing double click events as press events and that
they are preceeded by a real press event, double clicks are passed
down to the page as triple clicks.

Ignore double click events and let WebCore::EventHandler handle it
through press and release events.

* Shared/qt/WebEventFactoryQt.cpp:
(WebKit::webEventTypeForEvent):
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::handleMouseEvent):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::handleInputEvent):

Tools:

Touch mocking shouldn't transform double click events as well,
this adds an extra touch update between clicks which prevents
double-tap detection from triggering on web pages.

Tested on the mobile version of Google maps.

* MiniBrowser/qt/MiniBrowserApplication.cpp:
(MiniBrowserApplication::notify):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Change my email address.

* Scripts/webkitpy/common/config/committers.py:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG as an image may recreate the renderer on zoom
https://bugs.webkit.org/show_bug.cgi?id=99508

Reviewed by Abhishek Arya.

Source/WebCore: 

The SVGImage code, when SVG is used in <img> tags, caches the renderer
at the start of the painting method and re-uses the pointer at the end
of the method. However, when the page is zoomed the renderer may be
detached mid-method, thus leaving a stray pointer. The fix is to
re-fetch the pointer after the zooms.

Test: svg/as-image/img-zoom-svg-stylesheet.html

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawSVGToImageBuffer): Re-fetch the renderer after
the zoom operations.

LayoutTests: 

Test and ref-test-result for zooming of SVG content when loaded as-image, and the svg is actually a css file.

* svg/as-image/img-zoom-svg-stylesheet-expected.html: Added.
* svg/as-image/img-zoom-svg-stylesheet.html: Added.
* svg/as-image/resources/svg-stylesheet-for-zoom.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Browser prematurely sends wrong credentials
https://bugs.webkit.org/show_bug.cgi?id=100585

Reviewed by George Staikos.

Don't send credentials to the server before been challenged.

* platform/network/blackberry/NetworkManager.cpp:
(WebCore::NetworkManager::startJob):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Timeline: make "addRecord" unambiguous
https://bugs.webkit.org/show_bug.cgi?id=100761

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-01
Reviewed by Pavel Feldman.

TimelinePresentationModel.addRecord accepts two parameters:
record and parentRecord. parentRecord is always root record.
Make this explicit by removing parentRecord parameter.

* inspector/front-end/TimelinePanel.js: Removed parameter.
* inspector/front-end/TimelinePresentationModel.js:
(WebInspector.TimelinePresentationModel.prototype.addRecord):
Used root recoed instead of parent record.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FEImage::m_document is never cleared. Why not?
https://bugs.webkit.org/show_bug.cgi?id=99243

Reviewed by Dirk Schulze.

Adding a comment to explain why the failure to clear m_document is not a problem.

No new tests because no code change at all.

* svg/graphics/filters/SVGFEImage.h:
(FEImage): Add a comment on the lifetime of m_document.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-01

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix StylePropertySet/ElementAttributeData custom allocation in debug builds.
<http://webkit.org/b/100753>

Unreviewed debug bot crash fix after r133138.

There's additional padding after StylePropertySet and ElementAttributeData
in 64-bit debug builds since there are additional members in RefCountedBase.
Use 'sizeof(ImmutableFoo) - sizeof(void*)' as the base size of ImmutableFoo.

Patch by Andreas Kling <kling@webkit.org> on 2012-11-01

* css/StylePropertySet.cpp:
(WebCore::sizeForImmutableStylePropertySetWithPropertyCount):
* dom/ElementAttributeData.cpp:
(WebCore::sizeForImmutableElementAttributeDataWithAttributeCount):
(WebCore::ElementAttributeData::createImmutable):
(WebCore::ElementAttributeData::reportMemoryUsage):


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