Closed Bug 586334 Opened 14 years ago Closed 14 years ago

nsContentHandlerApp is not accessible from JavaScript

Categories

(Core Graveyard :: Widget: Qt, defect)

x86
Linux
defect
Not set
normal

Tracking

(fennec2.0+)

RESOLVED FIXED
Tracking Status
fennec 2.0+ ---

People

(Reporter: mjarvin, Assigned: mjarvin)

Details

Attachments

(1 file)

When maemo 6 build is made and following code is used from JavaScript, returned array contains only nulls. 

var mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
var mime = mimeService.getFromTypeAndExtension("audio/mp3", null);
var handlers = mime.possibleApplicationHandlers;

If there is handler for audio/mp3 array is filled correctly in nsMIMEInfoUnix::GetPossibleApplicationHandlers, but JavaScipt side sees only nulls instead of wrapped objects. This happens, because nsContentHandlerApp doesn't declare class info.
Added patch, which adds classinfo to nsContentHandlerApp.
Assignee: nobody → mjarvin
Attachment #464864 - Flags: review?(romaxa)
Comment on attachment 464864 [details] [diff] [review]
Patch which adds classinfo to nsContentHandlerApp

>-NS_IMPL_ISUPPORTS1(nsContentHandlerApp, nsIHandlerApp)
>+#define NS_CONTENTHANDLER_CID \
>+{ 0x43ec2c82, 0xb9db, 0x4835, {0x80, 0x3f, 0x64, 0xc9, 0x72, 0x5a, 0x70, 0x28 } }

I've found that all NS_*_CID's are declared in nsCExternalHandlerService.idl, does it make sense to move this declaration in the same place?

bsmedberg what do you think?

>+
>+NS_IMPL_CLASSINFO(nsContentHandlerApp, NULL, 0, NS_CONTENTHANDLER_CID)
>+NS_IMPL_ISUPPORTS1_CI(nsContentHandlerApp, nsIHandlerApp)
> 
This looks just ok, and similar to nsDBusHandlerApp.cpp...

Probably we should fix also android and other handlers in other bugs...
Comment on attachment 464864 [details] [diff] [review]
Patch which adds classinfo to nsContentHandlerApp

bsmedberg: CIDs shouldn't go in IDL files, normally..
Attachment #464864 - Flags: review?(romaxa) → review+
this is blocking fennec integrated feed support development (launching external feed application from fennec)
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0+
http://hg.mozilla.org/mozilla-central/rev/27c2719d5cad
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: