2015-03-25 14:47:56 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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_PresentationService_h
|
|
|
|
#define mozilla_dom_PresentationService_h
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIObserver.h"
|
2016-05-25 03:19:00 +03:00
|
|
|
#include "PresentationServiceBase.h"
|
2015-03-25 14:47:56 +03:00
|
|
|
#include "PresentationSessionInfo.h"
|
|
|
|
|
2015-03-30 10:46:11 +03:00
|
|
|
class nsIPresentationSessionRequest;
|
2016-06-14 10:15:07 +03:00
|
|
|
class nsIPresentationTerminateRequest;
|
2015-03-30 10:46:11 +03:00
|
|
|
class nsIURI;
|
2016-06-03 06:03:27 +03:00
|
|
|
class nsIPresentationSessionTransportBuilder;
|
2015-03-30 10:46:11 +03:00
|
|
|
|
2015-03-25 14:47:56 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2016-05-30 00:01:00 +03:00
|
|
|
class PresentationDeviceRequest;
|
2015-09-10 11:29:08 +03:00
|
|
|
class PresentationRespondingInfo;
|
|
|
|
|
2016-09-29 00:35:00 +03:00
|
|
|
class PresentationService final
|
|
|
|
: public nsIPresentationService
|
|
|
|
, public nsIObserver
|
|
|
|
, public PresentationServiceBase<PresentationSessionInfo>
|
2015-03-25 14:47:56 +03:00
|
|
|
{
|
|
|
|
public:
|
2016-09-29 00:35:00 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
2015-03-25 14:47:56 +03:00
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSIPRESENTATIONSERVICE
|
|
|
|
|
|
|
|
PresentationService();
|
|
|
|
bool Init();
|
|
|
|
|
2015-08-31 08:24:35 +03:00
|
|
|
bool IsSessionAccessible(const nsAString& aSessionId,
|
2016-04-18 03:19:00 +03:00
|
|
|
const uint8_t aRole,
|
2015-08-31 08:24:35 +03:00
|
|
|
base::ProcessId aProcessId);
|
2015-03-30 09:27:27 +03:00
|
|
|
|
2015-03-25 14:47:56 +03:00
|
|
|
private:
|
2016-05-30 00:01:00 +03:00
|
|
|
friend class PresentationDeviceRequest;
|
|
|
|
|
2016-05-25 03:19:00 +03:00
|
|
|
virtual ~PresentationService();
|
2015-03-30 09:27:27 +03:00
|
|
|
void HandleShutdown();
|
2016-11-08 06:13:00 +03:00
|
|
|
nsresult HandleDeviceAdded(nsIPresentationDevice* aDevice);
|
|
|
|
nsresult HandleDeviceRemoved();
|
2015-03-30 10:46:11 +03:00
|
|
|
nsresult HandleSessionRequest(nsIPresentationSessionRequest* aRequest);
|
2016-06-14 10:15:07 +03:00
|
|
|
nsresult HandleTerminateRequest(nsIPresentationTerminateRequest* aRequest);
|
2016-08-02 20:11:00 +03:00
|
|
|
nsresult HandleReconnectRequest(nsIPresentationSessionRequest* aRequest);
|
2015-03-25 14:47:56 +03:00
|
|
|
|
2016-05-30 00:01:00 +03:00
|
|
|
// This is meant to be called by PresentationDeviceRequest.
|
|
|
|
already_AddRefed<PresentationSessionInfo>
|
|
|
|
CreateControllingSessionInfo(const nsAString& aUrl,
|
|
|
|
const nsAString& aSessionId,
|
|
|
|
uint64_t aWindowId);
|
|
|
|
|
2016-11-08 06:13:00 +03:00
|
|
|
// Emumerate all devices to get the availability of each input Urls.
|
|
|
|
nsresult UpdateAvailabilityUrlChange(
|
|
|
|
const nsTArray<nsString>& aAvailabilityUrls);
|
2015-03-25 14:47:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_PresentationService_h
|