Bug 1301091 - Make FlyWeb not use gNeckoParent. Fix WebSocketChannel handling of incoming requests to server-websocket. r=billm r=michal

This commit is contained in:
Kannan Vijayan 2016-09-09 13:41:32 -04:00
Родитель 28b6a770e1
Коммит df8950c7af
2 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -541,9 +541,15 @@ FlyWebPublishedServerParent::HandleEvent(nsIDOMEvent* aEvent)
uint64_t id = mNextRequestId++;
mPendingRequests.Put(id, request);
nsTArray<PNeckoParent*> neckoParents;
Manager()->ManagedPNeckoParent(neckoParents);
if (neckoParents.Length() != 1) {
MOZ_CRASH("Expected exactly 1 PNeckoParent instance per PNeckoChild");
}
RefPtr<TransportProviderParent> provider =
static_cast<TransportProviderParent*>(
mozilla::net::gNeckoParent->SendPTransportProviderConstructor());
neckoParents[0]->SendPTransportProviderConstructor());
IPCInternalRequest ipcReq;
request->ToIPC(&ipcReq);

Просмотреть файл

@ -85,12 +85,19 @@ WebSocketChannelParent::RecvAsyncOpen(const OptionalURIParams& aURI,
goto fail;
}
rv = loadInfo->GetOriginAttributes(&attrs);
if (NS_FAILED(rv)) {
goto fail;
}
if (loadInfo) {
rv = loadInfo->GetOriginAttributes(&attrs);
if (NS_FAILED(rv)) {
goto fail;
}
appId = attrs.mAppId;
appId = attrs.mAppId;
} else {
// If the WebSocket is a server-side socket, then
// loadInfo will be null (since it's an incoming connection).
// AppID is irrelevant in these circumstances.
appId = NECKO_UNKNOWN_APP_ID;
}
if (appId != NECKO_UNKNOWN_APP_ID &&
appId != NECKO_NO_APP_ID) {
gIOService->IsAppOffline(appId, &appOffline);