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


C++ ASSERT_ARG函数代码示例

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


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

示例1: ASSERT_ARG

void PageGroup::removeUserScriptsFromWorld(DOMWrapperWorld* world)
{
    ASSERT_ARG(world, world);

    if (!m_userScripts)
        return;

    UserScriptMap::iterator it = m_userScripts->find(world);
    if (it == m_userScripts->end())
        return;
       
    m_userScripts->remove(it);
}
开发者ID:gobihun,项目名称:webkit,代码行数:13,代码来源:PageGroup.cpp

示例2: ASSERT_ARG

void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,  PassOwnPtr<Vector<String> > whitelist,
                                     PassOwnPtr<Vector<String> > blacklist, UserScriptInjectionTime injectionTime)
{
    ASSERT_ARG(world, world);

    OwnPtr<UserScript> userScript(new UserScript(source, url, whitelist, blacklist, injectionTime));
    if (!m_userScripts)
        m_userScripts.set(new UserScriptMap);
    UserScriptVector*& scriptsInWorld = m_userScripts->add(world, 0).first->second;
    if (!scriptsInWorld)
        scriptsInWorld = new UserScriptVector;
    scriptsInWorld->append(userScript.release());
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:13,代码来源:PageGroup.cpp

示例3: ASSERT_ARG

void AsyncScriptRunner::executeScriptSoon(ScriptElement* scriptElement, CachedResourceHandle<CachedScript> cachedScript)
{
    ASSERT_ARG(scriptElement, scriptElement);

    Element* element = scriptElement->element();
    ASSERT(element);
    ASSERT(element->inDocument());

    m_document->incrementLoadEventDelayCount();
    m_scriptsToExecuteSoon.append(PendingScript(element, cachedScript.get()));
    if (!m_timer.isActive())
        m_timer.startOneShot(0);
}
开发者ID:NewDreamUser2,项目名称:webkit-webcl,代码行数:13,代码来源:AsyncScriptRunner.cpp

示例4: ASSERT_ARG

void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
{
    ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_nextBackingStoreStateID);
    ASSERT_ARG(backingStoreStateID, backingStoreStateID > m_currentBackingStoreStateID);
    m_currentBackingStoreStateID = backingStoreStateID;

    m_isWaitingForDidUpdateBackingStoreState = false;

    // Stop the responsiveness timer that was started in sendUpdateBackingStoreState.
    m_webPageProxy.process().responsivenessTimer()->stop();

    if (layerTreeContext != m_layerTreeContext) {
        if (!m_layerTreeContext.isEmpty()) {
            exitAcceleratedCompositingMode();
            ASSERT(m_layerTreeContext.isEmpty());
        }

        if (!layerTreeContext.isEmpty()) {
            enterAcceleratedCompositingMode(layerTreeContext);
            ASSERT(layerTreeContext == m_layerTreeContext);
        }            
    }

    if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
        sendUpdateBackingStoreState(RespondImmediately);
    else
        m_hasReceivedFirstUpdate = true;

    if (isInAcceleratedCompositingMode()) {
        ASSERT(!m_backingStore);
        return;
    }

    // If we have a backing store the right size, reuse it.
    if (m_backingStore && (m_backingStore->size() != updateInfo.viewSize || m_backingStore->deviceScaleFactor() != updateInfo.deviceScaleFactor))
        m_backingStore = nullptr;
    incorporateUpdate(updateInfo);
}
开发者ID:houzhenggang,项目名称:webkit,代码行数:38,代码来源:DrawingAreaProxyImpl.cpp

示例5: ASSERT_ARG

void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> consoleMessage)
{
    ASSERT_ARG(consoleMessage, consoleMessage);

    if (m_frontend && m_enabled)
        consoleMessage->addToFrontend(m_frontend, m_injectedScriptManager, true);

    m_consoleMessages.append(consoleMessage);

    if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) {
        m_expiredConsoleMessageCount += expireConsoleMessagesStep;
        m_consoleMessages.remove(0, expireConsoleMessagesStep);
    }
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:14,代码来源:InspectorConsoleAgent.cpp

示例6: ASSERT

void DrawingAreaImpl::updateBackingStoreState(uint64_t stateID, bool respondImmediately, float deviceScaleFactor, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset)
{
    ASSERT(!m_inUpdateBackingStoreState);
    m_inUpdateBackingStoreState = true;

    ASSERT_ARG(stateID, stateID >= m_backingStoreStateID);
    if (stateID != m_backingStoreStateID) {
        m_backingStoreStateID = stateID;
        m_shouldSendDidUpdateBackingStoreState = true;

        m_webPage->setDeviceScaleFactor(deviceScaleFactor);
        m_webPage->setSize(size);
        m_webPage->layoutIfNeeded();
        m_webPage->scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset);

        if (m_layerTreeHost) {
#if USE(COORDINATED_GRAPHICS)
            // Coordinated Graphics sets the size of the root layer to contents size.
            if (!m_webPage->useFixedLayout())
#endif
                m_layerTreeHost->sizeDidChange(m_webPage->size());
        } else
            m_dirtyRegion = m_webPage->bounds();
    } else {
        ASSERT(size == m_webPage->size());
        if (!m_shouldSendDidUpdateBackingStoreState) {
            // We've already sent a DidUpdateBackingStoreState message for this state. We have nothing more to do.
            m_inUpdateBackingStoreState = false;
            return;
        }
    }

    // The UI process has updated to a new backing store state. Any Update messages we sent before
    // this point will be ignored. We wait to set this to false until after updating the page's
    // size so that any displays triggered by the relayout will be ignored. If we're supposed to
    // respond to the UpdateBackingStoreState message immediately, we'll do a display anyway in
    // sendDidUpdateBackingStoreState; otherwise we shouldn't do one right now.
    m_isWaitingForDidUpdate = false;

    if (respondImmediately) {
        // Make sure to resume painting if we're supposed to respond immediately, otherwise we'll just
        // send back an empty UpdateInfo struct.
        if (m_isPaintingSuspended)
            resumePainting();

        sendDidUpdateBackingStoreState();
    }

    m_inUpdateBackingStoreState = false;
}
开发者ID:fmalita,项目名称:webkit,代码行数:50,代码来源:DrawingAreaImpl.cpp

示例7: ASSERT_ARG

DWORD WINAPI WorkQueue::unregisterWaitAndDestroyItemCallback(void* context)
{
    ASSERT_ARG(context, context);
    RefPtr<HandleWorkItem> item = adoptRef(static_cast<HandleWorkItem*>(context));

    // Now that we know we're not in a callback function for the wait we're unregistering, we can
    // make a blocking call to ::UnregisterWaitEx.
    if (!::UnregisterWaitEx(item->waitHandle(), INVALID_HANDLE_VALUE)) {
        DWORD error = ::GetLastError();
        ASSERT_NOT_REACHED();
    }

    return 0;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:14,代码来源:WorkQueueWin.cpp

示例8: JAVASCRIPTCORE_PROFILE_WILL_EXECUTE

void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
{
    if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
        CString name = callIdentifier.m_name.utf8();
        CString url = callIdentifier.m_url.utf8();
        JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
    }

    if (!m_originatingGlobalExec)
        return;

    ASSERT_ARG(m_currentNode, m_currentNode);
    m_currentNode = m_currentNode->willExecute(callIdentifier);
}
开发者ID:pelegri,项目名称:WebKit-PlayBook,代码行数:14,代码来源:ProfileGenerator.cpp

示例9: ASSERT_ARG

void InspectorReplayAgent::removeSessionSegment(ErrorString& errorString, Inspector::Protocol::Replay::SessionIdentifier identifier, int segmentIndex)
{
    ASSERT_ARG(identifier, identifier > 0);
    ASSERT_ARG(segmentIndex, segmentIndex >= 0);

    RefPtr<ReplaySession> session = findSession(errorString, identifier);

    if (!session)
        return;

    if (static_cast<size_t>(segmentIndex) >= session->size()) {
        errorString = ASCIILiteral("Invalid segment index.");
        return;
    }

    if (session == m_page.replayController().loadedSession() && sessionState() != WebCore::SessionState::Inactive) {
        errorString = ASCIILiteral("Can't modify a loaded session unless the session is inactive.");
        return;
    }

    session->removeSegment(segmentIndex);
    sessionModified(WTF::move(session));
}
开发者ID:EthanK28,项目名称:webkit,代码行数:23,代码来源:InspectorReplayAgent.cpp

示例10: ASSERT_ARG

void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
                                     const Vector<String>& whitelist, const Vector<String>& blacklist,
                                     UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
{
    ASSERT_ARG(world, world);

    OwnPtr<UserScript> userScript = adoptPtr(new UserScript(source, url, whitelist, blacklist, injectionTime, injectedFrames));
    if (!m_userScripts)
        m_userScripts = adoptPtr(new UserScriptMap);
    OwnPtr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->value;
    if (!scriptsInWorld)
        scriptsInWorld = adoptPtr(new UserScriptVector);
    scriptsInWorld->append(userScript.release());
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:14,代码来源:PageGroup.cpp

示例11: ASSERT_ARG

void JavaScriptDebugServer::addListener(JavaScriptDebugListener* listener, Page* page)
{
    ASSERT_ARG(page, page);

    if (!hasListeners())
        Page::setDebuggerForAllPages(this);

    pair<PageListenersMap::iterator, bool> result = m_pageListenersMap.add(page, 0);
    if (result.second)
        result.first->second = new ListenerSet;
    ListenerSet* listeners = result.first->second;

    listeners->add(listener);
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:14,代码来源:JavaScriptDebugServer.cpp

示例12: ASSERT_ARG

void WKCACFLayer::replaceSublayer(WKCACFLayer* reference, PassRefPtr<WKCACFLayer> newLayer)
{
    ASSERT_ARG(reference, reference);
    ASSERT_ARG(reference, reference->superlayer() == this);

    if (reference == newLayer)
        return;

    if (!newLayer) {
        removeSublayer(reference);
        return;
    }

    newLayer->removeFromSuperlayer();

    int referenceIndex = indexOfSublayer(reference);
    ASSERT(referenceIndex != -1);
    if (referenceIndex == -1)
        return;

    // FIXME: Can we make this more efficient? The current CACF API doesn't seem to give us a way to do so.
    reference->removeFromSuperlayer();
    insertSublayer(newLayer, referenceIndex);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:24,代码来源:WKCACFLayer.cpp

示例13: ASSERT_ARG

bool SharedMemory::createHandle(Handle& handle, Protection protection)
{
    ASSERT_ARG(handle, !handle.m_size);
    ASSERT_ARG(handle, handle.isNull());

    int duplicatedHandle;
    while ((duplicatedHandle = dup(m_fileDescriptor)) == -1) {
        if (errno != EINTR) {
            ASSERT_NOT_REACHED();
            return false;
        }
    }

    while ((fcntl(duplicatedHandle, F_SETFD, FD_CLOEXEC | accessModeFile(protection)) == -1)) {
        if (errno != EINTR) {
            ASSERT_NOT_REACHED();
            while (close(duplicatedHandle) == -1 && errno == EINTR) { }
            return false;
        }
    }
    handle.m_fileDescriptor = duplicatedHandle;
    handle.m_size = m_size;
    return true;
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:24,代码来源:SharedMemoryUnix.cpp

示例14: createFontCustomPlatformData

FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
{
    ASSERT_ARG(buffer, buffer);

    buffer->ref();
    HFONT font = reinterpret_cast<HFONT>(buffer);
    cairo_font_face_t* fontFace = cairo_win32_font_face_create_for_hfont(font);
    if (!fontFace)
       return 0;

    static cairo_user_data_key_t bufferKey;
    cairo_font_face_set_user_data(fontFace, &bufferKey, buffer, releaseData);

    return new FontCustomPlatformData(fontFace);
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:15,代码来源:FontCustomPlatformDataCairo.cpp

示例15: ASSERT_ARG

bool SharedMemory::createHandle(Handle& handle, Protection)
{
    ASSERT_ARG(handle, handle.isNull());
    ASSERT(m_fileDescriptor);

    // FIXME: Handle the case where the passed Protection is ReadOnly.
    // See https://bugs.webkit.org/show_bug.cgi?id=131542.

    int duplicatedHandle = dupCloseOnExec(m_fileDescriptor.value());
    if (duplicatedHandle == -1) {
        ASSERT_NOT_REACHED();
        return false;
    }
    handle.m_attachment = IPC::Attachment(duplicatedHandle, m_size);
    return true;
}
开发者ID:eocanha,项目名称:webkit,代码行数:16,代码来源:SharedMemoryUnix.cpp


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