WebHTMLRepresentation* WebHTMLRepresentation::createInstance(WebFrame* frame) { WebHTMLRepresentation* instance = new WebHTMLRepresentation(); instance->m_frame = frame; frame->AddRef(); instance->AddRef(); return instance; }
HRESULT WebDataSource::representation(/* [retval][out] */ IWebDocumentRepresentation** rep) { HRESULT hr = S_OK; if (!m_representation) { WebHTMLRepresentation* htmlRep = WebHTMLRepresentation::createInstance(static_cast<WebFrameLoaderClient&>(m_loader->frameLoader()->client()).webFrame()); hr = htmlRep->QueryInterface(IID_IWebDocumentRepresentation, (void**) &m_representation); htmlRep->Release(); } return m_representation.copyRefTo(rep); }
HRESULT WebDataSource::representation(_COM_Outptr_opt_ IWebDocumentRepresentation** rep) { if (!rep) return E_POINTER; *rep = nullptr; if (!m_loader) return E_UNEXPECTED; HRESULT hr = S_OK; if (!m_representation) { WebHTMLRepresentation* htmlRep = WebHTMLRepresentation::createInstance(static_cast<WebFrameLoaderClient&>(m_loader->frameLoader()->client()).webFrame()); hr = htmlRep->QueryInterface(IID_IWebDocumentRepresentation, (void**) &m_representation); htmlRep->Release(); } return m_representation.copyRefTo(rep); }