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


C++ wtf::RefCountedLeakCounter类代码示例

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


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

示例1: adoptRef

namespace WebCore {

#ifndef NDEBUG
static WTF::RefCountedLeakCounter cachedPageCounter("CachedPage");
#endif

PassRefPtr<CachedPage> CachedPage::create(Page* page)
{
    return adoptRef(new CachedPage(page));
}

CachedPage::CachedPage(Page* page)
    : m_timeStamp(currentTime())
    , m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
{
#ifndef NDEBUG
    cachedPageCounter.increment();
#endif
}

CachedPage::~CachedPage()
{
#ifndef NDEBUG
    cachedPageCounter.decrement();
#endif

    clear();
}

void CachedPage::restore(Page* page)
{
    ASSERT(page && page->mainFrame());
    m_cachedMainFrame->restore(page->mainFrame());

    // Restore the focus appearance for the focused element.
    // FIXME: Right now we don't support pages w/ frames in the b/f cache.  This may need to be tweaked when we add support for that.
    Document* focusedDocument = page->focusController()->focusedOrMainFrame()->document();
    if (Node* node = focusedDocument->focusedNode()) {
        if (node->isElementNode())
            static_cast<Element*>(node)->updateFocusAppearance(true);
    }
}

void CachedPage::clear()
{
    m_cachedMainFrame.clear();
}

} // namespace WebCore
开发者ID:marshall,项目名称:webkit_titanium,代码行数:49,代码来源:CachedPage.cpp

示例2: Page

WebPage::WebPage(uint64_t pageID, const IntSize& viewSize, const WebPreferencesStore& store, DrawingArea::Type drawingAreaType)
    : m_page(new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), 0, 0, 0))
    , m_viewSize(viewSize)
    , m_drawingArea(DrawingArea::create(drawingAreaType, this))
    , m_canGoBack(false)
    , m_canGoForward(false)
    , m_pageID(pageID)
{
    ASSERT(m_pageID);

    m_page->settings()->setJavaScriptEnabled(store.javaScriptEnabled);
    m_page->settings()->setLoadsImagesAutomatically(store.loadsImagesAutomatically);
    m_page->settings()->setMinimumFontSize(store.minimumFontSize);
    m_page->settings()->setMinimumLogicalFontSize(store.minimumLogicalFontSize);
    m_page->settings()->setDefaultFontSize(store.defaultFontSize);
    m_page->settings()->setDefaultFixedFontSize(store.defaultFixedFontSize);
    m_page->settings()->setStandardFontFamily(store.standardFontFamily);
    m_page->settings()->setCursiveFontFamily(store.cursiveFontFamily);
    m_page->settings()->setFantasyFontFamily(store.fantasyFontFamily);
    m_page->settings()->setFixedFontFamily(store.fixedFontFamily);
    m_page->settings()->setSansSerifFontFamily(store.sansSerifFontFamily);
    m_page->settings()->setSerifFontFamily(store.serifFontFamily);

    platformInitialize();

    m_mainFrame = WebFrame::createMainFrame(this);
    WebProcess::shared().connection()->send(WebPageProxyMessage::DidCreateMainFrame, m_pageID, CoreIPC::In(m_mainFrame->frameID()));

    if (WebProcess::shared().injectedBundle())
        WebProcess::shared().injectedBundle()->didCreatePage(this);

#ifndef NDEBUG
    webPageCounter.increment();
#endif
}
开发者ID:mikedougherty,项目名称:webkit,代码行数:35,代码来源:WebPage.cpp

示例3: JSEventListener

JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, Node* node, const String& sourceURL, int lineNumber)
    : JSEventListener(0, true)
    , m_functionName(functionName)
    , m_eventParameterName(eventParameterName)
    , m_code(code)
    , m_parsed(false)
    , m_sourceURL(sourceURL)
    , m_lineNumber(lineNumber)
    , m_originalNode(node)
{
    // We don't retain the original node because we assume it
    // will stay alive as long as this handler object is around
    // and we need to avoid a reference cycle. If JS transfers
    // this handler to another node, parseCode will be called and
    // then originalNode is no longer needed.

    // A JSLazyEventListener can be created with a line number of zero when it is created with
    // a setAttribute call from JavaScript, so make the line number 1 in that case.
    if (m_lineNumber == 0)
        m_lineNumber = 1;

#ifndef NDEBUG
    eventListenerCounter.increment();
#endif
}
开发者ID:dzip,项目名称:webkit,代码行数:25,代码来源:JSLazyEventListener.cpp

示例4: ref

WebFrame::WebFrame(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
    : m_page(page)
    , m_coreFrame(0)
    , m_policyListenerID(0)
    , m_policyFunction(0)
    , m_frameLoaderClient(this)
    , m_frameID(generateFrameID())
{
    // Add explict ref() that will be balanced in WebFrameLoaderClient::frameLoaderDestroyed().
    ref();

    m_page->addWebFrame(m_frameID, this);

    RefPtr<Frame> frame = Frame::create(page->corePage(), ownerElement, &m_frameLoaderClient);
    m_coreFrame = frame.get();

    frame->tree()->setName(frameName);

    if (ownerElement) {
        ASSERT(ownerElement->document()->frame());
        ownerElement->document()->frame()->tree()->appendChild(frame);
    }

    frame->init();

#ifndef NDEBUG
    webFrameCounter.increment();
#endif
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:29,代码来源:WebFrame.cpp

示例5: JSCallbackData

JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
    : m_data(new JSCallbackData(callback, globalObject))
{
#ifndef NDEBUG
    counter.increment();
#endif
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:7,代码来源:JSCustomSQLTransactionCallback.cpp

示例6: Data

JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, Frame* frame)
    : m_data(new Data(callback, frame))
{
#ifndef NDEBUG
    counter.increment();
#endif
}
开发者ID:jackyglony,项目名称:DuiBrowser-1,代码行数:7,代码来源:JSCustomSQLTransactionCallback.cpp

示例7:

CachedPage::CachedPage(Page* page)
    : m_timeStamp(currentTime())
    , m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
{
#ifndef NDEBUG
    cachedPageCounter.increment();
#endif
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:8,代码来源:CachedPage.cpp

示例8: ASSERT

WebFrame::~WebFrame()
{
    ASSERT(!m_coreFrame);

#ifndef NDEBUG
    webFrameCounter.decrement();
#endif
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:8,代码来源:WebFrame.cpp

示例9: callOnMainThread

JSCustomSQLTransactionCallback::~JSCustomSQLTransactionCallback()
{
    callOnMainThread(deleteData, m_data);
#ifndef NDEBUG
    m_data = 0;
    counter.decrement();
#endif
}
开发者ID:jackyglony,项目名称:DuiBrowser-1,代码行数:8,代码来源:JSCustomSQLTransactionCallback.cpp

示例10: destroy

CachedPage::~CachedPage()
{
#ifndef NDEBUG
    cachedPageCounter.decrement();
#endif

    destroy();
    ASSERT(!m_cachedMainFrame);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:9,代码来源:CachedPage.cpp

示例11:

CachedPage::CachedPage(Page* page)
    : m_timeStamp(currentTime())
    , m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
    , m_needStyleRecalcForVisitedLinks(false)
{
#ifndef NDEBUG
    cachedPageCounter.increment();
#endif
}
开发者ID:ricardo-quesada,项目名称:Webkit-Projects,代码行数:9,代码来源:CachedPage.cpp

示例12: isHTMLEventListener

JSEventListener::~JSEventListener()
{
    if (m_listener && m_window) {
        JSDOMWindow::ListenersMap& listeners = isHTMLEventListener()
            ? m_window->jsHTMLEventListeners() : m_window->jsEventListeners();
        listeners.remove(m_listener);
    }
#ifndef NDEBUG
    eventListenerCounter.decrement();
#endif
}
开发者ID:acss,项目名称:owb-mirror,代码行数:11,代码来源:JSEventListener.cpp

示例13: clearChildren

SVGElementInstance::~SVGElementInstance()
{
#ifndef NDEBUG
    instanceCounter.decrement();
#endif

    // Deregister as instance for passed element.
    m_element->removeInstanceMapping(this);

    clearChildren();
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:11,代码来源:SVGElementInstance.cpp

示例14:

SVGElementInstance::~SVGElementInstance()
{
#ifndef NDEBUG
    instanceCounter.decrement();
#endif

    // Deregister as instance for passed element.
    m_element->removeInstanceMapping(this);

    removeAllChildrenInContainer<SVGElementInstance, SVGElementInstance>(this);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:11,代码来源:SVGElementInstance.cpp

示例15:

WebPageProxy::WebPageProxy(WebPageNamespace* pageNamespace, uint64_t pageID)
    : m_pageNamespace(pageNamespace)
    , m_mainFrame(0)
    , m_canGoBack(false)
    , m_canGoForward(false)
    , m_valid(true)
    , m_closed(false)
    , m_pageID(pageID)
{
#ifndef NDEBUG
    webPageProxyCounter.increment();
#endif
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:13,代码来源:WebPageProxy.cpp


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