void IDBRequest::RootResultVal() { NS_ASSERTION(!mResultValRooted, "This should be false!"); NS_HOLD_JS_OBJECTS(this, IDBRequest); mResultValRooted = true; }
void SmsRequest::RootResult() { NS_ASSERTION(!mResultRooted, "Don't call RootResult() if already rooted!"); NS_HOLD_JS_OBJECTS(this, SmsRequest); mResultRooted = true; }
void BluetoothDevice::Root() { if (!mIsRooted) { NS_HOLD_JS_OBJECTS(this, BluetoothDevice); mIsRooted = true; } }
NS_INTERFACE_MAP_END Promise::Promise(nsPIDOMWindow* aWindow) : mWindow(aWindow) , mResult(JS::UndefinedValue()) , mState(Pending) , mTaskPending(false) { MOZ_COUNT_CTOR(Promise); NS_HOLD_JS_OBJECTS(this, Promise); SetIsDOMBinding(); mResolver = new PromiseResolver(this); }
/* * nsJSEventListener implementation */ nsJSEventListener::nsJSEventListener(nsIScriptContext *aContext, JSObject* aScopeObject, nsISupports *aTarget, nsIAtom* aType, JSObject *aHandler) : nsIJSEventListener(aContext, aScopeObject, aTarget, aHandler), mEventName(aType) { // aScopeObject is the inner window's JS object, which we need to lock // until we are done with it. NS_ASSERTION(aScopeObject && aContext, "EventListener with no context or scope?"); NS_HOLD_JS_OBJECTS(this, nsJSEventListener); }
// static already_AddRefed<IDBCursor> IDBCursor::CreateCommon(IDBRequest* aRequest, IDBTransaction* aTransaction, IDBObjectStore* aObjectStore, Direction aDirection, const Key& aRangeKey, const nsACString& aContinueQuery, const nsACString& aContinueToQuery) { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); NS_ASSERTION(aRequest, "Null pointer!"); NS_ASSERTION(aTransaction, "Null pointer!"); NS_ASSERTION(aObjectStore, "Null pointer!"); NS_ASSERTION(!aContinueQuery.IsEmpty(), "Empty query!"); NS_ASSERTION(!aContinueToQuery.IsEmpty(), "Empty query!"); nsRefPtr<IDBCursor> cursor = new IDBCursor(); IDBDatabase* database = aTransaction->Database(); cursor->mScriptOwner = database->GetScriptOwner(); if (cursor->mScriptOwner) { if (NS_FAILED(NS_HOLD_JS_OBJECTS(cursor, IDBCursor))) { return nsnull; } cursor->mRooted = true; } cursor->mRequest = aRequest; cursor->mTransaction = aTransaction; cursor->mObjectStore = aObjectStore; cursor->mDirection = aDirection; cursor->mContinueQuery = aContinueQuery; cursor->mContinueToQuery = aContinueToQuery; cursor->mRangeKey = aRangeKey; return cursor.forget(); }