本文整理汇总了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
示例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
}
示例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
}
示例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
}
示例5: JSCallbackData
JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
: m_data(new JSCallbackData(callback, globalObject))
{
#ifndef NDEBUG
counter.increment();
#endif
}
示例6: Data
JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback(JSObject* callback, Frame* frame)
: m_data(new Data(callback, frame))
{
#ifndef NDEBUG
counter.increment();
#endif
}
示例7:
CachedPage::CachedPage(Page* page)
: m_timeStamp(currentTime())
, m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
{
#ifndef NDEBUG
cachedPageCounter.increment();
#endif
}
示例8: ASSERT
WebFrame::~WebFrame()
{
ASSERT(!m_coreFrame);
#ifndef NDEBUG
webFrameCounter.decrement();
#endif
}
示例9: callOnMainThread
JSCustomSQLTransactionCallback::~JSCustomSQLTransactionCallback()
{
callOnMainThread(deleteData, m_data);
#ifndef NDEBUG
m_data = 0;
counter.decrement();
#endif
}
示例10: destroy
CachedPage::~CachedPage()
{
#ifndef NDEBUG
cachedPageCounter.decrement();
#endif
destroy();
ASSERT(!m_cachedMainFrame);
}
示例11:
CachedPage::CachedPage(Page* page)
: m_timeStamp(currentTime())
, m_cachedMainFrame(CachedFrame::create(page->mainFrame()))
, m_needStyleRecalcForVisitedLinks(false)
{
#ifndef NDEBUG
cachedPageCounter.increment();
#endif
}
示例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
}
示例13: clearChildren
SVGElementInstance::~SVGElementInstance()
{
#ifndef NDEBUG
instanceCounter.decrement();
#endif
// Deregister as instance for passed element.
m_element->removeInstanceMapping(this);
clearChildren();
}
示例14:
SVGElementInstance::~SVGElementInstance()
{
#ifndef NDEBUG
instanceCounter.decrement();
#endif
// Deregister as instance for passed element.
m_element->removeInstanceMapping(this);
removeAllChildrenInContainer<SVGElementInstance, SVGElementInstance>(this);
}
示例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
}