Closed Bug 382009 Opened 17 years ago Closed 17 years ago

Remove |nsXPIDLString| and |nsXPIDLCString| usage from Camino.

Categories

(Camino Graveyard :: General, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nick.kreeger, Assigned: nick.kreeger)

References

Details

Attachments

(1 file, 1 obsolete file)

In the future event of shifting Camino to run on top of an embedded XUL Runner, we need to remove the usage of the |nsXPIDLString| and |nsXPIDLCString| classes. These classes (to my understanding) will not be on the frozen linkage.

The corresponding |nsAString| and |nsACString| classes should be used instead.
Attached patch XPIDL-free V1 (obsolete) — Splinter Review
This patch removes the nsXPIDL* usage and gets rid of some old PL_strcmp functions.
Attachment #278069 - Flags: review?(mark)
Comment on attachment 278069 [details] [diff] [review]
XPIDL-free V1

In CocoaPromptService::GetCommonDialogLocaleString:

>-  if (NS_FAILED(rv)) return returnValue;
>+  NS_ENSURE_SUCCESS(rv, rv);

This method should return an NSString*.  Didn't the compiler warn you?  This should be NS_ENSURE_SUCCESS(rv, returnValue).

In SecurityDialogs::AlertDialog:

>-    rv = prompt->AlertCheck(windowTitle, message, dontShowAgain, &prefValue);
>+    rv = prompt->AlertCheck(windowTitle.get(), message.get(), dontShowAgain.get(), &prefValue);
>   else
>-    rv = prompt->AlertCheck(windowTitle, message, nil, nil);
>+    rv = prompt->AlertCheck(windowTitle.get(), message.get(), nil, nil);

PromiseFlatString?  Also in  -[CHBrowserView lastFindText]

>-      NS_ConvertUTF16toUTF8 utf8Value(term->text);
>+      nsCAutoString utf8Value;
>+      LossyCopyUTF16toASCII(term->text, utf8Value);

Why are you making this lossy?  Is ASCII good enough?
Attached patch XPIDL-free V2Splinter Review
Updated to meet comments.
Attachment #278069 - Attachment is obsolete: true
Attachment #278105 - Flags: review?
Attachment #278069 - Flags: review?(mark)
Attachment #278105 - Flags: review? → review?(mark)
Attachment #278105 - Flags: review?(mark) → review+
Attachment #278105 - Flags: superreview?(mikepinkerton)
Comment on attachment 278105 [details] [diff] [review]
XPIDL-free V2

rs=pink
Attachment #278105 - Flags: superreview?(mikepinkerton) → superreview+
Comment added to the file (inside the function call).

Checked into the trunk.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
(In reply to comment #5)
> Comment added to the file (inside the function call).

Sorry, wrong bug, no comment added.
Do we want this on the branch to keep these files more in sync?
In case you didn't know, frozen linkage doesn't have PromiseFlatString. See http://developer.mozilla.org/en/docs/Migrating_from_Internal_Linkage_to_Frozen_Linkage.
(In reply to comment #8)
> In case you didn't know, frozen linkage doesn't have PromiseFlatString. See
> http://developer.mozilla.org/en/docs/Migrating_from_Internal_Linkage_to_Frozen_Linkage.
> 

Doh!
I filed bug 394161 to remove |PromiseFlatString| usage in Camino since we use it several more times than just in this patch.
(In reply to comment #7)
> Do we want this on the branch to keep these files more in sync?
> 

Let's discuss this in the meeting today. I don't think it's an issue, but I'd like to hear what mento or pink think.
From the meeting log, we said we wanted to take this on the branch if it worked there.

I just tried to apply this to the branch, and a handful of hunks fail, so I can't see if it builds/works.  Nick, do you want to try to unbitrot this and see if it works on branch?
For whatever reason, the PageInfoWindowController hunk never made it in back in 2007 :(

I pushed that hunk tonight, given that it still applied and worked (and had r/sr back then): http://hg.mozilla.org/camino/rev/65f7f62ee685

Of course, since then we've imported FAYT with its 3 nsXPIDL[C]Strings, but oh well; we're not going to clean that mess up.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: