Backout bug 899804 for build errors.

This commit is contained in:
Bill McCloskey 2013-08-01 17:44:03 -07:00
parent 6bb747f91e
commit 82484eab12
8 changed files with 2 additions and 92 deletions

View File

@ -31,8 +31,6 @@
#include "mozilla/dom/HTMLEmbedElementBinding.h"
#include "mozilla/dom/HTMLAppletElementBinding.h"
#include "JavaScriptParent.h"
namespace mozilla {
namespace dom {
@ -1748,17 +1746,6 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj,
return true;
}
JS::Rooted<JSObject*> unwrapped(cx, js::CheckedUnwrap(instance, true));
if (unwrapped && jsipc::JavaScriptParent::IsCPOW(unwrapped)) {
bool boolp = false;
if (!jsipc::JavaScriptParent::DOMInstanceOf(unwrapped, clasp->mPrototypeID,
clasp->mDepth, &boolp)) {
return false;
}
*bp = boolp;
return true;
}
JS::Rooted<JS::Value> protov(cx);
DebugOnly<bool> ok = JS_GetProperty(cx, obj, "prototype", &protov);
MOZ_ASSERT(ok, "Someone messed with our prototype property?");
@ -1800,21 +1787,6 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle
return InterfaceHasInstance(cx, obj, instanceObject, bp);
}
JSBool
InterfaceHasInstance(JSContext* cx, int prototypeID, int depth,
JS::Handle<JSObject*> instance,
JSBool* bp)
{
const DOMClass* domClass = GetDOMClass(js::UncheckedUnwrap(instance));
MOZ_ASSERT(!domClass || prototypeID != prototypes::id::_ID_Count,
"Why do we have a hasInstance hook if we don't have a prototype "
"ID?");
*bp = (domClass && domClass->mInterfaceChain[depth] == prototypeID);
return true;
}
bool
ReportLenientThisUnwrappingFailure(JSContext* cx, JS::Handle<JSObject*> obj)
{

View File

@ -2074,10 +2074,6 @@ InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj,
JSBool
InterfaceHasInstance(JSContext* cx, JS::Handle<JSObject*> obj, JS::MutableHandle<JS::Value> vp,
JSBool* bp);
JSBool
InterfaceHasInstance(JSContext* cx, int prototypeID, int depth,
JS::Handle<JSObject*> instance,
JSBool* bp);
// Helper for lenient getters/setters to report to console. If this
// returns false, we couldn't even get a global.

View File

@ -74,7 +74,6 @@ endif
LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
-I$(topsrcdir)/js/xpconnect/wrappers \
-I$(topsrcdir)/js/ipc \
-I$(topsrcdir)/content/canvas/src \
-I$(topsrcdir)/content/html/content/src \
-I$(topsrcdir)/media/webrtc/signaling/src/peerconnection \

View File

@ -7,7 +7,6 @@
#include "JavaScriptChild.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/BindingUtils.h"
#include "nsContentUtils.h"
#include "xpcprivate.h"
#include "jsfriendapi.h"
@ -626,27 +625,3 @@ JavaScriptChild::AnswerInstanceOf(const ObjectId &objId, const JSIID &iid, Retur
return ok(rs);
}
bool
JavaScriptChild::AnswerDOMInstanceOf(const ObjectId &objId, const int &prototypeID,
const int &depth,
ReturnStatus *rs, bool *instanceof)
{
AutoSafeJSContext cx;
JSAutoRequest request(cx);
*instanceof = false;
RootedObject obj(cx, findObject(objId));
if (!obj)
return false;
JSAutoCompartment comp(cx, obj);
JSBool tmp;
if (!mozilla::dom::InterfaceHasInstance(cx, prototypeID, depth, obj, &tmp))
return fail(cx, rs);
*instanceof = tmp;
return ok(rs);
}

View File

@ -66,8 +66,6 @@ class JavaScriptChild
ReturnStatus *rs, nsTArray<nsString> *names);
bool AnswerInstanceOf(const ObjectId &objId, const JSIID &iid,
ReturnStatus *rs, bool *instanceof);
bool AnswerDOMInstanceOf(const ObjectId &objId, const int &prototypeID, const int &depth,
ReturnStatus *rs, bool *instanceof);
protected:
JSObject *unwrap(JSContext *cx, ObjectId id);

View File

@ -514,8 +514,7 @@ JavaScriptParent::init()
bool
JavaScriptParent::makeId(JSContext *cx, JSObject *obj, ObjectId *idp)
{
obj = js::CheckedUnwrap(obj, false);
if (!obj || !IsProxy(obj) || GetProxyHandler(obj) != &CPOWProxyHandler::singleton) {
if (!IsProxy(obj) || GetProxyHandler(obj) != &CPOWProxyHandler::singleton) {
JS_ReportError(cx, "cannot ipc non-cpow object");
return false;
}
@ -657,24 +656,3 @@ JavaScriptParent::instanceOf(JSObject *obj, const nsID *id, bool *bp)
return NS_OK;
}
/* static */ bool
JavaScriptParent::DOMInstanceOf(JSObject *obj, int prototypeID, int depth, bool *bp)
{
return ParentOf(obj)->domInstanceOf(obj, prototypeID, depth, bp);
}
bool
JavaScriptParent::domInstanceOf(JSObject *obj, int prototypeID, int depth, bool *bp)
{
ObjectId objId = idOf(obj);
ReturnStatus status;
if (!CallDOMInstanceOf(objId, prototypeID, depth, &status, bp))
return false;
if (!status.ok())
return false;
return true;
}

View File

@ -66,16 +66,9 @@ class JavaScriptParent
void drop(JSObject *obj);
static bool IsCPOW(JSObject *obj);
static nsresult InstanceOf(JSObject *obj, const nsID *id, bool *bp);
nsresult instanceOf(JSObject *obj, const nsID *id, bool *bp);
/*
* Check that |obj| is a DOM wrapper whose prototype chain contains
* |prototypeID| at depth |depth|.
*/
static bool DOMInstanceOf(JSObject *obj, int prototypeID, int depth, bool *bp);
bool domInstanceOf(JSObject *obj, int prototypeID, int depth, bool *bp);
nsresult instanceOf(JSObject *obj, const nsID *id, bool *bp);
protected:
JSObject *unwrap(JSContext *cx, ObjectId objId);

View File

@ -41,7 +41,6 @@ child:
urgent GetPropertyNames(uint64_t objId, uint32_t flags) returns (ReturnStatus rs, nsString[] names);
urgent InstanceOf(uint64_t objId, JSIID iid) returns (ReturnStatus rs, bool instanceof);
urgent DOMInstanceOf(uint64_t objId, int prototypeID, int depth) returns (ReturnStatus rs, bool instanceof);
parent:
async __delete__();