mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1921119 - Add canceledReason to RemoteWebProgressRequest r=nika
The canceledReason is added to the RequestData used to build the RemoteWebProgressRequest. This canceledReason is useful for consumers such as WebDriverBiDi which need to emit different error messages depending on the reason why a specific navigation request was canceled. Differential Revision: https://phabricator.services.mozilla.com/D223174
This commit is contained in:
parent
0836ed262c
commit
4f0b654a19
@ -3890,6 +3890,9 @@ nsresult BrowserChild::PrepareRequestData(nsIRequest* aRequest,
|
||||
getter_AddRefs(aRequestData.originalRequestURI()));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = channel->GetCanceledReason(aRequestData.canceledReason());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel);
|
||||
if (classifiedChannel) {
|
||||
rv = classifiedChannel->GetMatchedList(aRequestData.matchedList());
|
||||
|
@ -2958,6 +2958,7 @@ mozilla::ipc::IPCResult BrowserParent::RecvOnStateChange(
|
||||
request = MakeAndAddRef<RemoteWebProgressRequest>(
|
||||
aRequestData.requestURI(), aRequestData.originalRequestURI(),
|
||||
aRequestData.matchedList());
|
||||
request->SetCanceledReason(aRequestData.canceledReason());
|
||||
}
|
||||
|
||||
if (aStateChangeData.isSome()) {
|
||||
@ -3017,6 +3018,7 @@ mozilla::ipc::IPCResult BrowserParent::RecvOnLocationChange(
|
||||
request = MakeAndAddRef<RemoteWebProgressRequest>(
|
||||
aRequestData.requestURI(), aRequestData.originalRequestURI(),
|
||||
aRequestData.matchedList());
|
||||
request->SetCanceledReason(aRequestData.canceledReason());
|
||||
}
|
||||
|
||||
browsingContext->SetCurrentRemoteURI(aLocation);
|
||||
@ -3124,6 +3126,7 @@ mozilla::ipc::IPCResult BrowserParent::RecvNotifyContentBlockingEvent(
|
||||
nsCOMPtr<nsIRequest> request = MakeAndAddRef<RemoteWebProgressRequest>(
|
||||
aRequestData.requestURI(), aRequestData.originalRequestURI(),
|
||||
aRequestData.matchedList());
|
||||
request->SetCanceledReason(aRequestData.canceledReason());
|
||||
|
||||
wgp->NotifyContentBlockingEvent(
|
||||
aEvent, request, aBlocked, aTrackingOrigin, aTrackingFullHashes, aReason,
|
||||
|
@ -127,6 +127,7 @@ struct RequestData
|
||||
nullable nsIURI requestURI;
|
||||
nullable nsIURI originalRequestURI;
|
||||
nsCString matchedList;
|
||||
nsCString canceledReason;
|
||||
};
|
||||
|
||||
struct WebProgressStateChangeData
|
||||
|
Loading…
Reference in New Issue
Block a user