зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1532994: Part 2 - Support SetHref() and Replace() in RemoteLocationProxy. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D43328 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
773bf2d878
Коммит
4814bcf9a6
|
@ -1040,28 +1040,6 @@ already_AddRefed<BrowsingContext> BrowsingContext::IPCInitializer::GetOpener() {
|
|||
return opener.forget();
|
||||
}
|
||||
|
||||
void BrowsingContext::LocationProxy::SetHref(const nsAString& aHref,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aError) {
|
||||
nsPIDOMWindowOuter* win = GetBrowsingContext()->GetDOMWindow();
|
||||
if (!win || !win->GetLocation()) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
win->GetLocation()->SetHref(aHref, aSubjectPrincipal, aError);
|
||||
}
|
||||
|
||||
void BrowsingContext::LocationProxy::Replace(const nsAString& aUrl,
|
||||
nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aError) {
|
||||
nsPIDOMWindowOuter* win = GetBrowsingContext()->GetDOMWindow();
|
||||
if (!win || !win->GetLocation()) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
win->GetLocation()->Replace(aUrl, aSubjectPrincipal, aError);
|
||||
}
|
||||
|
||||
void BrowsingContext::StartDelayedAutoplayMediaComponents() {
|
||||
if (!mDocShell) {
|
||||
return;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "mozilla/Tuple.h"
|
||||
#include "mozilla/WeakPtr.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/LocationBase.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
@ -466,24 +467,23 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
|||
* process. It forwards all operations to its BrowsingContext and aggregates
|
||||
* its refcount to that BrowsingContext.
|
||||
*/
|
||||
class LocationProxy {
|
||||
class LocationProxy final : public LocationBase {
|
||||
public:
|
||||
MozExternalRefCountType AddRef() { return GetBrowsingContext()->AddRef(); }
|
||||
MozExternalRefCountType Release() {
|
||||
return GetBrowsingContext()->Release();
|
||||
}
|
||||
|
||||
void SetHref(const nsAString& aHref, nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aError);
|
||||
void Replace(const nsAString& aUrl, nsIPrincipal& aSubjectPrincipal,
|
||||
ErrorResult& aError);
|
||||
|
||||
private:
|
||||
protected:
|
||||
friend class RemoteLocationProxy;
|
||||
BrowsingContext* GetBrowsingContext() {
|
||||
BrowsingContext* GetBrowsingContext() override {
|
||||
return reinterpret_cast<BrowsingContext*>(
|
||||
uintptr_t(this) - offsetof(BrowsingContext, mLocation));
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocShell> GetDocShell() override {
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
// Ensure that opener is in the same BrowsingContextGroup.
|
||||
|
|
|
@ -49,6 +49,7 @@ nsDocShellLoadState::nsDocShellLoadState(DocShellLoadStateInit& aLoadState) {
|
|||
mOriginalFrameSrc = aLoadState.OriginalFrameSrc();
|
||||
mIsFormSubmission = aLoadState.IsFormSubmission();
|
||||
mLoadType = aLoadState.LoadType();
|
||||
mSrcdocData.SetIsVoid(true);
|
||||
mTarget = aLoadState.Target();
|
||||
mLoadFlags = aLoadState.LoadFlags();
|
||||
mFirstParty = aLoadState.FirstParty();
|
||||
|
|
|
@ -15,12 +15,10 @@ support-files =
|
|||
[test_crossdomainprops.html]
|
||||
[test_innerWidthHeight_script.html]
|
||||
[test_location.html]
|
||||
fail-if = fission
|
||||
[test_location_framed.html]
|
||||
[test_location_getters.html]
|
||||
[test_location_sandboxed.html]
|
||||
[test_location_setters.html]
|
||||
fail-if = fission
|
||||
[test_setting_document.domain_idn.html]
|
||||
fail-if = fission
|
||||
[test_setting_document.domain_to_shortened_ipaddr.html]
|
||||
|
|
|
@ -41,7 +41,6 @@ skip-if = toolkit == 'android'
|
|||
[test_localStorageOriginsSchemaDiffs.html]
|
||||
skip-if = toolkit == 'android' #TIMED_OUT
|
||||
[test_localStorageQuota.html]
|
||||
fail-if = fission
|
||||
skip-if = toolkit == 'android' #TIMED_OUT
|
||||
[test_localStorageQuotaSessionOnly.html]
|
||||
skip-if = toolkit == 'android' || (verify && (os == 'linux' || os == 'mac' || os == 'win')) #TIMED_OUT
|
||||
|
|
|
@ -47,7 +47,6 @@ support-files =
|
|||
[test_bug446584.html]
|
||||
[test_bug462428.html]
|
||||
[test_bug478438.html]
|
||||
fail-if = fission
|
||||
[test_bug500691.html]
|
||||
[test_bug504877.html]
|
||||
fail-if = fission
|
||||
|
|
Загрузка…
Ссылка в новой задаче