Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1675)

Unified Diff: Source/devtools/front_end/common/Progress.js

Issue 967853002: DevTools: n^2 -> n while loading heap snapshots and timeline files. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed the load test. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/common/Progress.js
diff --git a/Source/devtools/front_end/common/Progress.js b/Source/devtools/front_end/common/Progress.js
index ac6556bd860a33786f9800d0aec2b46704c5a6ce..a18c92997339ba3f6f7ace0ca904cf05ca860af0 100644
--- a/Source/devtools/front_end/common/Progress.js
+++ b/Source/devtools/front_end/common/Progress.js
@@ -90,6 +90,7 @@ WebInspector.CompositeProgress = function(parent)
this._childrenDone = 0;
this._parent.setTotalWork(1);
this._parent.setWorked(0);
+ // FIXME: there should be no "progress events"
parent.addEventListener(WebInspector.Progress.Events.Canceled, this._parentCanceled.bind(this));
}
@@ -104,6 +105,7 @@ WebInspector.CompositeProgress.prototype = {
_parentCanceled: function()
{
+ // FIXME: there should be no "progress events"
this.dispatchEventToListeners(WebInspector.Progress.Events.Canceled);
for (var i = 0; i < this._children.length; ++i) {
this._children[i].dispatchEventToListeners(WebInspector.Progress.Events.Canceled);
@@ -178,6 +180,7 @@ WebInspector.SubProgress.prototype = {
{
this.setWorked(this._totalWork);
this._composite._childDone();
+ // FIXME: there should be no "progress events"
this.dispatchEventToListeners(WebInspector.Progress.Events.Done);
},
@@ -215,3 +218,65 @@ WebInspector.SubProgress.prototype = {
__proto__: WebInspector.Object.prototype
}
+
+/**
+ * @constructor
+ * @extends {WebInspector.Object}
+ * @implements {WebInspector.Progress}
+ */
+WebInspector.ProgressStub = function()
+{
+}
+
+WebInspector.ProgressStub.prototype = {
+ /**
+ * @override
+ * @return {boolean}
+ */
+ isCanceled: function()
+ {
+ return false;
+ },
+
+ /**
+ * @override
+ * @param {string} title
+ */
+ setTitle: function(title)
+ {
+ },
+
+ /**
+ * @override
+ */
+ done: function()
+ {
+ },
+
+ /**
+ * @override
+ * @param {number} totalWork
+ */
+ setTotalWork: function(totalWork)
+ {
+ },
+
+ /**
+ * @override
+ * @param {number} worked
+ * @param {string=} title
+ */
+ setWorked: function(worked, title)
+ {
+ },
+
+ /**
+ * @override
+ * @param {number=} worked
+ */
+ worked: function(worked)
+ {
+ },
+
+ __proto__: WebInspector.Object.prototype
+}
« no previous file with comments | « LayoutTests/inspector/json-balanced-tokenizer-expected.txt ('k') | Source/devtools/front_end/common/TextUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698