Closed Bug 856304 Opened 11 years ago Closed 11 years ago

remove some obsolete constructs in /mailnews

Categories

(MailNews Core :: Backend, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 23.0

People

(Reporter: aceman, Assigned: aceman)

Details

Attachments

(1 file, 1 obsolete file)

There are still some PR_FALSE, PR_TRUE, PRInt32, nsTArray<*>::NoIndex usages in the /mailnews tree.
Attached patch patch (obsolete) — Splinter Review
Attachment #731461 - Flags: review?(mbanner)
Thank you for taking care of the change(s) in 
mailnews/local/src/nsParseMailbox.cpp
Comment on attachment 731461 [details] [diff] [review]
patch

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

::: mailnews/base/src/nsMsgAccountManager.cpp
@@ +3402,5 @@
>            nsCString folderURI;
>            folder->GetURI(folderURI);
>  
>            int32_t index = searchURI.Find(folderURI);
> +          if (index == kNotFound)

I'm pretty sure kNotFound is incompatible with the external API, which is why we don't use it. If its not that, I'm sure there was some reason...

Hopefully Neil will remember.
Attachment #731461 - Flags: review?(mbanner) → review?(neil)
I still have no idea what is external API.
And we use kNotFound at other places. So what are the rules of its usage? I think it would be good to have such a constant meaning "not found" and the value could potentially change in the future.
Comment on attachment 731461 [details] [diff] [review]
patch

nsMsgUtils.h #defines kNotFound for us if we're using the external API, so that's safe.

>-    if (m_objectClass.IndexOf(oclass) == nsTArray<nsCString>::NoIndex)
>+    if (m_objectClass.IndexOf(oclass) == m_objectClass.NoIndex)
Nit: In those cases where we don't care about the actual index, you could replace this with
if (!m_objectClass.Contains(oclass))
Attachment #731461 - Flags: review?(neil) → review+
(In reply to :aceman from comment #4)
> I still have no idea what is external API.

You build with 

ac_add_options --enable-incomplete-external-linkage
ac_add_options --enable-incomplete-toolkit-ldap-autocomplete

... and among other things don't have to relink libxul when testing mailnews cpp changes (yay!!) - just a fast make -C mailnews is enough. The downside is it's busted every once in a while (like atm, though i here there are patches waiting to go in that will fix it again).
(In reply to Magnus Melin from comment #6)
> ac_add_options --enable-incomplete-external-linkage
> ac_add_options --enable-incomplete-toolkit-ldap-autocomplete
> 
> ... and among other things don't have to relink libxul when testing mailnews
> cpp changes (yay!!) - just a fast make -C mailnews is enough. The downside
> is it's busted every once in a while (like atm, though i here there are
> patches waiting to go in that will fix it again).

And how does that work?
Dunno what you mean, but the builds work just fine when it builds - and i don't think they are noticeable slower. Personally i find the internal build compile-test cycle way to slow to be productive with c++ work.
That's why I disable everything possible in the mozconfig :) So that the "internal" build is bearable (think ~3 minutes).

I mean how does it tack on the changed code onto the existing libxul if that one isn't relinked.
Attached patch patch v2Splinter Review
Attachment #731461 - Attachment is obsolete: true
Attachment #734765 - Flags: review?(neil)
(In reply to :aceman from comment #9)
> That's why I disable everything possible in the mozconfig :) So that the
> "internal" build is bearable (think ~3 minutes).

With an external build it's like < 10 seconds, depending on what you change of course.

> I mean how does it tack on the changed code onto the existing libxul if that
> one isn't relinked.

Build isn't my cup of tee but that would be the "external" part i suppose? That it's kept outside libxul at some level.
(In reply to aceman from comment #9)
> I mean how does it tack on the changed code onto the existing libxul if that
> one isn't relinked.

It doesn't, it creates libmail, libsmime and libimport (although we really should lump them altogether at some point, so as to avoid multiple copies of base/util).
Comment on attachment 734765 [details] [diff] [review]
patch v2

r=me based on code inspection of the interdiff.
Attachment #734765 - Flags: review?(neil) → review+
Thanks.

I should try that out some time. Is the external build functionally equivalent to normal build? As in, if something compiles and works then it is guaranteed to work also in normal build? On the other hand, I understand external build could fail whereas normal could still succeed with the same patch.
Keywords: checkin-needed
Functionality should be equivalent, if it's not then that's a bug.
Compiling doesn't necessarily work/fail with same things esp. due to the slightly different string apis. OTOH, i think in practice if you're compiling with external linkage and it works it's very likely to work with internal linkage as well.
OK, one more thing: what gets into libxul and what into the libmail, libsmime and libimport libraries? Is libxul the product of /mozilla (m-c) so if I make changes there it still needs to be relinked? Do the 3 libs cover all of /mail* ?
(In reply to Magnus Melin from comment #15)
> Functionality should be equivalent, if it's not then that's a bug.

Functionality should be the same, but performance is likely to be impacted - startup due to more dlls to be loaded, and generally due to the use of slower APIs. We've never actually measured it though.

(and bugzilla isn't really the place for this discussion...)
https://hg.mozilla.org/comm-central/rev/a3df3ce94ea8
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 23.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: