Last Comment Bug 705100 - remove nsISupportsArray from migration
: remove nsISupportsArray from migration
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Migration (show other bugs)
: Trunk
: All All
: -- trivial (vote)
: Firefox 11
Assigned To: Matthew N. [:MattN] (PM me if requests are blocking you)
:
: Matthew N. [:MattN] (PM me if requests are blocking you)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-24 04:06 PST by Matthew N. [:MattN] (PM me if requests are blocking you)
Modified: 2011-12-02 03:29 PST (History)
2 users (show)
MattN+bmo: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Replace nsISupportsArray with nsIArray and nsIMutableArray in migration (13.83 KB, patch)
2011-11-24 04:06 PST, Matthew N. [:MattN] (PM me if requests are blocking you)
no flags Details | Diff | Splinter Review
v0.2 Replace nsISupportsArray with nsIArray and nsIMutableArray in migration (14.11 KB, patch)
2011-11-26 15:39 PST, Matthew N. [:MattN] (PM me if requests are blocking you)
no flags Details | Diff | Splinter Review
v0.3 Another missing change (14.30 KB, patch)
2011-11-28 22:55 PST, Matthew N. [:MattN] (PM me if requests are blocking you)
mak77: review+
Details | Diff | Splinter Review

Description Matthew N. [:MattN] (PM me if requests are blocking you) 2011-11-24 04:06:39 PST
Created attachment 576717 [details] [diff] [review]
Replace nsISupportsArray with nsIArray and nsIMutableArray in migration

nsISupportsArray was obsoleted by nsIArray and nsIMutableArray. Replace the usage in browser/components/migration as they provide a more natural interface for JS.
Comment 1 Marco Bonardo [::mak] 2011-11-25 02:33:02 PST
Comment on attachment 576717 [details] [diff] [review]
Replace nsISupportsArray with nsIArray and nsIMutableArray in migration

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

::: browser/components/migration/src/nsOperaProfileMigrator.cpp
@@ +209,5 @@
>    if (!mProfiles) {
>      nsresult rv;
>  
>      mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
>      if (NS_FAILED(rv)) return rv;

This looks wrong, shouldn't use NS_ARRAY_CONTRACTID?
Comment 2 Marco Bonardo [::mak] 2011-11-26 03:54:05 PST
Comment on attachment 576717 [details] [diff] [review]
Replace nsISupportsArray with nsIArray and nsIMutableArray in migration

clearing while the above gets clarified
Comment 3 Matthew N. [:MattN] (PM me if requests are blocking you) 2011-11-26 15:39:39 PST
Created attachment 577108 [details] [diff] [review]
v0.2 Replace nsISupportsArray with nsIArray and nsIMutableArray in migration

(In reply to Marco Bonardo [:mak] from comment #1)
> Review of attachment 576717 [details] [diff] [review] [diff] [details] [review]:
> -----------------------------------------------------------------
> 
> ::: browser/components/migration/src/nsOperaProfileMigrator.cpp
> @@ +209,5 @@
> >    if (!mProfiles) {
> >      nsresult rv;
> >  
> >      mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
> >      if (NS_FAILED(rv)) return rv;
> 
> This looks wrong, shouldn't use NS_ARRAY_CONTRACTID?

You're right, I refreshed that into the wrong patch.  Here is a fixed version.
Comment 4 Matthew N. [:MattN] (PM me if requests are blocking you) 2011-11-28 22:55:45 PST
Created attachment 577502 [details] [diff] [review]
v0.3 Another missing change

Not sure how I missed this
Comment 5 Marco Bonardo [::mak] 2011-11-29 02:52:45 PST
Comment on attachment 577502 [details] [diff] [review]
v0.3 Another missing change

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

::: browser/components/migration/content/migration.js
@@ +215,2 @@
>        for (var i = 0; i < count; ++i) {
>          var item = document.createElement("radio");

I don't see the point of the count variable here, couldn't you inline .length in the for condition?

::: browser/components/migration/src/nsProfileMigrator.cpp
@@ +127,5 @@
>    // By opening the Migration FE with a supplied bpm, it will automatically
>    // migrate from it. 
>    nsCOMPtr<nsIWindowWatcher> ww(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
> +  nsCOMPtr<nsIMutableArray> params =
> +    do_CreateInstance(NS_ARRAY_CONTRACTID);

it's possible you can oneline this, the old impl was going over 80 chars, this looks fine instead
Comment 6 Matthew N. [:MattN] (PM me if requests are blocking you) 2011-12-01 21:57:53 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b6d9e92b148
Comment 7 Marco Bonardo [::mak] 2011-12-02 03:29:24 PST
https://hg.mozilla.org/mozilla-central/rev/3b6d9e92b148

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