зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1398733 - nsILinkHandler::OnLinkClick and OnLinkClickSync should know the post data inputStream length, r=smaug
This commit is contained in:
Родитель
3a42475049
Коммит
cee83bc968
|
@ -14185,6 +14185,7 @@ public:
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aNoOpenerImplied,
|
||||
bool aIsTrusted,
|
||||
|
@ -14203,8 +14204,8 @@ public:
|
|||
if (mIsTrusted || jsapi.Init(mContent->OwnerDoc()->GetScopeObject())) {
|
||||
mHandler->OnLinkClickSync(mContent, mURI,
|
||||
mTargetSpec.get(), mFileName,
|
||||
mPostDataStream, mHeadersDataStream,
|
||||
mNoOpenerImplied,
|
||||
mPostDataStream, mPostDataStreamLength,
|
||||
mHeadersDataStream, mNoOpenerImplied,
|
||||
nullptr, nullptr, mTriggeringPrincipal);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -14216,6 +14217,7 @@ private:
|
|||
nsString mTargetSpec;
|
||||
nsString mFileName;
|
||||
nsCOMPtr<nsIInputStream> mPostDataStream;
|
||||
int64_t mPostDataStreamLength;
|
||||
nsCOMPtr<nsIInputStream> mHeadersDataStream;
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
PopupControlState mPopupState;
|
||||
|
@ -14230,6 +14232,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsDocShell* aHandler,
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aNoOpenerImplied,
|
||||
bool aIsTrusted,
|
||||
|
@ -14240,6 +14243,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsDocShell* aHandler,
|
|||
, mTargetSpec(aTargetSpec)
|
||||
, mFileName(aFileName)
|
||||
, mPostDataStream(aPostDataStream)
|
||||
, mPostDataStreamLength(aPostDataStreamLength)
|
||||
, mHeadersDataStream(aHeadersDataStream)
|
||||
, mContent(aContent)
|
||||
, mPopupState(mHandler->mScriptGlobal->GetPopupControlState())
|
||||
|
@ -14255,6 +14259,7 @@ nsDocShell::OnLinkClick(nsIContent* aContent,
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aIsTrusted,
|
||||
nsIPrincipal* aTriggeringPrincipal)
|
||||
|
@ -14300,7 +14305,8 @@ nsDocShell::OnLinkClick(nsIContent* aContent,
|
|||
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new OnLinkClickEvent(this, aContent, aURI, target.get(), aFileName,
|
||||
aPostDataStream, aHeadersDataStream, noOpenerImplied,
|
||||
aPostDataStream, aPostDataStreamLength,
|
||||
aHeadersDataStream, noOpenerImplied,
|
||||
aIsTrusted, aTriggeringPrincipal);
|
||||
return DispatchToTabGroup(TaskCategory::UI, ev.forget());
|
||||
}
|
||||
|
@ -14311,6 +14317,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aNoOpenerImplied,
|
||||
nsIDocShell** aDocShell,
|
||||
|
@ -14460,7 +14467,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
|
|||
NS_LossyConvertUTF16toASCII(typeHint).get(),
|
||||
aFileName, // Download as file
|
||||
aPostDataStream, // Post data stream
|
||||
-1, // Post data stream length XXXbaku
|
||||
aPostDataStreamLength, // Post data stream length
|
||||
aHeadersDataStream, // Headers stream
|
||||
LOAD_LINK, // Load type
|
||||
nullptr, // No SHEntry
|
||||
|
|
|
@ -210,6 +210,7 @@ public:
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aIsTrusted,
|
||||
nsIPrincipal* aTriggeringPrincipal) override;
|
||||
|
@ -218,6 +219,7 @@ public:
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
int64_t aPostDataStreamLength = -1,
|
||||
nsIInputStream* aHeadersDataStream = 0,
|
||||
bool aNoOpenerImplied = false,
|
||||
nsIDocShell** aDocShell = 0,
|
||||
|
|
|
@ -33,8 +33,10 @@ public:
|
|||
* @param aURI a URI object that defines the destination for the link
|
||||
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
||||
* string)
|
||||
* @param aPostDataStream the POST data to send
|
||||
* @param aFileName non-null when the link should be downloaded as the given file
|
||||
* @param aPostDataStream the POST data to send
|
||||
* @param aPostDataStreamLength the POST data length. Use -1 if the length is
|
||||
* unknown.
|
||||
* @param aHeadersDataStream ???
|
||||
* @param aIsTrusted false if the triggerer is an untrusted DOM event.
|
||||
* @param aTriggeringPrincipal, if not passed explicitly we fall back to
|
||||
|
@ -45,6 +47,7 @@ public:
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream,
|
||||
int64_t aPostDataStreamLength,
|
||||
nsIInputStream* aHeadersDataStream,
|
||||
bool aIsTrusted,
|
||||
nsIPrincipal* aTriggeringPrincipal) = 0;
|
||||
|
@ -61,6 +64,7 @@ public:
|
|||
* string)
|
||||
* @param aFileName non-null when the link should be downloaded as the given file
|
||||
* @param aPostDataStream the POST data to send
|
||||
* @param aPostDataStreamLength the POST data length
|
||||
* @param aHeadersDataStream ???
|
||||
* @param aNoOpenerImplied if the link implies "noopener"
|
||||
* @param aDocShell (out-param) the DocShell that the request was opened on
|
||||
|
@ -73,6 +77,7 @@ public:
|
|||
const char16_t* aTargetSpec,
|
||||
const nsAString& aFileName,
|
||||
nsIInputStream* aPostDataStream = 0,
|
||||
int64_t aPostDataStreamLength = -1,
|
||||
nsIInputStream* aHeadersDataStream = 0,
|
||||
bool aNoOpenerImplied = false,
|
||||
nsIDocShell** aDocShell = 0,
|
||||
|
|
|
@ -5550,7 +5550,8 @@ nsContentUtils::TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
|
|||
|
||||
handler->OnLinkClick(aContent, aLinkURI,
|
||||
fileName.IsVoid() ? aTargetSpec.get() : EmptyString().get(),
|
||||
fileName, nullptr, nullptr, aIsTrusted, aContent->NodePrincipal());
|
||||
fileName, nullptr, -1, nullptr, aIsTrusted,
|
||||
aContent->NodePrincipal());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -803,7 +803,8 @@ HTMLFormElement::SubmitSubmission(HTMLFormSubmission* aFormSubmission)
|
|||
rv = linkHandler->OnLinkClickSync(this, actionURI,
|
||||
target.get(),
|
||||
VoidString(),
|
||||
postDataStream, nullptr, false,
|
||||
postDataStream, -1 /* XXXbaku */,
|
||||
nullptr, false,
|
||||
getter_AddRefs(docShell),
|
||||
getter_AddRefs(mSubmittingRequest));
|
||||
NS_ENSURE_SUBMIT_SUCCESS(rv);
|
||||
|
|
|
@ -492,7 +492,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
|
|||
}
|
||||
|
||||
rv = lh->OnLinkClick(content, uri, unitarget.get(), VoidString(),
|
||||
aPostStream, headersDataStream, true, triggeringPrincipal);
|
||||
aPostStream, -1, headersDataStream, true, triggeringPrincipal);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче