您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updatedHasPendingEvent函数代码示例

51自学网 2021-06-03 09:16:15
  C++
这篇教程C++ updatedHasPendingEvent函数代码示例写得很实用,希望能帮到您。

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

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

示例1: updateRenderer

void ImageLoader::dispatchPendingBeforeLoadEvent(){    if (!m_hasPendingBeforeLoadEvent)        return;    if (!m_image)        return;    if (!m_element->document()->attached())        return;    m_hasPendingBeforeLoadEvent = false;    if (m_element->dispatchBeforeLoadEvent(m_image->url().string())) {        updateRenderer();        return;    }    if (m_image) {        m_image->removeClient(this);        m_image = 0;    }    loadEventSender().cancelEvent(this);    m_hasPendingLoadEvent = false;        if (m_element->hasTagName(HTMLNames::objectTag))        static_cast<HTMLObjectElement*>(m_element)->renderFallbackContent();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:windyuuy,项目名称:opera,代码行数:28,


示例2: updateRenderer

void ImageLoader::dispatchPendingBeforeLoadEvent(){    if (!m_hasPendingBeforeLoadEvent)        return;    if (!m_image)        return;    if (!element().document().hasLivingRenderTree())        return;    m_hasPendingBeforeLoadEvent = false;    if (element().dispatchBeforeLoadEvent(m_image->url())) {        updateRenderer();        return;    }    if (m_image) {        m_image->removeClient(this);        m_image = 0;    }    loadEventSender().cancelEvent(*this);    m_hasPendingLoadEvent = false;        if (isHTMLObjectElement(element()))        toHTMLObjectElement(element()).renderFallbackContent();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:28,


示例3: setImageWithoutConsideringPendingLoadEvent

void ImageLoader::setImage(CachedImage* newImage){    setImageWithoutConsideringPendingLoadEvent(newImage);    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:fmalita,项目名称:webkit,代码行数:8,


示例4: ASSERT

void ImageLoader::notifyFinished(CachedResource* resource){    ASSERT(m_failedLoadURL.isEmpty());    ASSERT(resource == m_image.get());    m_imageComplete = true;    if (!hasPendingBeforeLoadEvent())        updateRenderer();    if (!m_hasPendingLoadEvent)        return;    if (m_element->fastHasAttribute(HTMLNames::crossoriginAttr)        && !m_element->document()->securityOrigin()->canRequest(image()->response().url())        && !resource->passesAccessControlCheck(m_element->document()->securityOrigin())) {        setImageWithoutConsideringPendingLoadEvent(0);        m_hasPendingErrorEvent = true;        errorEventSender().dispatchEventSoon(this);        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy.")));        m_element->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, consoleMessage);        ASSERT(!m_hasPendingLoadEvent);        // Only consider updating the protection ref-count of the Element immediately before returning        // from this function as doing so might result in the destruction of this ImageLoader.        updatedHasPendingEvent();        return;    }    if (resource->wasCanceled()) {        m_hasPendingLoadEvent = false;        // Only consider updating the protection ref-count of the Element immediately before returning        // from this function as doing so might result in the destruction of this ImageLoader.        updatedHasPendingEvent();        return;    }    loadEventSender().dispatchEventSoon(this);}
开发者ID:fmalita,项目名称:webkit,代码行数:42,


示例5: element

void ImageLoader::dispatchPendingErrorEvent(){    if (!m_hasPendingErrorEvent)        return;    m_hasPendingErrorEvent = false;    if (element()->document()->attached())        element()->dispatchEvent(Event::create(eventNames().errorEvent, false, false));    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:fmalita,项目名称:webkit,代码行数:12,


示例6: ASSERT

void ImageLoader::notifyFinished(CachedResource* resource){    ASSERT(m_failedLoadURL.isEmpty());    ASSERT(resource == m_image.get());    m_imageComplete = true;    if (!hasPendingBeforeLoadEvent())        updateRenderer();    if (!m_hasPendingLoadEvent)        return;    if (element().fastHasAttribute(HTMLNames::crossoriginAttr) && !resource->passesSameOriginPolicyCheck(*element().document().securityOrigin())) {        clearImageWithoutConsideringPendingLoadEvent();        m_hasPendingErrorEvent = true;        errorEventSender().dispatchEventSoon(*this);        static NeverDestroyed<String> consoleMessage(ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy."));        element().document().addConsoleMessage(MessageSource::Security, MessageLevel::Error, consoleMessage);        ASSERT(!m_hasPendingLoadEvent);        // Only consider updating the protection ref-count of the Element immediately before returning        // from this function as doing so might result in the destruction of this ImageLoader.        updatedHasPendingEvent();        return;    }    if (resource->wasCanceled()) {        m_hasPendingLoadEvent = false;        // Only consider updating the protection ref-count of the Element immediately before returning        // from this function as doing so might result in the destruction of this ImageLoader.        updatedHasPendingEvent();        return;    }    loadEventSender().dispatchEventSoon(*this);}
开发者ID:TigerWFH,项目名称:webkit,代码行数:39,


示例7: element

void ImageLoader::dispatchPendingErrorEvent() {    if (!m_hasPendingErrorEvent)        return;    m_hasPendingErrorEvent = false;    if (element()->document().frame())        element()->dispatchEvent(Event::create(EventTypeNames::error));    // Only consider updating the protection ref-count of the Element immediately    // before returning from this function as doing so might result in the    // destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:ollie314,项目名称:chromium,代码行数:13,


示例8: dispatchLoadEvent

void ImageLoader::dispatchPendingLoadEvent(){    if (!m_hasPendingLoadEvent)        return;    if (!m_image)        return;    m_hasPendingLoadEvent = false;    if (element()->document()->attached())        dispatchLoadEvent();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:fmalita,项目名称:webkit,代码行数:14,


示例9: request

//.........这里部分代码省略.........    // down the raw HTML parsing case by loading images we don't intend to display.    Document* document = m_element->document();    if (!document->renderer())        return;    AtomicString attr = m_element->imageSourceURL();    if (attr == m_failedLoadURL)        return;    // Do not load any image if the 'src' attribute is missing or if it is    // an empty string.    CachedResourceHandle<CachedImage> newImage = 0;    if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {        CachedResourceRequest request(ResourceRequest(document->completeURL(sourceURI(attr))));        request.setInitiator(element());        String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);        if (!crossOriginMode.isNull()) {            StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;            updateRequestForAccessControl(request.mutableResourceRequest(), document->securityOrigin(), allowCredentials);        }        if (m_loadManually) {            bool autoLoadOtherImages = document->cachedResourceLoader()->autoLoadImages();            document->cachedResourceLoader()->setAutoLoadImages(false);            newImage = new CachedImage(request.resourceRequest());            newImage->setLoading(true);            newImage->setOwningCachedResourceLoader(document->cachedResourceLoader());            document->cachedResourceLoader()->m_documentResources.set(newImage->url(), newImage.get());            document->cachedResourceLoader()->setAutoLoadImages(autoLoadOtherImages);        } else            newImage = document->cachedResourceLoader()->requestImage(request);        // If we do not have an image here, it means that a cross-site        // violation occurred, or that the image was blocked via Content        // Security Policy, or the page is being dismissed. Trigger an        // error event if the page is not being dismissed.        if (!newImage && !pageIsBeingDismissed(document)) {            m_failedLoadURL = attr;            m_hasPendingErrorEvent = true;            errorEventSender().dispatchEventSoon(this);        } else            clearFailedLoadURL();    } else if (!attr.isNull()) {        // Fire an error event if the url is empty.        // FIXME: Should we fire this event asynchronoulsy via errorEventSender()?        m_element->dispatchEvent(Event::create(eventNames().errorEvent, false, false));    }        CachedImage* oldImage = m_image.get();    if (newImage != oldImage) {        if (m_hasPendingBeforeLoadEvent) {            beforeLoadEventSender().cancelEvent(this);            m_hasPendingBeforeLoadEvent = false;        }        if (m_hasPendingLoadEvent) {            loadEventSender().cancelEvent(this);            m_hasPendingLoadEvent = false;        }        // Cancel error events that belong to the previous load, which is now cancelled by changing the src attribute.        // If newImage is null and m_hasPendingErrorEvent is true, we know the error event has been just posted by        // this load and we should not cancel the event.        // FIXME: If both previous load and this one got blocked with an error, we can receive one error event instead of two.        if (m_hasPendingErrorEvent && newImage) {            errorEventSender().cancelEvent(this);            m_hasPendingErrorEvent = false;        }        m_image = newImage;        m_hasPendingBeforeLoadEvent = !m_element->document()->isImageDocument() && newImage;        m_hasPendingLoadEvent = newImage;        m_imageComplete = !newImage;        if (newImage) {            if (!m_element->document()->isImageDocument()) {                if (!m_element->document()->hasListenerType(Document::BEFORELOAD_LISTENER))                    dispatchPendingBeforeLoadEvent();                else                    beforeLoadEventSender().dispatchEventSoon(this);            } else                updateRenderer();            // If newImage is cached, addClient() will result in the load event            // being queued to fire. Ensure this happens after beforeload is            // dispatched.            newImage->addClient(this);        }        if (oldImage)            oldImage->removeClient(this);    }    if (RenderImageResource* imageResource = renderImageResource())        imageResource->resetAnimation();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:fmalita,项目名称:webkit,代码行数:101,


示例10: resourceRequest

//.........这里部分代码省略.........    //    // We don't need to call clearLoader here: Either we were called from the    // task, or our caller updateFromElement cleared the task's loader (and set    // m_pendingTask to null).    m_pendingTask.reset();    // Make sure to only decrement the count when we exit this function    std::unique_ptr<IncrementLoadEventDelayCount> loadDelayCounter;    loadDelayCounter.swap(m_loadDelayCounter);    Document& document = m_element->document();    if (!document.isActive())        return;    AtomicString imageSourceURL = m_element->imageSourceURL();    ImageResource* newImage = nullptr;    if (!url.isNull()) {        // Unlike raw <img>, we block mixed content inside of <picture> or        // <img srcset>.        ResourceLoaderOptions resourceLoaderOptions =            ResourceFetcher::defaultResourceOptions();        ResourceRequest resourceRequest(url);        if (updateBehavior == UpdateForcedReload) {            resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);            resourceRequest.setLoFiState(WebURLRequest::LoFiOff);        }        if (referrerPolicy != ReferrerPolicyDefault) {            resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(                                                referrerPolicy, url, document.outgoingReferrer()));        }        if (isHTMLPictureElement(element()->parentNode()) ||                !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull())            resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet);        FetchRequest request(resourceRequest, element()->localName(),                             resourceLoaderOptions);        configureRequest(request, bypassBehavior, *m_element,                         document.clientHintsPreferences());        newImage = ImageResource::fetch(request, document.fetcher());        if (!newImage && !pageIsBeingDismissed(&document)) {            crossSiteOrCSPViolationOccurred(imageSourceURL);            dispatchErrorEvent();        } else {            clearFailedLoadURL();        }    } else {        if (!imageSourceURL.isNull()) {            // Fire an error event if the url string is not empty, but the KURL is.            dispatchErrorEvent();        }        noImageResourceToLoad();    }    ImageResource* oldImage = m_image.get();    if (updateBehavior == UpdateSizeChanged && m_element->layoutObject() &&            m_element->layoutObject()->isImage() && newImage == oldImage) {        toLayoutImage(m_element->layoutObject())->intrinsicSizeChanged();    } else {        if (m_hasPendingLoadEvent) {            loadEventSender().cancelEvent(this);            m_hasPendingLoadEvent = false;        }        // Cancel error events that belong to the previous load, which is now        // cancelled by changing the src attribute. If newImage is null and        // m_hasPendingErrorEvent is true, we know the error event has been just        // posted by this load and we should not cancel the event.        // FIXME: If both previous load and this one got blocked with an error, we        // can receive one error event instead of two.        if (m_hasPendingErrorEvent && newImage) {            errorEventSender().cancelEvent(this);            m_hasPendingErrorEvent = false;        }        m_image = newImage;        m_hasPendingLoadEvent = newImage;        m_imageComplete = !newImage;        updateLayoutObject();        // If newImage exists and is cached, addObserver() will result in the load        // event being queued to fire. Ensure this happens after beforeload is        // dispatched.        if (newImage) {            newImage->addObserver(this);        }        if (oldImage) {            oldImage->removeObserver(this);        }    }    if (LayoutImageResource* imageResource = layoutImageResource())        imageResource->resetAnimation();    // Only consider updating the protection ref-count of the Element immediately    // before returning from this function as doing so might result in the    // destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:ollie314,项目名称:chromium,代码行数:101,


示例11: imageSourceToKURL

//.........这里部分代码省略.........    // We don't need to call clearLoader here: Either we were called from the    // task, or our caller updateFromElement cleared the task's loader (and set    // m_pendingTask to null).    m_pendingTask.clear();    // Make sure to only decrement the count when we exit this function    OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter;    loadDelayCounter.swap(m_loadDelayCounter);    Document& document = m_element->document();    if (!document.isActive())        return;    AtomicString imageSourceURL = m_element->imageSourceURL();    KURL url = imageSourceToKURL(imageSourceURL);    ResourcePtr<ImageResource> newImage = 0;    RefPtrWillBeRawPtr<Element> protectElement(m_element.get());    if (!url.isNull()) {        // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.        ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultResourceOptions();        ResourceRequest resourceRequest(url);        resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsModeSameOrigin);        if (updateBehavior == UpdateForcedReload) {            resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadBypassingCache);            // ImageLoader defers the load of images when in an ImageDocument. Don't defer this load on a forced reload.            m_loadingImageDocument = false;        }        if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGetAttribute(HTMLNames::srcsetAttr).isNull())            resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet);        FetchRequest request(resourceRequest, element()->localName(), resourceLoaderOptions);        configureRequest(request, bypassBehavior, *m_element, document.clientHintsPreferences());        // Prevent the immediate creation of a ResourceLoader (and therefore a network        // request) for ImageDocument loads. In this case, the image contents have already        // been requested as a main resource and ImageDocumentParser will take care of        // funneling the main resource bytes into the ImageResource.        if (m_loadingImageDocument) {            request.setDefer(FetchRequest::DeferredByClient);            request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);        }        newImage = ImageResource::fetch(request, document.fetcher());        if (m_loadingImageDocument && newImage)            newImage->setLoading(true);        if (!newImage && !pageIsBeingDismissed(&document)) {            crossSiteOrCSPViolationOccurred(imageSourceURL);            dispatchErrorEvent();        } else {            clearFailedLoadURL();        }    } else {        if (!imageSourceURL.isNull()) {            // Fire an error event if the url string is not empty, but the KURL is.            dispatchErrorEvent();        }        noImageResourceToLoad();    }    ImageResource* oldImage = m_image.get();    if (updateBehavior == UpdateSizeChanged && m_element->layoutObject() && m_element->layoutObject()->isImage() && newImage == oldImage) {        toLayoutImage(m_element->layoutObject())->intrinsicSizeChanged();    } else {        if (newImage != oldImage)            sourceImageChanged();        if (m_hasPendingLoadEvent) {            loadEventSender().cancelEvent(this);            m_hasPendingLoadEvent = false;        }        // Cancel error events that belong to the previous load, which is now cancelled by changing the src attribute.        // If newImage is null and m_hasPendingErrorEvent is true, we know the error event has been just posted by        // this load and we should not cancel the event.        // FIXME: If both previous load and this one got blocked with an error, we can receive one error event instead of two.        if (m_hasPendingErrorEvent && newImage) {            errorEventSender().cancelEvent(this);            m_hasPendingErrorEvent = false;        }        m_image = newImage;        m_hasPendingLoadEvent = newImage;        m_imageComplete = !newImage;        updateLayoutObject();        // If newImage exists and is cached, addClient() will result in the load event        // being queued to fire. Ensure this happens after beforeload is dispatched.        if (newImage)            newImage->addClient(this);        if (oldImage)            oldImage->removeClient(this);    }    if (LayoutImageResource* imageResource = layoutImageResource())        imageResource->resetAnimation();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:101,


示例12: imageSourceToKURL

void ImageLoader::doUpdateFromElement(UpdateFromElementBehavior updateBehavior){    // FIXME: According to    // http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content.html#the-img-element:the-img-element-55    // When "update image" is called due to environment changes and the load fails, onerror should not be called.    // That is currently not the case.    //    // We don't need to call clearLoader here: Either we were called from the    // task, or our caller updateFromElement cleared the task's loader (and set    // m_pendingTask to null).    m_pendingTask.clear();    // Make sure to only decrement the count when we exit this function    OwnPtr<IncrementLoadEventDelayCount> loadDelayCounter;    loadDelayCounter.swap(m_loadDelayCounter);    Document& document = m_element->document();    if (!document.isActive())        return;    AtomicString imageSourceURL = m_element->imageSourceURL();    KURL url = imageSourceToKURL(imageSourceURL);    ResourcePtr<ImageResource> newImage = 0;    if (!url.isNull()) {        // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.        ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultResourceOptions();        ResourceRequest resourceRequest(url);        FetchRequest request(ResourceRequest(url), element()->localName(), resourceLoaderOptions);        newImage = document.fetcher()->fetchImage(request);        if (!newImage && !pageIsBeingDismissed(&document))            crossSiteOrCSPViolationOccured(imageSourceURL);        else            clearFailedLoadURL();    } else if (!imageSourceURL.isNull()) {        // Fire an error event if the url string is not empty, but the KURL is.        m_hasPendingErrorEvent = true;        errorEventSender().dispatchEventSoon(this);    }    ImageResource* oldImage = m_image.get();    if (newImage != oldImage) {        sourceImageChanged();        if (m_hasPendingLoadEvent) {            loadEventSender().cancelEvent(this);            m_hasPendingLoadEvent = false;        }        // Cancel error events that belong to the previous load, which is now cancelled by changing the src attribute.        // If newImage is null and m_hasPendingErrorEvent is true, we know the error event has been just posted by        // this load and we should not cancel the event.        // FIXME: If both previous load and this one got blocked with an error, we can receive one error event instead of two.        if (m_hasPendingErrorEvent && newImage) {            errorEventSender().cancelEvent(this);            m_hasPendingErrorEvent = false;        }        m_image = newImage;        m_hasPendingLoadEvent = newImage;        m_imageComplete = !newImage;        updateRenderer();        // If newImage exists and is cached, addClient() will result in the load event        // being queued to fire. Ensure this happens after beforeload is dispatched.        if (newImage)            newImage->addClient(this);        if (oldImage)            oldImage->removeClient(this);    } else if (updateBehavior == UpdateSizeChanged && m_element->renderer() && m_element->renderer()->isImage()) {        toRenderImage(m_element->renderer())->intrinsicSizeChanged();    }    if (RenderImageResource* imageResource = renderImageResource())        imageResource->resetAnimation();    // Only consider updating the protection ref-count of the Element immediately before returning    // from this function as doing so might result in the destruction of this ImageLoader.    updatedHasPendingEvent();}
开发者ID:Jamesducque,项目名称:mojo,代码行数:81,



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


C++ updwtmpx函数代码示例
C++ updated函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。