本文整理汇总了C++中ContentChild::SendPIndexedDBConstructor方法的典型用法代码示例。如果您正苦于以下问题:C++ ContentChild::SendPIndexedDBConstructor方法的具体用法?C++ ContentChild::SendPIndexedDBConstructor怎么用?C++ ContentChild::SendPIndexedDBConstructor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentChild
的用法示例。
在下文中一共展示了ContentChild::SendPIndexedDBConstructor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IDBFactory
// static
nsresult
IDBFactory::Create(JSContext* aCx,
JSObject* aOwningObject,
IDBFactory** aFactory)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(aCx, "Null context!");
NS_ASSERTION(aOwningObject, "Null object!");
NS_ASSERTION(JS_GetGlobalForObject(aCx, aOwningObject) == aOwningObject,
"Not a global object!");
NS_ASSERTION(nsContentUtils::IsCallerChrome(), "Only for chrome!");
nsCString origin;
nsresult rv =
IndexedDatabaseManager::GetASCIIOriginFromWindow(nsnull, origin);
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
nsRefPtr<IDBFactory> factory = new IDBFactory();
factory->mASCIIOrigin = origin;
factory->mOwningObject = aOwningObject;
if (!IndexedDatabaseManager::IsMainProcess()) {
ContentChild* contentChild = ContentChild::GetSingleton();
NS_ENSURE_TRUE(contentChild, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
IndexedDBChild* actor = new IndexedDBChild(origin);
contentChild->SendPIndexedDBConstructor(actor);
actor->SetFactory(factory);
}
factory.forget(aFactory);
return NS_OK;
}
示例2: IDBFactory
// static
nsresult
IDBFactory::Create(JSContext* aCx,
JS::Handle<JSObject*> aOwningObject,
ContentParent* aContentParent,
IDBFactory** aFactory)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(aCx, "Null context!");
NS_ASSERTION(aOwningObject, "Null object!");
NS_ASSERTION(JS_GetGlobalForObject(aCx, aOwningObject) == aOwningObject,
"Not a global object!");
NS_ASSERTION(nsContentUtils::IsCallerChrome(), "Only for chrome!");
// Make sure that the manager is up before we do anything here since lots of
// decisions depend on which process we're running in.
IndexedDatabaseManager* mgr = IndexedDatabaseManager::GetOrCreate();
IDB_ENSURE_TRUE(mgr, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
nsCString group;
nsCString origin;
StoragePrivilege privilege;
PersistenceType defaultPersistenceType;
QuotaManager::GetInfoForChrome(&group, &origin, &privilege,
&defaultPersistenceType);
nsRefPtr<IDBFactory> factory = new IDBFactory();
factory->mGroup = group;
factory->mASCIIOrigin = origin;
factory->mPrivilege = privilege;
factory->mDefaultPersistenceType = defaultPersistenceType;
factory->mOwningObject = aOwningObject;
factory->mContentParent = aContentParent;
mozilla::HoldJSObjects(factory.get());
factory->mRootedOwningObject = true;
if (!IndexedDatabaseManager::IsMainProcess()) {
ContentChild* contentChild = ContentChild::GetSingleton();
IDB_ENSURE_TRUE(contentChild, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
IndexedDBChild* actor = new IndexedDBChild(origin);
contentChild->SendPIndexedDBConstructor(actor);
actor->SetFactory(factory);
}
factory.forget(aFactory);
return NS_OK;
}
示例3: IDBFactory
// static
nsresult
IDBFactory::Create(JSContext* aCx,
JS::Handle<JSObject*> aOwningObject,
ContentParent* aContentParent,
IDBFactory** aFactory)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
NS_ASSERTION(aCx, "Null context!");
NS_ASSERTION(aOwningObject, "Null object!");
NS_ASSERTION(JS_GetGlobalForObject(aCx, aOwningObject) == aOwningObject,
"Not a global object!");
NS_ASSERTION(nsContentUtils::IsCallerChrome(), "Only for chrome!");
nsCString group;
nsCString origin;
StoragePrivilege privilege;
PersistenceType defaultPersistenceType;
QuotaManager::GetInfoForChrome(&group, &origin, &privilege,
&defaultPersistenceType);
nsRefPtr<IDBFactory> factory = new IDBFactory();
factory->mGroup = group;
factory->mASCIIOrigin = origin;
factory->mPrivilege = privilege;
factory->mDefaultPersistenceType = defaultPersistenceType;
factory->mOwningObject = aOwningObject;
factory->mContentParent = aContentParent;
if (!IndexedDatabaseManager::IsMainProcess()) {
ContentChild* contentChild = ContentChild::GetSingleton();
NS_ENSURE_TRUE(contentChild, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
IndexedDBChild* actor = new IndexedDBChild(origin);
contentChild->SendPIndexedDBConstructor(actor);
actor->SetFactory(factory);
}
factory.forget(aFactory);
return NS_OK;
}