Closed
Bug 264648
Opened 20 years ago
Closed 19 years ago
Implement nsOSHelperAppService::GetApplicationDescription for MacOS X
Categories
(Core Graveyard :: File Handling, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: Biesinger, Assigned: asaf)
References
Details
Attachments
(1 file, 1 obsolete file)
6.12 KB,
patch
|
jhpedemonte
:
review+
sfraser_bugs
:
superreview+
asa
:
approval1.8b4+
|
Details | Diff | Splinter Review |
to be able to show an application description in the confirmation dialog for
external protocols, nsOSHelperAppService::GetApplicationDescription should be
implemented.
this bug is about the OS X implementation.
Assignee | ||
Updated•19 years ago
|
Assignee: file-handling → bugs.mano
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta4
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•19 years ago
|
||
This leaks, releasing the bundle causes a crash on a second call (?) to this
method. I might fix it by checking its retain count, but I really shoudn't have
to...
Comment 2•19 years ago
|
||
Comment on attachment 189769 [details] [diff] [review]
patch v1
>Index: uriloader/exthandler/mac/nsOSHelperAppService.cpp
>===================================================================
>+ if (err == noErr) {
>+ CFBundleRef handlerBundle = ::CFBundleCreate(NULL, handlerBundleURL);
Is this the right way to get the bundle given a URL? Seems a little weird.
>+ if (handlerBundle) {
>+ // Get the human-readable name of the default handler bundle
>+ CFStringRef bundleName =
>+ (CFStringRef)::CFBundleGetValueForInfoDictionaryKey(handlerBundle,
>+ kCFBundleNameKey);
>+ if (bundleName) {
>+ nsAutoBuffer<UniChar, 255> buffer;
>+ CFIndex bundleNameLength = ::CFStringGetLength(bundleName);
>+ buffer.EnsureElemCapacity(bundleNameLength);
>+ ::CFStringGetCharacters(bundleName, CFRangeMake(0, bundleNameLength),
>+ buffer.get());
>+ _retval.Assign(buffer.get(), bundleNameLength);
>+ rv = NS_OK;
>+ ::CFRelease(bundleName);
Don't release the result of CFBundleGetValueForInfoDictionaryKey! It't not a
'create' or 'copy' call, so it doesn't return a retained value!
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #189769 -
Attachment is obsolete: true
Attachment #189802 -
Flags: superreview?(sfraser_bugs)
Attachment #189802 -
Flags: review?(jhpedemonte)
Assignee | ||
Comment 4•19 years ago
|
||
(In reply to comment #2)
> >+ if (err == noErr) {
> >+ CFBundleRef handlerBundle = ::CFBundleCreate(NULL, handlerBundleURL);
>
> Is this the right way to get the bundle given a URL? Seems a little weird.
AFAICT. As for using the bundle dictionary directly, this isn't really an option
- we should take care of (per-loacle) InfoPlist.strings.
Comment 5•19 years ago
|
||
Comment on attachment 189802 [details] [diff] [review]
v1.1
+ nsCAutoString scheme(aScheme);
+ CFStringRef schemeCFString = ::CFStringCreateWithBytes(kCFAllocatorDefault,
+ (const UInt8
*)scheme.get(),
+ scheme.Length(),
+
kCFStringEncodingUTF8,
+ false);
It might be better to just use |PromiseFlatString()|:
CFStringRef schemeCFString =
::CFStringCreateWithBytes(kCFAllocatorDefault,
(const UInt8*)
PromiseFlatString(aScheme).get(),
aScheme.Length(), kCFStringEncodingUTF8,
false);
+ // Since the public API (LSGetApplicationForURL) fails every now and then,
+ // we're using undocumented _LSCopyDefaultSchemeHandlerURL
Can you remind me again: in which circumstances did |LSGetApplicationForURL|
fail?
I take it his new patch fixes the leak described earlier?
Nit: Try to keep lines around 80 chars or less.
With those fixes, r=jhpedemonte.
Attachment #189802 -
Flags: review?(jhpedemonte) → review+
Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8b4?
Comment 6•19 years ago
|
||
Comment on attachment 189802 [details] [diff] [review]
v1.1
sr with the review comments addressed.
Attachment #189802 -
Flags: superreview?(sfraser_bugs) → superreview+
Assignee | ||
Updated•19 years ago
|
Attachment #189802 -
Flags: approval1.8b4?
Updated•19 years ago
|
Attachment #189802 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 7•19 years ago
|
||
(In reply to comment #5)
> Can you remind me again: in which circumstances did |LSGetApplicationForURL|
> fail?
The only obvious one is the case where your app is the defualt handler (at
least, it happens more often in this case). Sure, that's not an option here, but
there are were other cases it failed for me (in the mac shell service).
Assignee | ||
Comment 8•19 years ago
|
||
Checking in mac/nsOSHelperAppService.cpp;
/cvsroot/mozilla/uriloader/exthandler/mac/nsOSHelperAppService.cpp,v <--
nsOSHelperAppService.cpp
new revision: 1.44; previous revision: 1.43
done
Checking in mac/nsOSHelperAppService.h;
/cvsroot/mozilla/uriloader/exthandler/mac/nsOSHelperAppService.h,v <--
nsOSHelperAppService.h
new revision: 1.15; previous revision: 1.14
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8b4?
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•