Last Comment Bug 732807 - convert mailnews/extensions/smime to Services.jsm
: convert mailnews/extensions/smime to Services.jsm
Status: RESOLVED FIXED
:
Product: MailNews Core
Classification: Components
Component: Security: S/MIME (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: Thunderbird 14.0
Assigned To: :aceman
:
:
Mentors:
Depends on:
Blocks: 720356
  Show dependency treegraph
 
Reported: 2012-03-04 07:52 PST by :aceman
Modified: 2012-11-10 11:16 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (18.96 KB, patch)
2012-03-04 08:42 PST, :aceman
standard8: review-
kaie: feedback+
Details | Diff | Splinter Review
patch v2 (19.48 KB, patch)
2012-03-23 15:18 PDT, :aceman
standard8: review+
Details | Diff | Splinter Review

Description :aceman 2012-03-04 07:52:58 PST
Convert some mailnews/extensions/smime/* calls from Components.classes[*] to Services.jsm:

am-smime.js:  var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
am-smime.js:  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
am-smime.js:  var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
am-smime.js:  var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
certFetchingStatus.js:    Components.classes["@mozilla.org/preferences-service;1"]
certFetchingStatus.js:    gLdapServerURL = Components.classes["@mozilla.org/network/io-service;1"]
certFetchingStatus.js:    var windowWatcherSvc = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
msgCompSecurityInfo.js:        Components.classes["@mozilla.org/preferences-service;1"]
msgCompSMIMEOverlay.js:  let promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
msgReadSMIMEOverlay.js:  let promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
Comment 1 :aceman 2012-03-04 08:42:50 PST
Created attachment 602733 [details] [diff] [review]
patch
Comment 2 Mark Banner (:standard8, afk until Dec) 2012-03-05 03:04:36 PST
Comment on attachment 602733 [details] [diff] [review]
patch

This is a simple replacement of services etc, with no functional change, so I can review this as I know kaie is busy.
Comment 3 Kai Engert (:kaie) (on vacation) 2012-03-22 08:20:13 PDT
Comment on attachment 602733 [details] [diff] [review]
patch

Mark, thanks for your offer to review this code, sounds good to me.
Comment 4 :aceman 2012-03-22 10:10:12 PDT
Mark is quite busy too :)
Comment 5 Mark Banner (:standard8, afk until Dec) 2012-03-22 15:41:34 PDT
Comment on attachment 602733 [details] [diff] [review]
patch

Review of attachment 602733 [details] [diff] [review]:
-----------------------------------------------------------------

Basically good, but a couple of improvements to be made.

::: mailnews/extensions/smime/content/certFetchingStatus.js
@@ +74,5 @@
>  }
>  
>  function search()
>  {
> +  let prefs = Services.prefs.getBranch(null);

Services.prefs.getBranch(null) is basically equivalent to Services.prefs - hence I think you can drop the .getBranch and inline the local variable.

::: mailnews/extensions/smime/content/msgCompSecurityInfo.js
@@ +154,2 @@
>        var autocompleteLdap = false;
> +      autocompleteLdap = Services.prefs.getBranch(null)

ditto in this file with the .getBranch(null)
Comment 6 :aceman 2012-03-23 00:54:36 PDT
Thanks, I wasn't sure what is the effect of getBranch(null) so I preserved it.
Comment 7 :aceman 2012-03-23 15:18:50 PDT
Created attachment 608884 [details] [diff] [review]
patch v2
Comment 8 Ryan VanderMeulen [:RyanVM] 2012-03-26 17:40:18 PDT
http://hg.mozilla.org/comm-central/rev/01a7a15d27bf

Note You need to log in before you can comment on or make changes to this bug.