Bug 1890689 apply drift correction to input rate instead of output rate r=pehrsons
[gecko.git] / uriloader / exthandler / nsLocalHandlerApp.h
blobebe43f7dcb49b8b884cc81dc01295dc013296486
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:cin:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __nsLocalHandlerAppImpl_h__
8 #define __nsLocalHandlerAppImpl_h__
10 #include "nsString.h"
11 #include "nsIMIMEInfo.h"
12 #include "nsIFile.h"
13 #include "nsTArray.h"
15 #include <functional>
17 class nsLocalHandlerApp : public nsILocalHandlerApp {
18 public:
19 NS_DECL_ISUPPORTS
20 NS_DECL_NSIHANDLERAPP
21 NS_DECL_NSILOCALHANDLERAPP
23 nsLocalHandlerApp() {}
25 nsLocalHandlerApp(const char16_t* aName, nsIFile* aExecutable)
26 : mName(aName), mExecutable(aExecutable) {}
28 nsLocalHandlerApp(const nsAString& aName, nsIFile* aExecutable)
29 : mName(aName), mExecutable(aExecutable) {}
31 protected:
32 virtual ~nsLocalHandlerApp() {}
34 virtual std::function<nsresult(nsString&)>
35 GetPrettyNameOnNonMainThreadCallback();
37 nsString mName;
38 nsString mDetailedDescription;
39 nsTArray<nsString> mParameters;
40 nsCOMPtr<nsIFile> mExecutable;
42 /**
43 * Launches this application with a single argument (typically either
44 * a file path or a URI spec). This is meant as a helper method for
45 * implementations of (e.g.) LaunchWithURI.
47 * @param aApp The application to launch (may not be null)
48 * @param aArg The argument to pass on the command line
50 nsresult LaunchWithIProcess(const nsCString& aArg);
53 // any platforms that need a platform-specific class instead of just
54 // using nsLocalHandlerApp need to add an include and a typedef here.
55 #ifdef XP_MACOSX
56 # ifndef NSLOCALHANDLERAPPMAC_H_
57 # include "mac/nsLocalHandlerAppMac.h"
58 typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t;
59 # endif
60 #elif XP_WIN
61 # ifndef NSLOCALHANDLERAPPWIN_H_
62 # include "win/nsLocalHandlerAppWin.h"
63 typedef nsLocalHandlerAppWin PlatformLocalHandlerApp_t;
64 # endif
65 #else
66 typedef nsLocalHandlerApp PlatformLocalHandlerApp_t;
67 #endif
69 #endif // __nsLocalHandlerAppImpl_h__