2015-03-26 06:16:21 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2017-10-27 01:08:41 +03:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-03-26 06:16:21 +03:00
|
|
|
/* 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 mozilla_dom_PresentationIPCService_h
|
|
|
|
#define mozilla_dom_PresentationIPCService_h
|
|
|
|
|
2016-05-25 03:19:00 +03:00
|
|
|
#include "mozilla/dom/PresentationServiceBase.h"
|
2016-11-08 06:13:00 +03:00
|
|
|
#include "nsIPresentationListener.h"
|
2016-06-03 06:03:27 +03:00
|
|
|
#include "nsIPresentationSessionTransport.h"
|
2015-03-26 06:16:21 +03:00
|
|
|
#include "nsIPresentationService.h"
|
|
|
|
|
2015-03-30 10:46:11 +03:00
|
|
|
class nsIDocShell;
|
|
|
|
|
2015-03-26 06:16:21 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2015-09-14 05:39:57 +03:00
|
|
|
class PresentationIPCRequest;
|
2016-06-03 06:03:27 +03:00
|
|
|
class PresentationContentSessionInfo;
|
2015-03-30 10:46:11 +03:00
|
|
|
class PresentationResponderLoadingCallback;
|
2015-03-26 06:16:21 +03:00
|
|
|
|
2016-09-29 00:35:00 +03:00
|
|
|
class PresentationIPCService final
|
2016-11-08 06:13:00 +03:00
|
|
|
: public nsIPresentationAvailabilityListener
|
|
|
|
, public nsIPresentationService
|
2016-09-29 00:35:00 +03:00
|
|
|
, public PresentationServiceBase<PresentationContentSessionInfo>
|
2015-03-26 06:16:21 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-09-29 00:35:00 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
2016-11-08 06:13:00 +03:00
|
|
|
NS_DECL_NSIPRESENTATIONAVAILABILITYLISTENER
|
2015-03-26 06:16:21 +03:00
|
|
|
NS_DECL_NSIPRESENTATIONSERVICE
|
|
|
|
|
|
|
|
PresentationIPCService();
|
|
|
|
|
|
|
|
nsresult NotifySessionStateChange(const nsAString& aSessionId,
|
2016-05-30 09:48:00 +03:00
|
|
|
uint16_t aState,
|
|
|
|
nsresult aReason);
|
2015-03-26 06:16:21 +03:00
|
|
|
|
2015-03-30 10:46:11 +03:00
|
|
|
nsresult NotifyMessage(const nsAString& aSessionId,
|
2016-09-18 02:42:00 +03:00
|
|
|
const nsACString& aData,
|
|
|
|
const bool& aIsBinary);
|
2015-03-26 06:16:21 +03:00
|
|
|
|
2015-09-10 11:29:08 +03:00
|
|
|
nsresult NotifySessionConnect(uint64_t aWindowId,
|
|
|
|
const nsAString& aSessionId);
|
|
|
|
|
2015-03-26 06:16:21 +03:00
|
|
|
void NotifyPresentationChildDestroyed();
|
|
|
|
|
2015-03-30 10:46:11 +03:00
|
|
|
nsresult MonitorResponderLoading(const nsAString& aSessionId,
|
|
|
|
nsIDocShell* aDocShell);
|
|
|
|
|
2016-06-03 06:03:27 +03:00
|
|
|
nsresult NotifySessionTransport(const nsString& aSessionId,
|
|
|
|
const uint8_t& aRole,
|
|
|
|
nsIPresentationSessionTransport* transport);
|
|
|
|
|
2016-09-29 00:35:00 +03:00
|
|
|
nsresult CloseContentSessionTransport(const nsString& aSessionId,
|
|
|
|
uint8_t aRole,
|
|
|
|
nsresult aReason);
|
|
|
|
|
2015-03-26 06:16:21 +03:00
|
|
|
private:
|
|
|
|
virtual ~PresentationIPCService();
|
|
|
|
nsresult SendRequest(nsIPresentationServiceCallback* aCallback,
|
2015-09-14 05:39:57 +03:00
|
|
|
const PresentationIPCRequest& aRequest);
|
2015-03-26 06:16:21 +03:00
|
|
|
|
2016-06-03 06:03:27 +03:00
|
|
|
nsRefPtrHashtable<nsStringHashKey,
|
|
|
|
nsIPresentationSessionListener> mSessionListeners;
|
|
|
|
nsRefPtrHashtable<nsUint64HashKey,
|
|
|
|
nsIPresentationRespondingListener> mRespondingListeners;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<PresentationResponderLoadingCallback> mCallback;
|
2015-03-26 06:16:21 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_PresentationIPCService_h
|