toolkit/components/remote/nsRemoteService.h
author Dave Townsend <dtownsend@oxymoronical.com>
Wed, 27 Feb 2019 15:45:51 -0800
changeset 462601 28c7186745e3d5de5f44a72a81e0068cb23ce547
parent 458363 9c647756b479f5e4e21a39f70ae8b2d9d7c4a803
child 462603 5373c5bb9ad5bb7c3af1cae390c3612be51176b5
permissions -rw-r--r--
Bug 1518639: Break out the remote server pieces from nsRemoteService and deCOMtaminate. r=jimm This code is only ever used from c++ so does not need to be an XPCOM component. Broken out a single nsRemoteService that is responsible for choosing the server implementation to use. Differential Revision: https://phabricator.services.mozilla.com/D19067

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __nsRemoteService_h__
#define __nsRemoteService_h__

#include "nsRemoteServer.h"
#include "nsIObserverService.h"
#include "nsIObserver.h"
#include "nsPIDOMWindow.h"
#include "mozilla/UniquePtr.h"

class nsRemoteService final : public nsIObserver {
 public:
  // We will be a static singleton, so don't use the ordinary methods.
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVER

  nsRemoteService() = default;

  void Startup(const char* aAppName, const char* aProfileName);
  void Shutdown();

 private:
  ~nsRemoteService();

  mozilla::UniquePtr<nsRemoteServer> mRemoteServer;
};

#endif  // __nsRemoteService_h__