/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=4 sw=2 sts=2 et 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/. */
NS_IMETHODIMP
DataChannelParent::OnStartRequest(nsIRequest* aRequest) { // We don't have a way to prevent nsBaseChannel from calling AsyncOpen on // the created nsDataChannel. We don't have anywhere to send the data in the // parent, so abort the binding. return NS_BINDING_ABORTED;
}
nsAutoCString remoteType;
nsresult rv = GetRemoteType(remoteType); if (NS_FAILED(rv)) { return IPC_FAIL(this, "Failed to get remote type");
}
nsCOMPtr<nsILoadInfo> loadInfo;
rv = mozilla::ipc::LoadInfoArgsToLoadInfo(
aDataChannelInfo.loadInfo(), remoteType, getter_AddRefs(loadInfo)); if (NS_FAILED(rv)) { return IPC_FAIL(this, "Failed to deserialize LoadInfo");
}
// Re-create a data channel in the parent process to notify // data-channel-opened observers.
RefPtr<nsDataChannel> channel;
channel = new nsDataChannel(aDataChannelInfo.uri());
channel->SetLoadFlags(aDataChannelInfo.loadFlags());
channel->SetLoadInfo(loadInfo);
channel->SetContentType(aDataChannelInfo.contentType());
rv = channel->SetChannelId(aDataChannelInfo.channelId()); if (NS_FAILED(rv)) { return IPC_FAIL(this, "Failed to set channel id");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.