Web Inspector: extract DOM counters graph implementation into its own class
https://bugs.webkit.org/show_bug.cgi?id=109796

Reviewed by Alexander Pavlov.

Extracted DOM counters graph implementation into DOMCountersGraph.js leaving
in MemoryStatistics.js only common parts shared with NativeMemoryGraph.js
Added some closure annotations and converted object literals into classes
with named constructors.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/DOMCountersGraph.js: Added.
(WebInspector.DOMCountersGraph):
(WebInspector.DOMCounterUI):
(WebInspector.DOMCountersGraph.Counter):
(WebInspector.DOMCounterUI.prototype.setRange):
(WebInspector.DOMCounterUI.prototype.updateCurrentValue):
(WebInspector.DOMCounterUI.prototype.clearCurrentValueAndMarker):
(WebInspector.DOMCounterUI.prototype.saveImageUnderMarker):
(WebInspector.DOMCounterUI.prototype.restoreImageUnderMarker):
(WebInspector.DOMCounterUI.prototype.discardImageUnderMarker):
(WebInspector.DOMCountersGraph.prototype._createCurrentValuesBar):
(WebInspector.DOMCountersGraph.prototype._createCounterUIList):
(WebInspector.DOMCountersGraph.prototype._createCounterUIList.getNodeCount):
(WebInspector.DOMCountersGraph.prototype._createCounterUIList.getListenerCount):
(WebInspector.DOMCountersGraph.prototype._canvasHeight):
(WebInspector.DOMCountersGraph.prototype._onRecordAdded):
(WebInspector.DOMCountersGraph.prototype._draw):
(WebInspector.DOMCountersGraph.prototype._restoreImageUnderMarker):
(WebInspector.DOMCountersGraph.prototype._saveImageUnderMarker):
(WebInspector.DOMCountersGraph.prototype._drawMarker):
(WebInspector.DOMCountersGraph.prototype._drawGraph):
(WebInspector.DOMCountersGraph.prototype._discardImageUnderMarker):
* inspector/front-end/MemoryStatistics.js:
(WebInspector.MemoryStatistics):
(WebInspector.MemoryStatistics.Counter):
(WebInspector.MemoryStatistics.prototype._createCurrentValuesBar):
(WebInspector.MemoryStatistics.prototype._createCounterUIList):
(WebInspector.MemoryStatistics.prototype.setTopPosition):
(WebInspector.MemoryStatistics.prototype._canvasHeight):
(WebInspector.MemoryStatistics.prototype._onRecordAdded):
(WebInspector.MemoryStatistics.prototype._draw):
(WebInspector.MemoryStatistics.prototype._onClick):
(WebInspector.MemoryStatistics.prototype._onMouseOut):
(WebInspector.MemoryStatistics.prototype._onMouseOver):
(WebInspector.MemoryStatistics.prototype._onMouseMove):
(WebInspector.MemoryStatistics.prototype._restoreImageUnderMarker):
(WebInspector.MemoryStatistics.prototype._drawMarker):
(WebInspector.MemoryStatistics.prototype._discardImageUnderMarker):
* inspector/front-end/NativeMemoryGraph.js:
(WebInspector.NativeMemoryGraph.Counter):
(WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics):
(WebInspector.NativeMemoryGraph.prototype._onRecordAdded):
(WebInspector.NativeMemoryGraph.prototype._draw):
* inspector/front-end/TimelinePanel.js:
* inspector/front-end/WebKit.qrc:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r142712): attribute values show up as "(null)" instead of null with the threaded parser
https://bugs.webkit.org/show_bug.cgi?id=109784

Reviewed by Benjamin Poulain.

When I changed many callsites to use the (existing) String(Vector) constructor
I inadvertantly made those callsites convert empty vectors to null strings
instead of empty strings (like String(UChar,size_t) does).

This is due to an oddity/bug in our Vector implementation where data()
will be 0 if the Vector is empty, but only if it doesn't have inline capacity.
https://bugs.webkit.org/show_bug.cgi?id=109792

This changes String(Vector) to exactly match the behavior of String(vector.data(), vector.size()).

This regression was easily detectable with the threaded parser, because we use String
instead of AtomicString in our CompactToken (used to send the Token data
between threads). The main-thread parser path uses AtomicHTMLToken which
uses AtomicString(Vector) and does not have this bug.

* wtf/text/WTFString.h:
(String):
(WTF::String::String):


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