mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1892440 - Expose RequestObserversCalled attribute in nsIHttpChannel r=valentin,necko-reviewers
For WebDriver BiDi network interception we need to be able to modify the request as late as possible. This changeset exposes RequestObserversCalled to JS so that we can update it from the webdriver bidi codebase. Differential Revision: https://phabricator.services.mozilla.com/D208011
This commit is contained in:
parent
b8fdc6491d
commit
453b6d319c
@ -2297,6 +2297,19 @@ HttpBaseChannel::UpgradeToSecure() {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::GetRequestObserversCalled(bool* aCalled) {
|
||||
NS_ENSURE_ARG_POINTER(aCalled);
|
||||
*aCalled = LoadRequestObserversCalled();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::SetRequestObserversCalled(bool aCalled) {
|
||||
StoreRequestObserversCalled(aCalled);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::GetRequestContextID(uint64_t* aRCID) {
|
||||
NS_ENSURE_ARG_POINTER(aRCID);
|
||||
|
@ -228,6 +228,8 @@ class HttpBaseChannel : public nsHashPropertyBag,
|
||||
NS_IMETHOD GetRequestSucceeded(bool* aValue) override;
|
||||
NS_IMETHOD RedirectTo(nsIURI* newURI) override;
|
||||
NS_IMETHOD UpgradeToSecure() override;
|
||||
NS_IMETHOD GetRequestObserversCalled(bool* aCalled) override;
|
||||
NS_IMETHOD SetRequestObserversCalled(bool aCalled) override;
|
||||
NS_IMETHOD GetRequestContextID(uint64_t* aRCID) override;
|
||||
NS_IMETHOD GetTransferSize(uint64_t* aTransferSize) override;
|
||||
NS_IMETHOD GetRequestSize(uint64_t* aRequestSize) override;
|
||||
|
@ -246,6 +246,16 @@ NullHttpChannel::RedirectTo(nsIURI* aNewURI) {
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::UpgradeToSecure() { return NS_ERROR_NOT_IMPLEMENTED; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::GetRequestObserversCalled(bool* aCalled) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::SetRequestObserversCalled(bool aCalled) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NullHttpChannel::GetRequestContextID(uint64_t* _retval) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
@ -350,6 +350,16 @@ ObliviousHttpChannel::UpgradeToSecure() {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ObliviousHttpChannel::GetRequestObserversCalled(bool* aCalled) {
|
||||
return mInnerChannel->GetRequestObserversCalled(aCalled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ObliviousHttpChannel::SetRequestObserversCalled(bool aCalled) {
|
||||
return mInnerChannel->SetRequestObserversCalled(aCalled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ObliviousHttpChannel::GetRequestContextID(uint64_t* _retval) {
|
||||
return mInnerChannel->GetRequestContextID(_retval);
|
||||
|
@ -494,4 +494,12 @@ interface nsIHttpChannel : nsIIdentChannel
|
||||
[must_use] attribute AString classicScriptHintCharset;
|
||||
|
||||
[must_use] attribute AString documentCharacterSet;
|
||||
|
||||
/**
|
||||
* Update the requestObserversCalled boolean flag.
|
||||
*
|
||||
* Used by WebDriver BiDi network interception to modify properties of the
|
||||
* request such as `method` or `body` as late as possible.
|
||||
*/
|
||||
[must_use] attribute boolean requestObserversCalled;
|
||||
};
|
||||
|
@ -994,6 +994,18 @@ nsViewSourceChannel::UpgradeToSecure() {
|
||||
: mHttpChannel->UpgradeToSecure();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::GetRequestObserversCalled(bool* aCalled) {
|
||||
return !mHttpChannel ? NS_ERROR_NULL_POINTER
|
||||
: mHttpChannel->GetRequestObserversCalled(aCalled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::SetRequestObserversCalled(bool aCalled) {
|
||||
return !mHttpChannel ? NS_ERROR_NULL_POINTER
|
||||
: mHttpChannel->SetRequestObserversCalled(aCalled);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsViewSourceChannel::GetRequestContextID(uint64_t* _retval) {
|
||||
return !mHttpChannel ? NS_ERROR_NULL_POINTER
|
||||
|
Loading…
Reference in New Issue
Block a user