Closed
Bug 712342
Opened 14 years ago
Closed 14 years ago
make dbStmts an object
Categories
(Toolkit :: Password Manager, defect)
Tracking
()
RESOLVED
FIXED
mozilla12
People
(Reporter: espindola, Assigned: espindola)
References
Details
Attachments
(1 file)
|
2.50 KB,
patch
|
zpao
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•14 years ago
|
||
Comment 2•14 years ago
|
||
Comment on attachment 583201 [details] [diff] [review]
make dbStmts an object
Review of attachment 583201 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
::: toolkit/components/passwordmgr/storage-mozStorage.js
@@ +176,5 @@
> }
> }
> },
> _dbConnection : null, // The database connection
> + _dbStmts : {}, // Database statements for memoization
let's keep this as null just as an indicator that init hasn't been called (and it keeps it aligned with nsFormHistory)
Attachment #583201 -
Flags: review?(paul) → review+
| Assignee | ||
Comment 3•14 years ago
|
||
Updated•14 years ago
|
Target Milestone: --- → mozilla12
Comment 4•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 5•14 years ago
|
||
(In reply to Paul O'Shannessy [:zpao] from comment #2)
> > _dbConnection : null, // The database connection
> > + _dbStmts : {}, // Database statements for memoization
>
> let's keep this as null just as an indicator that init hasn't been called
> (and it keeps it aligned with nsFormHistory)
And, more importantly, because assigning an object in the prototype means all instances share the same object. As a service there should only end up being one of these, but it's still a bad pattern to avoid (unless specifically desired).
Comment 6•14 years ago
|
||
(In reply to Justin Dolske [:Dolske] from comment #5)
> (In reply to Paul O'Shannessy [:zpao] from comment #2)
>
> > > _dbConnection : null, // The database connection
> > > + _dbStmts : {}, // Database statements for memoization
> >
> > let's keep this as null just as an indicator that init hasn't been called
> > (and it keeps it aligned with nsFormHistory)
>
> And, more importantly, because assigning an object in the prototype means
> all instances share the same object. As a service there should only end up
> being one of these, but it's still a bad pattern to avoid (unless
> specifically desired).
Doh, of course there was a better reason :) I even have an interview question about that...
But yea, as a service it would have been _ok_.
You need to log in
before you can comment on or make changes to this bug.
Description
•