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


C++ enableAuthorizer函数代码示例

本文整理汇总了C++中enableAuthorizer函数的典型用法代码示例。如果您正苦于以下问题:C++ enableAuthorizer函数的具体用法?C++ enableAuthorizer怎么用?C++ enableAuthorizer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: disableAuthorizer

Vector<String> Database::performGetTableNames()
{
    disableAuthorizer();

    SQLiteStatement statement(sqliteDatabase(), "SELECT name FROM sqlite_master WHERE type='table';");
    if (statement.prepare() != SQLResultOk) {
        LOG_ERROR("Unable to retrieve list of tables for database %s", databaseDebugName().ascii().data());
        enableAuthorizer();
        return Vector<String>();
    }

    Vector<String> tableNames;
    int result;
    while ((result = statement.step()) == SQLResultRow) {
        String name = statement.getColumnText(0);
        if (name != databaseInfoTableName())
            tableNames.append(name);
    }

    enableAuthorizer();

    if (result != SQLResultDone) {
        LOG_ERROR("Error getting tables for database %s", databaseDebugName().ascii().data());
        return Vector<String>();
    }

    return tableNames;
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:28,代码来源:Database.cpp

示例2: locker

int SQLiteDatabase::runIncrementalVacuumCommand()
{
    LockHolder locker(m_authorizerLock);
    enableAuthorizer(false);

    if (!executeCommand(ASCIILiteral("PRAGMA incremental_vacuum")))
        LOG(SQLDatabase, "Unable to run incremental vacuum - %s", lastErrorMsg());

    enableAuthorizer(true);
    return lastError();
}
开发者ID:nickooms,项目名称:webkit,代码行数:11,代码来源:SQLiteDatabase.cpp

示例3: locker

int64_t SQLiteDatabase::maximumSize()
{
    MutexLocker locker(m_authorizerLock);
    enableAuthorizer(false);
    
    SQLiteStatement statement(*this, "PRAGMA max_page_count");
    int64_t size = statement.getColumnInt64(0) * pageSize();
    
    enableAuthorizer(true);
    return size;
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:11,代码来源:SQLiteDatabase.cpp

示例4: locker

int64_t SQLiteDatabase::freeSpaceSize()
{
    MutexLocker locker(m_authorizerLock);
    enableAuthorizer(false);
    // Note: freelist_count was added in SQLite 3.4.1.
    SQLiteStatement statement(*this, "PRAGMA freelist_count");
    int64_t size = statement.getColumnInt64(0) * pageSize();

    enableAuthorizer(true);
    return size;
}
开发者ID:mikezit,项目名称:Webkit_Code,代码行数:11,代码来源:SQLiteDatabase.cpp

示例5: pageSize

void SQLiteDatabase::setMaximumSize(int64_t size)
{
    if (size < 0)
        size = 0;
    
    int currentPageSize = pageSize();

    ASSERT(currentPageSize || !m_db);
    int64_t newMaxPageCount = currentPageSize ? size / currentPageSize : 0;
    
    LockHolder locker(m_authorizerLock);
    enableAuthorizer(false);

    SQLiteStatement statement(*this, "PRAGMA max_page_count = " + String::number(newMaxPageCount));
    statement.prepare();
    if (statement.step() != SQLITE_ROW)
        LOG_ERROR("Failed to set maximum size of database to %lli bytes", static_cast<long long>(size));

    enableAuthorizer(true);

}
开发者ID:nickooms,项目名称:webkit,代码行数:21,代码来源:SQLiteDatabase.cpp

示例6: pageSize

void SQLiteDatabase::setMaximumSize(int64_t size)
{
    if (size < 0)
        size = 0;

    int currentPageSize = pageSize();

    ASSERT(currentPageSize || !m_db);
    int64_t newMaxPageCount = currentPageSize ? size / currentPageSize : 0;

    MutexLocker locker(m_authorizerLock);
    enableAuthorizer(false);

    SQLiteStatement statement(*this, "PRAGMA max_page_count = " + String::number(newMaxPageCount));
    statement.prepare();
    if (statement.step() != SQLResultRow)
        DLOG(ERROR) << "Failed to set maximum size of database to " << size << " bytes";

    enableAuthorizer(true);

}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:21,代码来源:SQLiteDatabase.cpp

示例7: NOTREACHED

void SQLiteDatabase::setAuthorizer(DatabaseAuthorizer* auth)
{
    if (!m_db) {
        NOTREACHED() << "Attempt to set an authorizer on a non-open SQL database";
        return;
    }

    MutexLocker locker(m_authorizerLock);

    m_authorizer = auth;

    enableAuthorizer(true);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:13,代码来源:SQLiteDatabase.cpp


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