当前位置: 首页>>代码示例>>C++>>正文


C++ DatabaseNameMap::isEmpty方法代码示例

本文整理汇总了C++中DatabaseNameMap::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabaseNameMap::isEmpty方法的具体用法?C++ DatabaseNameMap::isEmpty怎么用?C++ DatabaseNameMap::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseNameMap的用法示例。


在下文中一共展示了DatabaseNameMap::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: removeOpenDatabase

void DatabaseTracker::removeOpenDatabase(AbstractDatabase* database)
{
    if (!database->scriptExecutionContext()->isContextThread()) {
        database->scriptExecutionContext()->postTask(TrackerRemoveOpenDatabaseTask::create(database));
        return;
    }

    MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
    ASSERT(m_openDatabaseMap);
    DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
    ASSERT(nameMap);
    String name(database->stringIdentifier());
    DatabaseSet* databaseSet = nameMap->get(name);
    ASSERT(databaseSet);
    databaseSet->remove(database);

    if (databaseSet->isEmpty()) {
        nameMap->remove(name);
        delete databaseSet;
        if (nameMap->isEmpty()) {
            m_openDatabaseMap->remove(database->securityOrigin());
            delete nameMap;
        }
    }

    DatabaseObserver::databaseClosed(database);
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:27,代码来源:DatabaseTrackerChromium.cpp

示例2: removeOpenDatabase

void DatabaseTracker::removeOpenDatabase(Database* database)
{
    {
        MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
        String originString = database->getSecurityOrigin()->toRawString();
        ASSERT(m_openDatabaseMap);
        DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString);
        if (!nameMap)
            return;

        String name(database->stringIdentifier());
        DatabaseSet* databaseSet = nameMap->get(name);
        if (!databaseSet)
            return;

        DatabaseSet::iterator found = databaseSet->find(database);
        if (found == databaseSet->end())
            return;

        databaseSet->remove(found);
        if (databaseSet->isEmpty()) {
            nameMap->remove(name);
            delete databaseSet;
            if (nameMap->isEmpty()) {
                m_openDatabaseMap->remove(originString);
                delete nameMap;
            }
        }
    }
    databaseClosed(database);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:31,代码来源:DatabaseTracker.cpp

示例3: removeOpenDatabase

void DatabaseTracker::removeOpenDatabase(DatabaseBackendBase* database)
{
    if (!database)
        return;

    {
        MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);

        if (!m_openDatabaseMap) {
            ASSERT_NOT_REACHED();
            return;
        }

        String name(database->stringIdentifier());
        DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
        if (!nameMap) {
            ASSERT_NOT_REACHED();
            return;
        }

        DatabaseSet* databaseSet = nameMap->get(name);
        if (!databaseSet) {
            ASSERT_NOT_REACHED();
            return;
        }

        databaseSet->remove(database);

        LOG(StorageAPI, "Removed open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database);

        if (!databaseSet->isEmpty())
            return;

        nameMap->remove(name);
        delete databaseSet;

        if (!nameMap->isEmpty())
            return;

        m_openDatabaseMap->remove(database->securityOrigin());
        delete nameMap;
    }
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:43,代码来源:DatabaseTracker.cpp


注:本文中的DatabaseNameMap::isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。