Backed out changeset ce4f02a4ad1e (bug 1843239) for causing multiple failures. CLOSED TREE

This commit is contained in:
Stanca Serban 2023-07-31 19:06:51 +03:00
Родитель db3121c9bc
Коммит 5c30ffc25e
7 изменённых файлов: 8 добавлений и 58 удалений

Просмотреть файл

@ -616,7 +616,6 @@ void BrowsingContext::SetDocShell(nsIDocShell* aDocShell) {
}
RecomputeCanExecuteScripts();
ClearCachedValuesOfLocations();
}
// This class implements a callback that will return the remote window proxy for
@ -1048,8 +1047,6 @@ void BrowsingContext::PrepareForProcessChange() {
mIsInProcess = false;
mUserGestureStart = TimeStamp();
ClearCachedValuesOfLocations();
// NOTE: For now, clear our nsDocShell reference, as we're primarily in a
// different process now. This may need to change in the future with
// Cross-Process BFCache.
@ -1416,9 +1413,6 @@ BrowsingContext::~BrowsingContext() {
sBrowsingContexts->Remove(Id());
}
UnregisterBrowserId(this);
ClearCachedValuesOfLocations();
mLocations.clear();
}
/* static */
@ -3759,17 +3753,6 @@ void BrowsingContext::ResetLocationChangeRateLimit() {
mLocationChangeRateLimitSpanStart = TimeStamp();
}
void BrowsingContext::LocationCreated(dom::Location* aLocation) {
MOZ_ASSERT(!aLocation->isInList());
mLocations.insertBack(aLocation);
}
void BrowsingContext::ClearCachedValuesOfLocations() {
for (dom::Location* loc = mLocations.getFirst(); loc; loc = loc->getNext()) {
loc->ClearCachedValues();
}
}
} // namespace dom
namespace ipc {

Просмотреть файл

@ -68,7 +68,6 @@ class ChildSHistory;
class ContentParent;
class Element;
struct LoadingSessionHistoryInfo;
class Location;
template <typename>
struct Nullable;
template <typename T>
@ -949,9 +948,6 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
return GetIsUnderHiddenEmbedderElement();
}
void LocationCreated(dom::Location* aLocation);
void ClearCachedValuesOfLocations();
protected:
virtual ~BrowsingContext();
BrowsingContext(WindowContext* aParentWindow, BrowsingContextGroup* aGroup,
@ -1410,8 +1406,6 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
// Used by CheckLocationChangeRateLimit. Do not apply cross-process.
uint32_t mLocationChangeRateLimitCount;
mozilla::TimeStamp mLocationChangeRateLimitSpanStart;
mozilla::LinkedList<dom::Location> mLocations;
};
/**

Просмотреть файл

@ -1550,7 +1550,7 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
mTitleValidForCurrentURI = false;
}
SetCurrentURIInternal(aURI);
mCurrentURI = aURI;
#ifdef DEBUG
mLastOpenedURI = aURI;
@ -1576,13 +1576,6 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
return !aFireOnLocationChange;
}
void nsDocShell::SetCurrentURIInternal(nsIURI* aURI) {
mCurrentURI = aURI;
if (mBrowsingContext) {
mBrowsingContext->ClearCachedValuesOfLocations();
}
}
NS_IMETHODIMP
nsDocShell::GetCharset(nsACString& aCharset) {
aCharset.Truncate();
@ -4574,7 +4567,7 @@ nsDocShell::Destroy() {
nsDocLoader::Destroy();
mParentWidget = nullptr;
SetCurrentURIInternal(nullptr);
mCurrentURI = nullptr;
if (mScriptGlobal) {
mScriptGlobal->DetachFromDocShell(!mWillChangeProcess);
@ -8189,7 +8182,7 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer,
viewer->Close(nullptr);
viewer->Destroy();
mContentViewer = nullptr;
SetCurrentURIInternal(nullptr);
mCurrentURI = nullptr;
NS_WARNING("ContentViewer Initialization failed");
return NS_ERROR_FAILURE;
}

Просмотреть файл

@ -1160,10 +1160,7 @@ class nsDocShell final : public nsDocLoader,
const nsAString& aTitle, bool aReplace,
nsIURI* aCurrentURI, bool aEqualURIs);
private:
void SetCurrentURIInternal(nsIURI* aURI);
// data members
private: // data members
nsString mTitle;
nsCString mOriginalUriString;
nsTObserverArray<nsWeakPtr> mPrivacyObservers;
@ -1208,7 +1205,6 @@ class nsDocShell final : public nsDocLoader,
mozilla::UniquePtr<mozilla::ObservedDocShell> mObserved;
// mCurrentURI should be marked immutable on set if possible.
// Change mCurrentURI only through SetCurrentURIInternal method.
nsCOMPtr<nsIURI> mCurrentURI;
nsCOMPtr<nsIReferrerInfo> mReferrerInfo;

Просмотреть файл

@ -42,18 +42,13 @@ namespace mozilla::dom {
Location::Location(nsPIDOMWindowInner* aWindow,
BrowsingContext* aBrowsingContext)
: mInnerWindow(aWindow) {
// aBrowsingContext can be null if it gets called after nsDocShell::Destroy().
// aBrowsingContext can be null if it gets called after nsDocShell::Destory().
if (aBrowsingContext) {
mBrowsingContextId = aBrowsingContext->Id();
aBrowsingContext->LocationCreated(this);
}
}
Location::~Location() {
if (isInList()) {
remove();
}
}
Location::~Location() = default;
// QueryInterface implementation for Location
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Location)
@ -651,8 +646,4 @@ JSObject* Location::WrapObject(JSContext* aCx,
return Location_Binding::Wrap(aCx, this, aGivenProto);
}
void Location::ClearCachedValues() {
Location_Binding::ClearCachedHashValue(this);
}
} // namespace mozilla::dom

Просмотреть файл

@ -9,7 +9,6 @@
#include "js/TypeDecls.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/LinkedList.h"
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/LocationBase.h"
#include "nsCycleCollectionParticipant.h"
@ -29,8 +28,7 @@ namespace mozilla::dom {
class Location final : public nsISupports,
public LocationBase,
public nsWrapperCache,
public LinkedListElement<Location> {
public nsWrapperCache {
public:
typedef BrowsingContext::LocationProxy RemoteProxy;
@ -112,8 +110,6 @@ class Location final : public nsISupports,
nsresult ToString(nsAString& aString) { return GetHref(aString); }
void ClearCachedValues();
protected:
virtual ~Location();

Просмотреть файл

@ -11,9 +11,6 @@
* and create derivative works of this document.
*/
// Consider to cache more attributes, if the getters show up badly in
// the performance profiles.
[LegacyUnforgeable,
Exposed=Window]
interface Location {
@ -33,7 +30,7 @@ interface Location {
attribute USVString pathname;
[Throws, NeedsSubjectPrincipal]
attribute USVString search;
[Throws, NeedsSubjectPrincipal, Cached, Pure]
[Throws, NeedsSubjectPrincipal]
attribute USVString hash;
[Throws, NeedsSubjectPrincipal]