Skip to content

Commit

Permalink
Backed out 4 changesets (bug 1501108) for browser chrome failures on …
Browse files Browse the repository at this point in the history
…browser_principalSerialization_version1.js. CLOSED TREE

Backed out changeset da28ce3af312 (bug 1501108)
Backed out changeset 1936dde5f34c (bug 1501108)
Backed out changeset de36c9fb8c65 (bug 1501108)
Backed out changeset cad2b29b79d2 (bug 1501108)
  • Loading branch information
CosminSabou committed Apr 15, 2019
1 parent 163b96b commit 18065e8
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 364 deletions.
15 changes: 0 additions & 15 deletions caps/OriginAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ void OriginAttributes::CreateSuffix(nsACString& aStr) const {
sanitizedFirstPartyDomain);
}

if (!mGeckoViewSessionContextId.IsEmpty()) {
nsAutoString sanitizedGeckoViewUserContextId(mGeckoViewSessionContextId);
sanitizedGeckoViewUserContextId.ReplaceChar(
dom::quota::QuotaManager::kReplaceChars, '+');

params.Set(NS_LITERAL_STRING("geckoViewUserContextId"),
sanitizedGeckoViewUserContextId);
}

aStr.Truncate();

params.Serialize(value);
Expand Down Expand Up @@ -267,12 +258,6 @@ class MOZ_STACK_CLASS PopulateFromSuffixIterator final
return true;
}

if (aName.EqualsLiteral("geckoViewUserContextId")) {
MOZ_RELEASE_ASSERT(mOriginAttributes->mGeckoViewSessionContextId.IsEmpty());
mOriginAttributes->mGeckoViewSessionContextId.Assign(aValue);
return true;
}

// No other attributes are supported.
return false;
}
Expand Down
16 changes: 2 additions & 14 deletions caps/OriginAttributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class OriginAttributes : public dom::OriginAttributesDictionary {
mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
mUserContextId == aOther.mUserContextId &&
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
mFirstPartyDomain == aOther.mFirstPartyDomain &&
mGeckoViewSessionContextId == aOther.mGeckoViewSessionContextId;
mFirstPartyDomain == aOther.mFirstPartyDomain;
}

bool operator!=(const OriginAttributes& aOther) const {
Expand All @@ -62,8 +61,7 @@ class OriginAttributes : public dom::OriginAttributesDictionary {
return mAppId == aOther.mAppId &&
mInIsolatedMozBrowser == aOther.mInIsolatedMozBrowser &&
mUserContextId == aOther.mUserContextId &&
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
mGeckoViewSessionContextId == aOther.mGeckoViewSessionContextId;
mPrivateBrowsingId == aOther.mPrivateBrowsingId;
}

// Serializes/Deserializes non-default values into the suffix format, i.e.
Expand Down Expand Up @@ -155,11 +153,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
return false;
}

if (mGeckoViewSessionContextId.WasPassed() &&
mGeckoViewSessionContextId.Value() != aAttrs.mGeckoViewSessionContextId) {
return false;
}

return true;
}

Expand Down Expand Up @@ -191,11 +184,6 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
return false;
}

if (mGeckoViewSessionContextId.WasPassed() && aOther.mGeckoViewSessionContextId.WasPassed() &&
mGeckoViewSessionContextId.Value() != aOther.mGeckoViewSessionContextId.Value()) {
return false;
}

return true;
}
};
Expand Down
2 changes: 0 additions & 2 deletions dom/chrome-webidl/ChromeUtils.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,13 @@ dictionary OriginAttributesDictionary {
boolean inIsolatedMozBrowser = false;
unsigned long privateBrowsingId = 0;
DOMString firstPartyDomain = "";
DOMString geckoViewSessionContextId = "";
};
dictionary OriginAttributesPatternDictionary {
unsigned long appId;
unsigned long userContextId;
boolean inIsolatedMozBrowser;
unsigned long privateBrowsingId;
DOMString firstPartyDomain;
DOMString geckoViewSessionContextId;
};

dictionary CompileScriptOptionsDictionary {
Expand Down
20 changes: 4 additions & 16 deletions mobile/android/components/geckoview/GeckoViewStartup.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,10 @@ GeckoViewStartup.prototype = {
SafeBrowsing.init();

// Listen for global EventDispatcher messages
EventDispatcher.instance.registerListener(this, [
"GeckoView:ClearSessionContextData",
"GeckoView:ResetUserPrefs",
"GeckoView:SetDefaultPrefs",
"GeckoView:SetLocale",
]);
EventDispatcher.instance.registerListener(this,
["GeckoView:ResetUserPrefs",
"GeckoView:SetDefaultPrefs",
"GeckoView:SetLocale"]);
break;
}
}
Expand All @@ -146,16 +144,6 @@ GeckoViewStartup.prototype = {
debug `onEvent ${aEvent}`;

switch (aEvent) {
case "GeckoView:ClearSessionContextData": {
let pattern = {};
if (aData.contextId !== null) {
pattern = { geckoViewSessionContextId: aData.contextId };
}
Services.clearData.deleteDataFromOriginAttributesPattern(pattern);
Services.qms.clearStoragesForOriginAttributesPattern(
JSON.stringify(pattern));
break;
}
case "GeckoView:ResetUserPrefs": {
const prefs = new Preferences();
prefs.reset(aData.names);
Expand Down
11 changes: 1 addition & 10 deletions mobile/android/geckoview/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ import org.mozilla.geckoview.ScreenLength;
import org.mozilla.geckoview.SessionAccessibility;
import org.mozilla.geckoview.SessionFinder;
import org.mozilla.geckoview.SessionTextInput;
import org.mozilla.geckoview.StorageController;
import org.mozilla.geckoview.WebExtension;
import org.mozilla.geckoview.WebMessage;
import org.mozilla.geckoview.WebRequest;
Expand Down Expand Up @@ -267,6 +266,7 @@ package org.mozilla.geckoview {
}

public final class GeckoRuntime implements Parcelable {
ctor public GeckoRuntime();
method @UiThread public void attachTo(@NonNull Context);
method @UiThread public void configurationChanged(@NonNull Configuration);
method @UiThread @NonNull public static GeckoRuntime create(@NonNull Context);
Expand All @@ -275,7 +275,6 @@ package org.mozilla.geckoview {
method @UiThread @Nullable public GeckoRuntime.Delegate getDelegate();
method @UiThread @Nullable public File getProfileDir();
method @AnyThread @NonNull public GeckoRuntimeSettings getSettings();
method @AnyThread @NonNull public StorageController getStorageController();
method @UiThread @NonNull public RuntimeTelemetry getTelemetry();
method @UiThread public void orientationChanged();
method @UiThread public void orientationChanged(int);
Expand Down Expand Up @@ -783,7 +782,6 @@ package org.mozilla.geckoview {
ctor public GeckoSessionSettings(@NonNull GeckoSessionSettings);
method public boolean getAllowJavascript();
method @Nullable public String getChromeUri();
method @Nullable public String getContextId();
method public int getDisplayMode();
method public boolean getFullAccessibilityTree();
method public int getScreenId();
Expand Down Expand Up @@ -821,7 +819,6 @@ package org.mozilla.geckoview {
method @NonNull public GeckoSessionSettings.Builder allowJavascript(boolean);
method @NonNull public GeckoSessionSettings build();
method @NonNull public GeckoSessionSettings.Builder chromeUri(@NonNull String);
method @NonNull public GeckoSessionSettings.Builder contextId(@Nullable String);
method @NonNull public GeckoSessionSettings.Builder displayMode(int);
method @NonNull public GeckoSessionSettings.Builder fullAccessibilityTree(boolean);
method @NonNull public GeckoSessionSettings.Builder screenId(int);
Expand Down Expand Up @@ -1032,12 +1029,6 @@ package org.mozilla.geckoview {
method @UiThread public synchronized void setView(@Nullable View);
}

public final class StorageController {
ctor public StorageController();
method @AnyThread public void clearAllSessionContextData();
method @AnyThread public void clearSessionContextData(@NonNull String);
}

public class WebExtension {
ctor public WebExtension(@NonNull String, @NonNull String);
ctor public WebExtension(@NonNull String);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ open class BaseSessionTest(noErrorCollector: Boolean = false) {
const val AUTOPLAY_PATH = "/assets/www/autoplay.html"
const val SCROLL_TEST_PATH = "/assets/www/scroll.html"
const val COLORS_HTML_PATH = "/assets/www/colors.html"
const val STORAGE_TITLE_HTML_PATH = "/assets/www/reflect_local_storage_into_title.html"
}

@get:Rule val sessionRule = GeckoSessionTestRule()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,144 +1171,4 @@ class NavigationDelegateTest : BaseSessionTest() {
mainSession.loadTestPath(HELLO_HTML_PATH)
sessionRule.waitForPageStop()
}

@WithDevToolsAPI
@Test fun sessionContextId() {
val session1 = sessionRule.createOpenSession(
GeckoSessionSettings.Builder(mainSession.settings)
.contextId("1")
.build())
session1.loadTestPath(STORAGE_TITLE_HTML_PATH + "?ctx1")
session1.waitForPageStop()

session1.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})

session1.loadTestPath(STORAGE_TITLE_HTML_PATH)
session1.waitForPageStop()

session1.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})

val session2 = sessionRule.createOpenSession(
GeckoSessionSettings.Builder(mainSession.settings)
.contextId("2")
.build())
session2.loadTestPath(STORAGE_TITLE_HTML_PATH)
session2.waitForPageStop()

session2.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=null"))
}
})

session2.loadTestPath(STORAGE_TITLE_HTML_PATH + "?ctx2")
session2.waitForPageStop()

session2.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx2"))
}
})

session1.loadTestPath(STORAGE_TITLE_HTML_PATH)
session1.waitForPageStop()

session1.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})
}

@WithDevToolsAPI
@Test fun clearSessionContextData() {
val session1 = sessionRule.createOpenSession(
GeckoSessionSettings.Builder(mainSession.settings)
.contextId("1")
.build())
session1.loadTestPath(STORAGE_TITLE_HTML_PATH + "?ctx1")
session1.waitForPageStop()

session1.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})

session1.loadTestPath(STORAGE_TITLE_HTML_PATH)
session1.waitForPageStop()

session1.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})

session1.close()

val session2 = sessionRule.createOpenSession(
GeckoSessionSettings.Builder(mainSession.settings)
.contextId("1")
.build())
session2.loadTestPath(STORAGE_TITLE_HTML_PATH)
session2.waitForPageStop()

session2.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=ctx1"))
}
})

session2.close()

sessionRule.runtime.storageController.clearSessionContextData("1")

val session3 = sessionRule.createOpenSession(
GeckoSessionSettings.Builder(mainSession.settings)
.contextId("1")
.build())
session3.loadTestPath(STORAGE_TITLE_HTML_PATH)
session3.waitForPageStop()

session3.forCallbacksDuringWait(object: Callbacks.ContentDelegate {
@AssertCalled(count = 1)
override fun onTitleChange(session: GeckoSession, title: String?) {
assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
assertThat("Title should match", title,
equalTo("storage=null"))
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ public final class GeckoRuntime implements Parcelable {
*/
public static final String EXTRA_CRASH_FATAL = "fatal";

private final StorageController mStorageController;

private GeckoRuntime() {
mStorageController = new StorageController();
}

private static GeckoRuntime sDefaultRuntime;

/**
Expand Down Expand Up @@ -458,17 +452,6 @@ public void orientationChanged(final int newOrientation) {
GeckoScreenOrientation.getInstance().update(newOrientation);
}


/**
* Get the storage controller for this runtime.
*
* @return The {@link StorageController} for this instance.
*/
@AnyThread
public @NonNull StorageController getStorageController() {
return mStorageController;
}

@Override // Parcelable
@AnyThread
public int describeContents() {
Expand Down
Loading

0 comments on commit 18065e8

Please sign in to comment.