Backed out 4 changesets (bug 893858, bug 868859, bug 886903) for Linux debug mochitest-other crashes on a CLOSED TREE.

Backed out changeset 0ded4854067b (bug 886903)
Backed out changeset ca8afb897e13 (bug 893858)
Backed out changeset c15f503a96cc (bug 868859)
Backed out changeset 6a788f399a7f (bug 868859)
This commit is contained in:
Ryan VanderMeulen 2013-07-17 12:43:59 -04:00
parent f785fd17e7
commit cc6b678858
24 changed files with 27 additions and 197 deletions

View File

@ -4432,10 +4432,6 @@ nsBrowserAccess.prototype = {
isTabContentWindow: function (aWindow) {
return gBrowser.browsers.some(function (browser) browser.contentWindow == aWindow);
},
get contentWindow() {
return gBrowser.contentWindow;
}
}

View File

@ -1205,10 +1205,6 @@ nsBrowserAccess.prototype = {
isTabContentWindow: function(aWindow) {
return Browser.browsers.some(function (browser) browser.contentWindow == aWindow);
},
get contentWindow() {
return Browser.selectedBrowser.contentWindow;
}
};

View File

@ -27,15 +27,8 @@ function make_object()
o.b = true;
o.s = "hello";
o.x = { i: 10 };
o.f = function () { return 99; };
// Doing anything with this Proxy will throw.
var throwing = new Proxy({}, new Proxy({}, {
get: function (trap) { throw trap; }
}));
o.f = function () { return 99; }
return { "data": o,
"throwing": throwing,
"document": content.document
};
}

View File

@ -37,39 +37,6 @@
ok(data.b === false, "boolean property");
ok(data.s === "bye", "string property");
ok(data.x === null, "nested property");
let throwing = message.objects.throwing;
// Based on the table on:
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
let tests = [
() => Object.getOwnPropertyDescriptor(throwing, 'test'),
() => Object.getOwnPropertyNames(throwing),
() => Object.defineProperty(throwing, 'test', {value: 1}),
() => delete throwing.test,
() => "test" in throwing,
() => Object.prototype.hasOwnProperty.call(throwing, 'test'),
() => throwing.test,
() => { throwing.test = 1 },
// () => { for (let prop in throwing) {} }, Bug 783829
() => { for (let prop of throwing) {} },
() => Object.keys(throwing),
() => Function.prototype.call.call(throwing),
() => new throwing,
() => Object.preventExtensions(throwing),
() => Object.freeze(throwing),
() => Object.seal(throwing),
]
for (let test of tests) {
let threw = false;
try {
test()
} catch (e) {
threw = true;
}
ok(threw, "proxy operation threw exception");
}
}
function recvAsyncMessage(message) {
@ -90,7 +57,7 @@
run_tests("inprocess");
return;
}
finish();
}

View File

@ -12,7 +12,7 @@
interface nsIDocShellTreeItem;
[scriptable, uuid(6cd89e60-1060-491e-8c31-ce969435ec56)]
[scriptable, uuid(932f9f93-8e21-4728-a527-cafc64b4d831)]
interface nsIDocShellTreeOwner : nsISupports
{
/*
@ -64,9 +64,6 @@ interface nsIDocShellTreeOwner : nsISupports
*/
readonly attribute nsIDocShellTreeItem primaryContentShell;
[implicit_jscontext]
readonly attribute jsval contentWindow;
/*
Tells the tree owner to size its window or parent window in such a way
that the shell passed along will be the size specified.

View File

@ -3622,28 +3622,6 @@ nsGlobalWindow::GetContent(nsIDOMWindow** aContent)
return NS_OK;
}
NS_IMETHODIMP
nsGlobalWindow::GetScriptableContent(JSContext* aCx, JS::Value* aVal)
{
nsCOMPtr<nsIDOMWindow> content;
nsresult rv = GetContent(getter_AddRefs(content));
NS_ENSURE_SUCCESS(rv, rv);
if (content || !nsContentUtils::IsCallerChrome() || !IsChromeWindow()) {
JS::Rooted<JSObject*> global(aCx, JS_GetGlobalForScopeChain(aCx));
if (content && global) {
nsCOMPtr<nsIXPConnectJSObjectHolder> wrapper;
return nsContentUtils::WrapNative(aCx, global, content, aVal,
getter_AddRefs(wrapper));
}
return NS_ERROR_FAILURE;
}
// Something tries to get .content on a ChromeWindow, try to fetch the CPOW.
nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
NS_ENSURE_TRUE(treeOwner, NS_ERROR_FAILURE);
return treeOwner->GetContentWindow(aCx, aVal);
}
NS_IMETHODIMP
nsGlobalWindow::GetPrompter(nsIPrompt** aPrompt)

View File

@ -9,7 +9,7 @@ interface nsIDOMWindow;
interface nsIURI;
interface nsIFrameLoaderOwner;
[scriptable, uuid(e420bd32-b8c4-4b47-8cca-09e0bddbb0c3)]
[scriptable, uuid(3ab89888-eb41-4dc8-b347-115555f47c80)]
/**
* The C++ source has access to the browser script source through
@ -92,12 +92,5 @@ interface nsIBrowserDOMWindow : nsISupports
* currently open tab in this toplevel browser window.
*/
boolean isTabContentWindow(in nsIDOMWindow aWindow);
/**
* The contentWindow property of the currently selected browser.
* This is used to implement .content in remote-Firefox.
*/
readonly attribute jsval contentWindow;
};

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(f28c92a2-302a-4448-b589-46af599de352)]
[scriptable, uuid(35b653f4-e679-4843-8391-89cb2f5a9ba4)]
interface nsIDOMJSWindow : nsISupports
{
void dump(in DOMString str);
@ -66,7 +66,4 @@ interface nsIDOMJSWindow : nsISupports
* This property is "replaceable" in JavaScript.
*/
readonly attribute nsIDOMWindow frames;
[implicit_jscontext, binaryname(ScriptableContent)]
readonly attribute jsval content;
};

View File

@ -25,7 +25,7 @@ interface nsIVariant;
* @see <http://www.whatwg.org/html/#window>
*/
[scriptable, uuid(db8ea3c8-6997-460a-8715-0a1cbf20f15d)]
[scriptable, uuid(be62660a-e3f6-409c-a4a9-378364a9526f)]
interface nsIDOMWindow : nsISupports
{
// the current browsing context
@ -360,7 +360,7 @@ interface nsIDOMWindow : nsISupports
void sizeToContent();
/* [replaceable] content */
[noscript] readonly attribute nsIDOMWindow content;
readonly attribute nsIDOMWindow content;
/* [replaceable] prompter */
[noscript] readonly attribute nsIPrompt prompter;

View File

@ -1181,13 +1181,10 @@ PreloadSlowThings()
}
bool
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName)
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID)
{
mAppInfo.version.Assign(version);
mAppInfo.buildID.Assign(buildID);
mAppInfo.name.Assign(name);
mAppInfo.UAName.Assign(UAName);
// If we're part of the mozbrowser machinery, go ahead and start
// preloading things. We can only do this for mozbrowser because
// PreloadSlowThings() may set the docshell of the first TabChild

View File

@ -60,8 +60,6 @@ public:
{
nsCString version;
nsCString buildID;
nsCString name;
nsCString UAName;
};
bool Init(MessageLoop* aIOLoop,
@ -196,8 +194,7 @@ public:
virtual bool RecvGarbageCollect();
virtual bool RecvCycleCollect();
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName);
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID);
virtual bool RecvLastPrivateDocShellDestroyed();

View File

@ -1133,11 +1133,9 @@ ContentParent::ContentParent(mozIApplication* aApp,
if (gAppData) {
nsCString version(gAppData->version);
nsCString buildID(gAppData->buildID);
nsCString name(gAppData->name);
nsCString UAName(gAppData->UAName);
//Sending all information to content process
unused << SendAppInfo(version, buildID, name, UAName);
unused << SendAppInfo(version, buildID);
}
}

View File

@ -258,7 +258,7 @@ child:
*/
ActivateA11y();
AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName);
AppInfo(nsCString version, nsCString buildID);
// Notify child that last-pb-context-exited notification was observed
LastPrivateDocShellDestroyed();

View File

@ -253,9 +253,6 @@
},
openDialog: function(aType, aName, aFeatures, aArguments, aFrameElement) {
alert(aType + ", " + aName + ", " + aFeatures + ", " + aArguments + ", " + aFrameElement);
},
get contentWindow() {
return null;
}
}

View File

@ -353,7 +353,7 @@ nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
{
NS_ENSURE_ARG_POINTER(aShell);
if (mTreeOwner)
if(mTreeOwner)
return mTreeOwner->GetPrimaryContentShell(aShell);
*aShell = (mPrimaryContentShell ? mPrimaryContentShell : mWebBrowser->mDocShell);
@ -362,15 +362,6 @@ nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
return NS_OK;
}
NS_IMETHODIMP
nsDocShellTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal)
{
if (mTreeOwner)
return mTreeOwner->GetContentWindow(aCx, aVal);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY)

View File

@ -434,7 +434,7 @@ JavaScriptChild::AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs, boo
return fail(cx, rs);
*result = !!extensible;
return ok(rs);
return true;
}
bool

View File

@ -7206,11 +7206,12 @@ JS_GetScriptedGlobal(JSContext *cx)
JS_PUBLIC_API(JSBool)
JS_PreventExtensions(JSContext *cx, JS::HandleObject obj)
{
bool extensible;
if (!JSObject::isExtensible(cx, obj, &extensible))
return false;
if (!extensible)
return true;
JSBool extensible;
if (!JS_IsExtensible(cx, obj, &extensible))
return JS_TRUE;
if (extensible)
return JS_TRUE;
return JSObject::preventExtensions(cx, obj);
}

View File

@ -2492,10 +2492,6 @@ nsBrowserAccess.prototype = {
isTabContentWindow: function(aWindow) {
return BrowserApp.getBrowserForWindow(aWindow) != null;
},
get contentWindow() {
return BrowserApp.selectedBrowser.contentWindow;
}
};

View File

@ -29,24 +29,12 @@ let WebProgressListener = {
};
},
_setupObjects: function setupObjects(aWebProgress) {
let win = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
return {
contentWindow: win,
// DOMWindow is not necessarily the content-window with subframes.
DOMWindow: aWebProgress.DOMWindow
};
},
onStateChange: function onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
let json = this._setupJSON(aWebProgress, aRequest);
let objects = this._setupObjects(aWebProgress);
json.stateFlags = aStateFlags;
json.status = aStatus;
sendAsyncMessage("Content:StateChange", json, objects);
sendAsyncMessage("Content:StateChange", json);
},
onProgressChange: function onProgressChange(aWebProgress, aRequest, aCurSelf, aMaxSelf, aCurTotal, aMaxTotal) {
@ -57,35 +45,29 @@ let WebProgressListener = {
let charset = content.document.characterSet;
let json = this._setupJSON(aWebProgress, aRequest);
let objects = this._setupObjects(aWebProgress);
json.documentURI = aWebProgress.DOMWindow.document.documentURIObject.spec;
json.location = spec;
json.canGoBack = docShell.canGoBack;
json.canGoForward = docShell.canGoForward;
json.charset = charset.toString();
sendAsyncMessage("Content:LocationChange", json, objects);
sendAsyncMessage("Content:LocationChange", json);
},
onStatusChange: function onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {
let json = this._setupJSON(aWebProgress, aRequest);
let objects = this._setupObjects(aWebProgress);
json.status = aStatus;
json.message = aMessage;
sendAsyncMessage("Content:StatusChange", json, objects);
sendAsyncMessage("Content:StatusChange", json);
},
onSecurityChange: function onSecurityChange(aWebProgress, aRequest, aState) {
let json = this._setupJSON(aWebProgress, aRequest);
let objects = this._setupObjects(aWebProgress);
json.state = aState;
json.status = SecurityUI.getSSLStatusAsString();
sendAsyncMessage("Content:SecurityChange", json, objects);
sendAsyncMessage("Content:SecurityChange", json);
},
QueryInterface: function QueryInterface(aIID) {

View File

@ -62,16 +62,6 @@
onget="return this._characterSet"
readonly="true"/>
<field name="_contentWindow">null</field>
<property name="contentWindow"
onget="return this._contentWindow"
readonly="true"/>
<property name="contentDocument"
onget="return this.contentWindow ? this.contentWindow.document : null"
readonly="true"/>
<constructor>
<![CDATA[
this.messageManager.addMessageListener("DOMTitleChanged", this);

View File

@ -27,7 +27,6 @@ function RemoteWebProgress(browser)
{
this._browser = browser;
this._isDocumentLoading = false;
this._DOMWindow = null;
this._isTopLevel = true;
this._progressListeners = [];
}
@ -61,7 +60,7 @@ RemoteWebProgress.prototype = {
},
get isLoadingDocument() { return this._isDocumentLoading },
get DOMWindow() { return this._DOMWindow; },
get DOMWindow() { return null; },
get DOMWindowID() { return 0; },
get isTopLevel() { return this._isTopLevel; },
@ -82,9 +81,7 @@ RemoteWebProgress.prototype = {
},
receiveMessage: function WP_ReceiveMessage(aMessage) {
this._DOMWindow = aMessage.objects.DOMWindow;
this._isTopLevel = aMessage.json.isTopLevel;
this._browser._contentWindow = aMessage.objects.contentWindow;
let req = this._uriSpec(aMessage.json.requestURI);
switch (aMessage.name) {

View File

@ -632,9 +632,7 @@ NS_IMETHODIMP
nsXULAppInfo::GetName(nsACString& aResult)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
ContentChild* cc = ContentChild::GetSingleton();
aResult = cc->GetAppInfo().name;
return NS_OK;
return NS_ERROR_NOT_AVAILABLE;
}
aResult.Assign(gAppData->name);
@ -698,9 +696,7 @@ NS_IMETHODIMP
nsXULAppInfo::GetUAName(nsACString& aResult)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
ContentChild* cc = ContentChild::GetSingleton();
aResult = cc->GetAppInfo().UAName;
return NS_OK;
return NS_ERROR_NOT_AVAILABLE;
}
aResult.Assign(gAppData->UAName);

View File

@ -24,8 +24,6 @@
#include "nsIDOMNodeList.h"
#include "nsIDOMXULElement.h"
#include "nsIXULBrowserWindow.h"
#include "nsIDOMChromeWindow.h"
#include "nsIBrowserDOMWindow.h"
// CIDs
static NS_DEFINE_CID(kWindowMediatorCID, NS_WINDOWMEDIATOR_CID);
@ -247,25 +245,6 @@ NS_IMETHODIMP nsChromeTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aS
return mXULWindow->GetPrimaryContentShell(aShell);
}
NS_IMETHODIMP
nsChromeTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal)
{
NS_ENSURE_STATE(mXULWindow);
nsCOMPtr<nsIDOMWindow> domWin;
mXULWindow->GetWindowDOMWindow(getter_AddRefs(domWin));
nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(domWin);
if (!chromeWin)
return NS_OK;
nsCOMPtr<nsIBrowserDOMWindow> browserDOMWin;
chromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
if (!browserDOMWin)
return NS_OK;
return browserDOMWin->GetContentWindow(aVal);
}
NS_IMETHODIMP nsChromeTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY)
{

View File

@ -292,20 +292,12 @@ nsContentTreeOwner::ContentShellRemoved(nsIDocShellTreeItem* aContentShell)
return mXULWindow->ContentShellRemoved(aContentShell);
}
NS_IMETHODIMP
nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
NS_IMETHODIMP nsContentTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem** aShell)
{
NS_ENSURE_STATE(mXULWindow);
return mXULWindow->GetPrimaryContentShell(aShell);
}
NS_IMETHODIMP
nsContentTreeOwner::GetContentWindow(JSContext* aCx, JS::Value* aVal)
{
NS_ENSURE_STATE(mXULWindow);
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsContentTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
int32_t aCX, int32_t aCY)
{