本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
示例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());
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}