Closed Bug 1171560 Opened 9 years ago Closed 9 years ago

Stub out exthandler for iOS

Categories

(Core Graveyard :: File Handling, defect)

Unspecified
iOS
defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ted, Assigned: ted)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The exthandler/unix code doesn't build on iOS. I'm sure there's some useful implementation of this we can provide on iOS, but for now stubbing it out makes things build.
bug 1171560 - Stub out exthandler for iOS. r?smaug
Attachment #8616047 - Flags: review?(bugs)
Comment on attachment 8616047 [details]
MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?baku

Trying to reduce reviewing overload, and this is effectively just generic xpcom stuff - perhaps baku could review this.
(but please use Mozilla coding style)
Attachment #8616047 - Flags: review?(bugs) → review?(amarchesini)
Comment on attachment 8616047 [details]
MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?baku

https://reviewboard.mozilla.org/r/10407/#review9375

::: uriloader/exthandler/uikit/nsLocalHandlerAppUIKit.h:12
(Diff revision 1)
> +class nsLocalHandlerAppUIKit : public nsLocalHandlerApp {

class nsLocalHandlerAppUIKit final : public nsLocalHandlerApp
{
public:
  nsLocalHandlerAppUIKit() { }
  ...
  
  NS_IMETHOD LaunchWithURI(nsIURI* aURI,
                           nsIInterfaceRequestor* aWindowContext) override;
};

::: uriloader/exthandler/uikit/nsLocalHandlerAppUIKit.h:22
(Diff revision 1)
> +    virtual ~nsLocalHandlerAppUIKit() { }

next to the CTOR.

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.h:12
(Diff revision 1)
> +class nsMIMEInfoUIKit : public nsMIMEInfoImpl {

class nsMIMEInfoUIKit final : ...
\{
public:
  explicit nsMIMEInfoUIKit(const char\* aMIMEType)
    : nsMIMEInfoImpl(aMimeType)
  \{\}

  same style for the other ctor.

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.h:14
(Diff revision 1)
> +    explicit nsMIMEInfoUIKit(const char* aMIMEType = "") : nsMIMEInfoImpl(aMIMEType) {}

I think you can get rid of this ctor and use just the nsACString.

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.h:21
(Diff revision 1)
> +    virtual nsresult LoadUriInternal(nsIURI *aURI);

nsIURI* aURI

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.h:23
(Diff revision 1)
> +    virtual nsresult LaunchDefaultWithFile(nsIFile* aFile) {

{ in a new line.

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.h:28
(Diff revision 1)
> +    static nsresult OpenApplicationWithURI(nsIFile *aApplication,

nsIFile*

::: uriloader/exthandler/uikit/nsMIMEInfoUIKit.mm:11
(Diff revision 1)
> +nsMIMEInfoUIKit::LaunchWithFile(nsIFile *aFile)

nsIFile* aFile
same for nsIURI* aURI

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:18
(Diff revision 1)
> +class nsOSHelperAppService : public nsExternalHelperAppService

final

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:28
(Diff revision 1)
> +  NS_IMETHOD GetFromTypeAndExtension(const nsACString& aType, const nsACString& aFileExt, nsIMIMEInfo ** aMIMEInfo);

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:30
(Diff revision 1)
> +  NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString &aScheme,

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:38
(Diff revision 1)
> +  virtual nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile);

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:40
(Diff revision 1)
> +  nsresult OSProtocolHandlerExists(const char * aScheme,

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:28
(Diff revision 1)
> +nsOSHelperAppService::nsOSHelperAppService() : nsExternalHelperAppService()

nsOSHelperAppService::nsOSHelperAppService()
  : nsEx...

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:29
(Diff revision 1)
> +{

{}

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:35
(Diff revision 1)
> +nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists)

const char* aProtocolScheme, bool* aHandlerExists)

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:46
(Diff revision 1)
> +nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * aPlatformAppPath, nsIFile ** aFile)

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:51
(Diff revision 1)
> +NS_IMETHODIMP nsOSHelperAppService::GetFromTypeAndExtension(const nsACString& aType, const nsACString& aFileExt, nsIMIMEInfo ** aMIMEInfo)

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:59
(Diff revision 1)
> +                                        bool * aFound)

ditto

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:68
(Diff revision 1)
> +                                                   nsIHandlerInfo **_retval)

ditto
Attachment #8616047 - Flags: review?(amarchesini)
Comment on attachment 8616047 [details]
MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?baku

bug 1171560 - Stub out exthandler for iOS. r?baku
Attachment #8616047 - Attachment description: MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?smaug → MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?baku
Attachment #8616047 - Flags: review?(amarchesini)
I ran everything through `mach clang-format` and spot-checked the result, I think the formatting should be OK now. (That's what I get for copy-pasting from existing code...)
Comment on attachment 8616047 [details]
MozReview Request: bug 1171560 - Stub out exthandler for iOS. r?baku

https://reviewboard.mozilla.org/r/10407/#review18057

::: uriloader/exthandler/uikit/nsLocalHandlerAppUIKit.h:7
(Diff revision 2)
> +#ifndef NSLOCALHANDLERAPPUIKIT_H_

nslocalhandlerappuikit_h

::: uriloader/exthandler/uikit/nsLocalHandlerAppUIKit.h:14
(Diff revision 2)
> +

no extra line here.

::: uriloader/exthandler/uikit/nsLocalHandlerAppUIKit.h:18
(Diff revision 2)
> +  virtual ~nsLocalHandlerAppUIKit()

no virtual for final classes

::: uriloader/exthandler/uikit/nsOSHelperAppService.h:22
(Diff revision 2)
> +  virtual ~nsOSHelperAppService();

no virtual

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:8
(Diff revision 2)
> +#include "nsISupports.h"

I don't think you need:
nsISupports/nsString/nsTArray/nsURL/etc etc.
Just add what you need.

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:20
(Diff revision 2)
> +#include "nsEmbedCID.h"

put all these headers in alphabetic order.

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:25
(Diff revision 2)
> +#define HELPERAPPLAUNCHER_BUNDLE_URL "chrome://global/locale/helperAppLauncher.properties"

you don't use these 2 defines.

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:35
(Diff revision 2)
> +nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char* aProtocolScheme, bool* aHandlerExists)

nsresult
nsOSHelperAppService...

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:41
(Diff revision 2)
> +NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)

NS_IMETHODIMP
nsOSHelperAppService...

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:46
(Diff revision 2)
> +nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t* aPlatformAppPath, nsIFile** aFile)

nsresult in a separate line.

::: uriloader/exthandler/uikit/nsOSHelperAppService.mm:51
(Diff revision 2)
> +NS_IMETHODIMP nsOSHelperAppService::GetFromTypeAndExtension(const nsACString& aType, const nsACString& aFileExt, nsIMIMEInfo** aMIMEInfo)

1. 80chars max here and in the rest of the file.
2. NS_IMETHODIMP in a separate line.
Attachment #8616047 - Flags: review?(amarchesini) → review+
https://hg.mozilla.org/mozilla-central/rev/50de26148bc6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: