Merge pull request #9405 from Snuffleupagus/pr-9245-followup

Re-factor resetting of `StatTimer` instances to fix completely broken benchmarking (PR 9245 follow-up)
This commit is contained in:
Jonas Jenwald 2018-01-26 10:15:41 +01:00 committed by GitHub
commit 628e70fbb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -1056,8 +1056,8 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
}, this); }, this);
this.objs.clear(); this.objs.clear();
this.annotationsPromise = null; this.annotationsPromise = null;
if (resetStats) { if (resetStats && this._stats instanceof StatTimer) {
this._stats.reset(); this._stats = new StatTimer();
} }
this.pendingCleanup = false; this.pendingCleanup = false;
}, },

View File

@ -411,10 +411,6 @@ function isExternalLinkTargetSet() {
class StatTimer { class StatTimer {
constructor(enable = true) { constructor(enable = true) {
this.enabled = !!enable; this.enabled = !!enable;
this.reset();
}
reset() {
this.started = Object.create(null); this.started = Object.create(null);
this.times = []; this.times = [];
} }
@ -477,8 +473,6 @@ class DummyStatTimer {
unreachable('Cannot initialize DummyStatTimer.'); unreachable('Cannot initialize DummyStatTimer.');
} }
static reset() {}
static time(name) {} static time(name) {}
static timeEnd(name) {} static timeEnd(name) {}