Title: [110698] trunk
Revision
110698
Author
[email protected]
Date
2012-03-14 07:41:26 -0700 (Wed, 14 Mar 2012)

Log Message

Source/WebCore: Web Inspector: small improvement for HeapSnapshot performance ~12%.
https://bugs.webkit.org/show_bug.cgi?id=81033

Reviewed by Yury Semikhatsky.

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype.get nodeCount):
(WebInspector.HeapSnapshot.prototype.get maxNodeId):
(WebInspector.HeapSnapshot.prototype._buildReverseIndex):
(WebInspector.HeapSnapshot.prototype.get nodeIndexes):
(WebInspector.HeapSnapshot.prototype._buildNodeIndex):

Source/WebKit/chromium: Unreviewed, mark verifyCullChildLinesUpTopLeft() as failed.

Patch by Hajime Morrita <[email protected]> on 2012-03-13

* tests/CCQuadCullerTest.cpp:
(WebCore):
(WebCore::TEST):

LayoutTests: Return null when shouldAllowAccessToNode() fails
https://bugs.webkit.org/show_bug.cgi?id=80205

Patch by Kentaro Hara <[email protected]> on 2012-03-14
Reviewed by Adam Barth.

shouldAllowAccessToNode() is used for window.frameElement, HTMLFrameElement.contentDocument,
and getSVGDocument(). The spec of window.frameElement and HTMLFrameElement.contentDocument
requires that they should return null when the security check fails.
Thus this patch changes the return value from undefined to null.

http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#navigating-nested-browsing-contexts-in-the-dom
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#dom-iframe-contentdocument

* http/tests/security/cross-frame-access-frameelement-expected.txt:
* http/tests/security/local-iFrame-from-remote.html:
* platform/chromium/http/tests/security/cross-frame-access-put-expected.txt:
* platform/gtk/http/tests/security/cross-frame-access-put-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110697 => 110698)


--- trunk/LayoutTests/ChangeLog	2012-03-14 13:23:10 UTC (rev 110697)
+++ trunk/LayoutTests/ChangeLog	2012-03-14 14:41:26 UTC (rev 110698)
@@ -1,3 +1,23 @@
+2012-03-14  Kentaro Hara  <[email protected]>
+
+        Return null when shouldAllowAccessToNode() fails
+        https://bugs.webkit.org/show_bug.cgi?id=80205
+
+        Reviewed by Adam Barth.
+
+        shouldAllowAccessToNode() is used for window.frameElement, HTMLFrameElement.contentDocument,
+        and getSVGDocument(). The spec of window.frameElement and HTMLFrameElement.contentDocument
+        requires that they should return null when the security check fails.
+        Thus this patch changes the return value from undefined to null.
+
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#navigating-nested-browsing-contexts-in-the-dom
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#dom-iframe-contentdocument
+
+        * http/tests/security/cross-frame-access-frameelement-expected.txt:
+        * http/tests/security/local-iFrame-from-remote.html:
+        * platform/chromium/http/tests/security/cross-frame-access-put-expected.txt:
+        * platform/gtk/http/tests/security/cross-frame-access-put-expected.txt:
+
 2012-03-14  Hajime Morrita  <[email protected]>
 
         Unreviewed rebaseline update for <use> related SVG files.

Modified: trunk/Source/WebCore/ChangeLog (110697 => 110698)


--- trunk/Source/WebCore/ChangeLog	2012-03-14 13:23:10 UTC (rev 110697)
+++ trunk/Source/WebCore/ChangeLog	2012-03-14 14:41:26 UTC (rev 110698)
@@ -1,3 +1,49 @@
+2012-03-14  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: small improvement for HeapSnapshot performance ~12%.
+        https://bugs.webkit.org/show_bug.cgi?id=81033
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/HeapSnapshot.js:
+        (WebInspector.HeapSnapshot.prototype.get nodeCount):
+        (WebInspector.HeapSnapshot.prototype.get maxNodeId):
+        (WebInspector.HeapSnapshot.prototype._buildReverseIndex):
+        (WebInspector.HeapSnapshot.prototype.get nodeIndexes):
+        (WebInspector.HeapSnapshot.prototype._buildNodeIndex):
+
+2012-03-14  Kentaro Hara  <[email protected]>
+
+        Return null when shouldAllowAccessToNode() fails
+        https://bugs.webkit.org/show_bug.cgi?id=80205
+
+        Reviewed by Adam Barth.
+
+        shouldAllowAccessToNode() is used for window.frameElement, HTMLFrameElement.contentDocument,
+        and getSVGDocument(). The spec of window.frameElement and HTMLFrameElement.contentDocument
+        requires that they should return null when the security check fails.
+        Thus this patch changes the return value from undefined to null.
+
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#navigating-nested-browsing-contexts-in-the-dom
+        http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#dom-iframe-contentdocument
+
+        Tests: http/tests/security/local-iFrame-from-remote.html
+               http/tests/security/cross-frame-access-frameelement.html
+               http/tests/security/cross-frame-access-put.html
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateNormalAttrGetter):
+        (GenerateFunctionCallback):
+
+        * bindings/scripts/test/JS/JSTestObj.cpp: Updated run-bindings-tests results.
+        (WebCore::jsTestObjContentDocument):
+        (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjInternal::contentDocumentAttrGetter):
+        (WebCore::TestObjInternal::getSVGDocumentCallback):
+
 2012-03-14  Sudarsana Nagineni  <[email protected]>
 
         Build error: DNSSoup.cpp:30: fatal error: CString.h: No such file or

Modified: trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js (110697 => 110698)


--- trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-03-14 13:23:10 UTC (rev 110697)
+++ trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js	2012-03-14 14:41:26 UTC (rev 110698)
@@ -805,13 +805,7 @@
 
     get nodeCount()
     {
-        if (this._nodeCount)
-            return this._nodeCount;
-
-        this._nodeCount = 0;
-        for (var iter = this._allNodes; iter.hasNext(); iter.next())
-            ++this._nodeCount;
-        return this._nodeCount;
+        return this.nodeIndexes.length - 1;
     },
 
     nodeFieldValuesByIndex: function(fieldName, indexes)
@@ -835,8 +829,10 @@
         if (typeof this._maxNodeId === "number")
             return this._maxNodeId;
         this._maxNodeId = 0;
-        for (var iter = this._allNodes; iter.hasNext(); iter.next()) {
-            var id = iter.node.id;
+        var node = new WebInspector.HeapSnapshotNode(this, this.nodeIndexes[0]);
+        for (var i = 0; i < this.nodeCount; ++i) {
+            node.nodeIndex = this.nodeIndexes[i];
+            var id = node.id;
             if ((id % 2) && id > this._maxNodeId)
                 this._maxNodeId = id;
         }
@@ -922,10 +918,10 @@
         //  - "indexArray" is an array of indexes in the "backRefsArray"
         //    with the same positions as in the _nodeIndex.
         var indexArray = this[indexArrayName] = new Int32Array(this._nodeIndex.length);
-        for (var i = 0, l = indexArray.length; i < l; ++i)
-            indexArray[i] = 0;
-        for (var nodesIter = this._allNodes; nodesIter.hasNext(); nodesIter.next()) {
-            indexCallback(nodesIter.node, function (position) { ++indexArray[position]; });
+        var node = new WebInspector.HeapSnapshotNode(this, this.nodeIndexes[0]);
+        for (var i = 0; i < this.nodeCount; ++i) {
+            node.nodeIndex = this.nodeIndexes[i];
+            indexCallback(node, function (position) { ++indexArray[position]; });
         }
         var backRefsCount = 0;
         for (i = 0, l = indexArray.length; i < l; ++i)
@@ -939,8 +935,10 @@
             indexArray[i] = backRefsPosition;
             backRefsPosition += backRefsCount;
         }
-        for (nodesIter = this._allNodes; nodesIter.hasNext(); nodesIter.next()) {
-            dataCallback(nodesIter.node,
+        node = new WebInspector.HeapSnapshotNode(this, this.nodeIndexes[0]);
+        for (var i = 0; i < this.nodeCount; ++i) {
+            node.nodeIndex = this.nodeIndexes[i];
+            dataCallback(node,
                          function (backRefIndex) { return backRefIndex + (--backRefsArray[backRefIndex]); },
                          function (backRefIndex, destIndex) { backRefsArray[backRefIndex] = destIndex; });
         }
@@ -1026,8 +1024,9 @@
         }
 
         var aggregates = {};
-        for (var iter = this._allNodes; iter.hasNext(); iter.next()) {
-            var node = iter.node;
+        var node = new WebInspector.HeapSnapshotNode(this, this.nodeIndexes[0]);
+        for (var i = 0; i < this.nodeCount; ++i) {
+            node.nodeIndex = this.nodeIndexes[i];
             if (shouldSkip(node))
                 continue;
             var className = node.className;
@@ -1080,9 +1079,17 @@
                 });
     },
 
+    get nodeIndexes()
+    {
+        if (!this._nodeIndex)
+            this._buildNodeIndex();
+        return this._nodeIndex;
+    },
+
     _buildNodeIndex: function()
     {
-        var count = this.nodeCount;
+        var count = 0;
+        for (var nodesIter = this._allNodes; nodesIter.hasNext(); nodesIter.next(), ++count);
         this._nodeIndex = new Int32Array(count + 1);
         count = 0;
         for (var nodesIter = this._allNodes; nodesIter.hasNext(); nodesIter.next(), ++count)

Modified: trunk/Source/WebKit/chromium/ChangeLog (110697 => 110698)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-14 13:23:10 UTC (rev 110697)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-14 14:41:26 UTC (rev 110698)
@@ -1,3 +1,11 @@
+2012-03-13  Hajime Morrita  <[email protected]>
+
+        Unreviewed, mark verifyCullChildLinesUpTopLeft() as failed.
+
+        * tests/CCQuadCullerTest.cpp:
+        (WebCore):
+        (WebCore::TEST):
+
 2012-03-14  Marja Hölttä  <[email protected]>
 
         WebHTTPBody: Keep track of whether the data includes passwords.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to