mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1310436 - Remove support for verifying the presence of app in the presentation API; r=baku
This commit is contained in:
parent
ceb6c867f9
commit
80ad2ce758
@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
#include "ipc/PresentationIPCService.h"
|
#include "ipc/PresentationIPCService.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozIApplication.h"
|
|
||||||
#include "nsGlobalWindow.h"
|
#include "nsGlobalWindow.h"
|
||||||
#include "nsIAppsService.h"
|
|
||||||
#include "nsIMutableArray.h"
|
#include "nsIMutableArray.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsIPresentationControlChannel.h"
|
#include "nsIPresentationControlChannel.h"
|
||||||
@ -445,28 +443,6 @@ PresentationService::HandleSessionRequest(nsIPresentationSessionRequest* aReques
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GONK
|
|
||||||
// Verify the existence of the app if necessary.
|
|
||||||
nsCOMPtr<nsIURI> uri;
|
|
||||||
rv = NS_NewURI(getter_AddRefs(uri), url);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
ctrlChannel->Disconnect(NS_ERROR_DOM_BAD_URI);
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isApp;
|
|
||||||
rv = uri->SchemeIs("app", &isApp);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
ctrlChannel->Disconnect(rv);
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NS_WARN_IF(isApp && !IsAppInstalled(uri))) {
|
|
||||||
ctrlChannel->Disconnect(NS_ERROR_DOM_NOT_FOUND_ERR);
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Create or reuse session info.
|
// Create or reuse session info.
|
||||||
RefPtr<PresentationSessionInfo> info =
|
RefPtr<PresentationSessionInfo> info =
|
||||||
GetSessionInfo(sessionId, nsIPresentationService::ROLE_RECEIVER);
|
GetSessionInfo(sessionId, nsIPresentationService::ROLE_RECEIVER);
|
||||||
@ -632,33 +608,6 @@ PresentationService::NotifyAvailableChange(bool aIsAvailable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
PresentationService::IsAppInstalled(nsIURI* aUri)
|
|
||||||
{
|
|
||||||
nsAutoCString prePath;
|
|
||||||
nsresult rv = aUri->GetPrePath(prePath);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsAutoString manifestUrl;
|
|
||||||
AppendUTF8toUTF16(prePath, manifestUrl);
|
|
||||||
manifestUrl.AppendLiteral("/manifest.webapp");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAppsService> appsService = do_GetService(APPS_SERVICE_CONTRACTID);
|
|
||||||
if (NS_WARN_IF(!appsService)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<mozIApplication> app;
|
|
||||||
appsService->GetAppByManifestURL(manifestUrl, getter_AddRefs(app));
|
|
||||||
if (NS_WARN_IF(!app)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
PresentationService::StartSession(
|
PresentationService::StartSession(
|
||||||
const nsTArray<nsString>& aUrls,
|
const nsTArray<nsString>& aUrls,
|
||||||
|
@ -51,7 +51,6 @@ private:
|
|||||||
nsresult HandleTerminateRequest(nsIPresentationTerminateRequest* aRequest);
|
nsresult HandleTerminateRequest(nsIPresentationTerminateRequest* aRequest);
|
||||||
nsresult HandleReconnectRequest(nsIPresentationSessionRequest* aRequest);
|
nsresult HandleReconnectRequest(nsIPresentationSessionRequest* aRequest);
|
||||||
void NotifyAvailableChange(bool aIsAvailable);
|
void NotifyAvailableChange(bool aIsAvailable);
|
||||||
bool IsAppInstalled(nsIURI* aUri);
|
|
||||||
|
|
||||||
// This is meant to be called by PresentationDeviceRequest.
|
// This is meant to be called by PresentationDeviceRequest.
|
||||||
already_AddRefed<PresentationSessionInfo>
|
already_AddRefed<PresentationSessionInfo>
|
||||||
|
Loading…
Reference in New Issue
Block a user