Backed out changeset 48baafc34055 (bug 1789166) for causing mochitests failures....
[gecko.git] / toolkit / components / remote / nsRemoteService.h
blob3105913a7f3f0b70f410ccbae0ac143d10d8c282
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:expandtab:shiftwidth=2:tabstop=2:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef TOOLKIT_COMPONENTS_REMOTE_NSREMOTESERVER_H_
9 #define TOOLKIT_COMPONENTS_REMOTE_NSREMOTESERVER_H_
11 #include "nsRemoteServer.h"
12 #include "nsIObserver.h"
13 #include "mozilla/UniquePtr.h"
14 #include "nsIFile.h"
15 #include "nsProfileLock.h"
17 enum RemoteResult {
18 REMOTE_NOT_FOUND = 0,
19 REMOTE_FOUND = 1,
20 REMOTE_ARG_BAD = 2
23 class nsRemoteService final : public nsIObserver {
24 public:
25 // We will be a static singleton, so don't use the ordinary methods.
26 NS_DECL_ISUPPORTS
27 NS_DECL_NSIOBSERVER
29 explicit nsRemoteService(const char* aProgram);
30 void SetProfile(nsACString& aProfile);
32 void LockStartup();
33 void UnlockStartup();
35 RemoteResult StartClient(const char* aStartupToken);
36 void StartupServer();
37 void ShutdownServer();
39 private:
40 ~nsRemoteService();
42 mozilla::UniquePtr<nsRemoteServer> mRemoteServer;
43 nsProfileLock mRemoteLock;
44 nsCOMPtr<nsIFile> mRemoteLockDir;
45 nsCString mProgram;
46 nsCString mProfile;
49 #endif // TOOLKIT_COMPONENTS_REMOTE_NSREMOTESERVER_H_