Skip to content

Commit 981b9eb

Browse files
committed
Bug 1770944 - Remove other references to inBrowserElement, r=cookie-reviewers,valentin,janv,decoder
Depends on D183230 Differential Revision: https://phabricator.services.mozilla.com/D189490
1 parent ad804b1 commit 981b9eb

27 files changed

+114
-188
lines changed

browser/base/content/test/static/browser_all_files_referenced.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,6 @@ add_task(async function checkAllTheFiles() {
871871
// Wait for all manifest to be parsed
872872
await PerfTestHelpers.throttledMapPromises(manifestURIs, parseManifest);
873873

874-
for (let jsm of Components.manager.getComponentJSMs()) {
875-
gReferencesFromCode.set(jsm, null);
876-
}
877874
for (let esModule of Components.manager.getComponentESModules()) {
878875
gReferencesFromCode.set(esModule, null);
879876
}

caps/OriginAttributes.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ void OriginAttributes::CreateSuffix(nsACString& aStr) const {
229229
// naming.
230230
//
231231

232-
if (mInIsolatedMozBrowser) {
233-
params.Set(u"inBrowser"_ns, u"1"_ns);
234-
}
235-
236232
if (mUserContextId != nsIScriptSecurityManager::DEFAULT_USER_CONTEXT_ID) {
237233
value.Truncate();
238234
value.AppendInt(mUserContextId);
@@ -335,7 +331,6 @@ bool OriginAttributes::PopulateFromSuffix(const nsACString& aStr) {
335331
return false;
336332
}
337333

338-
mInIsolatedMozBrowser = true;
339334
return true;
340335
}
341336

caps/OriginAttributes.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ class OriginAttributes : public dom::OriginAttributesDictionary {
1717
public:
1818
OriginAttributes() = default;
1919

20-
explicit OriginAttributes(bool aInIsolatedMozBrowser) {
21-
mInIsolatedMozBrowser = aInIsolatedMozBrowser;
22-
}
23-
2420
explicit OriginAttributes(const OriginAttributesDictionary& aOther)
2521
: OriginAttributesDictionary(aOther) {}
2622

@@ -74,8 +70,7 @@ class OriginAttributes : public dom::OriginAttributesDictionary {
7470
}
7571

7672
[[nodiscard]] bool EqualsIgnoringFPD(const OriginAttributes& aOther) const {
77-
return mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
78-
mUserContextId == aOther.mUserContextId &&
73+
return mUserContextId == aOther.mUserContextId &&
7974
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
8075
mGeckoViewSessionContextId == aOther.mGeckoViewSessionContextId;
8176
}
@@ -159,11 +154,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
159154

160155
// Performs a match of |aAttrs| against this pattern.
161156
bool Matches(const OriginAttributes& aAttrs) const {
162-
if (mInIsolatedMozBrowser.WasPassed() &&
163-
mInIsolatedMozBrowser.Value() != aAttrs.mInIsolatedMozBrowser) {
164-
return false;
165-
}
166-
167157
if (mUserContextId.WasPassed() &&
168158
mUserContextId.Value() != aAttrs.mUserContextId) {
169159
return false;
@@ -227,12 +217,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
227217
}
228218

229219
bool Overlaps(const OriginAttributesPattern& aOther) const {
230-
if (mInIsolatedMozBrowser.WasPassed() &&
231-
aOther.mInIsolatedMozBrowser.WasPassed() &&
232-
mInIsolatedMozBrowser.Value() != aOther.mInIsolatedMozBrowser.Value()) {
233-
return false;
234-
}
235-
236220
if (mUserContextId.WasPassed() && aOther.mUserContextId.WasPassed() &&
237221
mUserContextId.Value() != aOther.mUserContextId.Value()) {
238222
return false;

caps/tests/gtest/TestOriginAttributes.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ TEST(OriginAttributes, Suffix_default)
4545
TestSuffix(attrs);
4646
}
4747

48-
TEST(OriginAttributes, Suffix_inIsolatedMozBrowser)
49-
{
50-
OriginAttributes attrs(true);
51-
TestSuffix(attrs);
52-
}
53-
5448
TEST(OriginAttributes, FirstPartyDomain_default)
5549
{
5650
bool oldFpiPref = Preferences::GetBool(FPI_PREF);

dom/base/ChromeUtils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ class ChromeUtils {
129129
static bool IsOriginAttributesEqualIgnoringFPD(
130130
const dom::OriginAttributesDictionary& aA,
131131
const dom::OriginAttributesDictionary& aB) {
132-
return aA.mInIsolatedMozBrowser == aB.mInIsolatedMozBrowser &&
133-
aA.mUserContextId == aB.mUserContextId &&
132+
return aA.mUserContextId == aB.mUserContextId &&
134133
aA.mPrivateBrowsingId == aB.mPrivateBrowsingId;
135134
}
136135

dom/chrome-webidl/ChromeUtils.webidl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ dictionary IOActivityDataDictionary {
951951
[GenerateInitFromJSON]
952952
dictionary OriginAttributesDictionary {
953953
unsigned long userContextId = 0;
954-
boolean inIsolatedMozBrowser = false;
955954
unsigned long privateBrowsingId = 0;
956955
DOMString firstPartyDomain = "";
957956
DOMString geckoViewSessionContextId = "";
@@ -961,7 +960,6 @@ dictionary OriginAttributesDictionary {
961960
[GenerateInitFromJSON, GenerateToJSON]
962961
dictionary OriginAttributesPatternDictionary {
963962
unsigned long userContextId;
964-
boolean inIsolatedMozBrowser;
965963
unsigned long privateBrowsingId;
966964
DOMString firstPartyDomain;
967965
DOMString geckoViewSessionContextId;

dom/quota/ActorsParent.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
#include "mozilla/ipc/PBackgroundSharedTypes.h"
109109
#include "mozilla/ipc/ProtocolUtils.h"
110110
#include "mozilla/net/ExtensionProtocolHandler.h"
111+
#include "mozilla/StorageOriginAttributes.h"
111112
#include "nsAppDirectoryServiceDefs.h"
112113
#include "nsBaseHashtable.h"
113114
#include "nsCOMPtr.h"
@@ -3203,27 +3204,27 @@ nsresult QuotaManager::CreateDirectoryMetadata(
32033204
const OriginMetadata& aOriginMetadata) {
32043205
AssertIsOnIOThread();
32053206

3206-
OriginAttributes groupAttributes;
3207+
StorageOriginAttributes groupAttributes;
32073208

32083209
nsCString groupNoSuffix;
32093210
QM_TRY(OkIf(groupAttributes.PopulateFromOrigin(aOriginMetadata.mGroup,
32103211
groupNoSuffix)),
32113212
NS_ERROR_FAILURE);
32123213

32133214
nsCString groupPrefix;
3214-
GetJarPrefix(groupAttributes.mInIsolatedMozBrowser, groupPrefix);
3215+
GetJarPrefix(groupAttributes.InIsolatedMozBrowser(), groupPrefix);
32153216

32163217
nsCString group = groupPrefix + groupNoSuffix;
32173218

3218-
OriginAttributes originAttributes;
3219+
StorageOriginAttributes originAttributes;
32193220

32203221
nsCString originNoSuffix;
32213222
QM_TRY(OkIf(originAttributes.PopulateFromOrigin(aOriginMetadata.mOrigin,
32223223
originNoSuffix)),
32233224
NS_ERROR_FAILURE);
32243225

32253226
nsCString originPrefix;
3226-
GetJarPrefix(originAttributes.mInIsolatedMozBrowser, originPrefix);
3227+
GetJarPrefix(originAttributes.InIsolatedMozBrowser(), originPrefix);
32273228

32283229
nsCString origin = originPrefix + originNoSuffix;
32293230

dom/quota/OriginParser.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,7 @@ void OriginParser::HandleToken(const nsDependentCSubstring& aToken) {
216216
return;
217217
}
218218

219-
if (aToken.First() == 't') {
220-
mInIsolatedMozBrowser = true;
221-
} else if (aToken.First() == 'f') {
222-
mInIsolatedMozBrowser = false;
223-
} else {
219+
if ((aToken.First() != 't') && (aToken.First() != 'f')) {
224220
QM_WARNING("'%s' is not a valid value for the inMozBrowser flag!",
225221
nsCString(aToken).get());
226222

dom/quota/OriginParser.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class MOZ_STACK_CLASS OriginParser final {
6565

6666
SchemeType mSchemeType;
6767
State mState;
68-
bool mInIsolatedMozBrowser;
6968
bool mUniversalFileOrigin;
7069
bool mMaybeDriveLetter;
7170
bool mError;
@@ -80,7 +79,6 @@ class MOZ_STACK_CLASS OriginParser final {
8079
mTokenizer(aOrigin, '+'),
8180
mSchemeType(eNone),
8281
mState(eExpectingAppIdOrScheme),
83-
mInIsolatedMozBrowser(false),
8482
mUniversalFileOrigin(false),
8583
mMaybeDriveLetter(false),
8684
mError(false),

dom/quota/SerializationHelpers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ struct ParamTraits<mozilla::OriginAttributesPattern> {
6464

6565
static void Write(MessageWriter* aWriter, const paramType& aParam) {
6666
WriteParam(aWriter, aParam.mFirstPartyDomain);
67-
WriteParam(aWriter, aParam.mInIsolatedMozBrowser);
6867
WriteParam(aWriter, aParam.mPrivateBrowsingId);
6968
WriteParam(aWriter, aParam.mUserContextId);
7069
WriteParam(aWriter, aParam.mGeckoViewSessionContextId);
7170
}
7271

7372
static bool Read(MessageReader* aReader, paramType* aResult) {
7473
return ReadParam(aReader, &aResult->mFirstPartyDomain) &&
75-
ReadParam(aReader, &aResult->mInIsolatedMozBrowser) &&
7674
ReadParam(aReader, &aResult->mPrivateBrowsingId) &&
7775
ReadParam(aReader, &aResult->mUserContextId) &&
7876
ReadParam(aReader, &aResult->mGeckoViewSessionContextId);

0 commit comments

Comments
 (0)