Closed
Bug 486810
Opened 15 years ago
Closed 15 years ago
Engines (and their trackers) are created with every new window
Categories
(Cloud Services :: General, defect)
Cloud Services
General
Tracking
(Not tracked)
RESOLVED
FIXED
0.4
People
(Reporter: Mardak, Assigned: Mardak)
References
Details
Attachments
(1 file, 1 obsolete file)
11.33 KB,
patch
|
hello
:
review+
|
Details | Diff | Splinter Review |
This behavior causes a lot of tracker activity such as every page visit results in X onVisit verbose logs.. one for each tracker added (from opening a window).
Assignee | ||
Comment 1•15 years ago
|
||
Have Engines.register take the engine object instance of an instance so that it can grab the singleton instance of the engine. Define a singleton instance getter on the base Engine, but make Engine "virtual" while creating only one instance of the sub-engine.
Comment 2•15 years ago
|
||
Comment on attachment 371026 [details] [diff] [review] v1 We should not try to register engines on every window open, this patch doesn't fix that. Furthermore, the .instance trick is clever, but it would be simpler to just have EngineManager error/warn when attempting to replace an engine already set.
Attachment #371026 -
Flags: review?(thunder) → review-
Assignee | ||
Comment 3•15 years ago
|
||
Moved engine registration to onStartup
Attachment #371026 -
Attachment is obsolete: true
Attachment #371683 -
Flags: review?(thunder)
Updated•15 years ago
|
Attachment #371683 -
Flags: review?(thunder) → review+
Comment 4•15 years ago
|
||
Comment on attachment 371683 [details] [diff] [review] v2 > register: function EngMgr_register(engineObject) { > if (Utils.isArray(engineObject)) > return engineObject.map(this.register, this); > > try { >- let engine = new engineObject(); >+ let engine = engineObject.prototype.instance; >+ >+ if (engine.name in this._engines) >+ this._log.warn("Engine '" + engine.name + "' is already registered!"); >+ > this._engines[engine.name] = engine; > } why not do this instead? if (engineObj.name in this._engines) this._log.error("Engine '" + engine.name + "' is already registered!"); else this._engines[engineObj.name] = new engineObj() It's simpler and does the same thing basically. The instance getter is unnecessary because we already have the name which must be unique. The rest looks great, so with the change above, r+
Assignee | ||
Comment 5•15 years ago
|
||
http://hg.mozilla.org/labs/weave/rev/e75c8e36d1e3 Register the built-in engines on service start-up instead of from the overlay, and have Engines.register check if the engine has already been registered.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Component: Weave → General
Product: Mozilla Labs → Weave
Version: Trunk → unspecified
Updated•15 years ago
|
QA Contact: weave → general
You need to log in
before you can comment on or make changes to this bug.
Description
•