Title: [136534] trunk/Source/WebCore
Revision
136534
Author
[email protected]
Date
2012-12-04 11:04:38 -0800 (Tue, 04 Dec 2012)

Log Message

Web Inspector: Can't take a heap snapshot in chromium ("Uncaught ReferenceError")
https://bugs.webkit.org/show_bug.cgi?id=103997

Reviewed by Pavel Feldman.

utilities.js used in both page and worker contexts should not access window
object as there is no one in case of workers. NonLeakingMutationObserver implementation
has moved to DOMExtension.js

* inspector/front-end/DOMExtension.js:
(NonLeakingMutationObserver.NonLeakingMutationObserver._unloadListener):
(NonLeakingMutationObserver):
(NonLeakingMutationObserver.prototype.observe):
(NonLeakingMutationObserver.prototype.disconnect):
* inspector/front-end/utilities.js:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136533 => 136534)


--- trunk/Source/WebCore/ChangeLog	2012-12-04 18:59:15 UTC (rev 136533)
+++ trunk/Source/WebCore/ChangeLog	2012-12-04 19:04:38 UTC (rev 136534)
@@ -1,3 +1,21 @@
+2012-12-04  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: Can't take a heap snapshot in chromium ("Uncaught ReferenceError")
+        https://bugs.webkit.org/show_bug.cgi?id=103997
+
+        Reviewed by Pavel Feldman.
+
+        utilities.js used in both page and worker contexts should not access window
+        object as there is no one in case of workers. NonLeakingMutationObserver implementation
+        has moved to DOMExtension.js
+
+        * inspector/front-end/DOMExtension.js:
+        (NonLeakingMutationObserver.NonLeakingMutationObserver._unloadListener):
+        (NonLeakingMutationObserver):
+        (NonLeakingMutationObserver.prototype.observe):
+        (NonLeakingMutationObserver.prototype.disconnect):
+        * inspector/front-end/utilities.js:
+
 2012-12-04  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r136509.

Modified: trunk/Source/WebCore/inspector/front-end/DOMExtension.js (136533 => 136534)


--- trunk/Source/WebCore/inspector/front-end/DOMExtension.js	2012-12-04 18:59:15 UTC (rev 136533)
+++ trunk/Source/WebCore/inspector/front-end/DOMExtension.js	2012-12-04 19:04:38 UTC (rev 136534)
@@ -547,3 +547,47 @@
 {
     e.consume();
 }
+
+window.isUnderTest = false;
+
+/**
+ * Mutation observers leak memory. Keep track of them and disconnect
+ * on unload.
+ * @constructor
+ * @param {function(Array.<WebKitMutation>)} handler
+ */
+function NonLeakingMutationObserver(handler)
+{
+    this._observer = new WebKitMutationObserver(handler);
+    NonLeakingMutationObserver._instances.push(this);
+    if (!window.testRunner && !window.isUnderTest && !NonLeakingMutationObserver._unloadListener) {
+        NonLeakingMutationObserver._unloadListener = function() {
+            while (NonLeakingMutationObserver._instances.length)
+                NonLeakingMutationObserver._instances[NonLeakingMutationObserver._instances.length - 1].disconnect();
+        };
+        window.addEventListener("unload", NonLeakingMutationObserver._unloadListener, false);
+    }
+}
+
+NonLeakingMutationObserver._instances = [];
+
+NonLeakingMutationObserver.prototype = {
+    /**
+     * @param {Element} element
+     * @param {Object} config
+     */
+    observe: function(element, config)
+    {
+        if (this._observer)
+            this._observer.observe(element, config);
+    },
+
+    disconnect: function()
+    {
+        if (this._observer)
+            this._observer.disconnect();
+        NonLeakingMutationObserver._instances.remove(this);
+        delete this._observer;
+    }
+}
+

Modified: trunk/Source/WebCore/inspector/front-end/utilities.js (136533 => 136534)


--- trunk/Source/WebCore/inspector/front-end/utilities.js	2012-12-04 18:59:15 UTC (rev 136533)
+++ trunk/Source/WebCore/inspector/front-end/utilities.js	2012-12-04 19:04:38 UTC (rev 136534)
@@ -860,47 +860,3 @@
     xhr.send(null);
     window.eval(xhr.responseText + "\n//@ sourceURL=" + scriptName);
 }
-
-window.isUnderTest = false;
-
-/**
- * Mutation observers leak memory. Keep track of them and disconnect
- * on unload.
- * @constructor
- * @param {function(Array.<WebKitMutation>)} handler
- */
-function NonLeakingMutationObserver(handler)
-{
-    this._observer = new WebKitMutationObserver(handler);
-    NonLeakingMutationObserver._instances.push(this);
-    if (!window.testRunner && !window.isUnderTest && !NonLeakingMutationObserver._unloadListener) {
-        NonLeakingMutationObserver._unloadListener = function() {
-            while (NonLeakingMutationObserver._instances.length)
-                NonLeakingMutationObserver._instances[NonLeakingMutationObserver._instances.length - 1].disconnect();
-        };
-        window.addEventListener("unload", NonLeakingMutationObserver._unloadListener, false);
-    }
-}
-
-NonLeakingMutationObserver._instances = [];
-
-NonLeakingMutationObserver.prototype = {
-    /**
-     * @param {Element} element
-     * @param {Object} config
-     */
-    observe: function(element, config)
-    {
-        if (this._observer)
-            this._observer.observe(element, config);
-    },
-
-    disconnect: function()
-    {
-        if (this._observer)
-            this._observer.disconnect();
-        NonLeakingMutationObserver._instances.remove(this);
-        delete this._observer;
-    }
-}
-
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to