This source file includes following definitions.
- create
- extraData
- toPrerender
- reset
- assign
- isNull
- url
- relTypes
- referrer
- referrerPolicy
- setExtraData
- extraData
- didStartPrerender
- didStopPrerender
- didSendLoadForPrerender
- didSendDOMContentLoadedForPrerender
#include "config.h"
#include "public/platform/WebPrerender.h"
#include "platform/Prerender.h"
#include "wtf/PassRefPtr.h"
namespace blink {
namespace {
class ExtraDataContainer : public WebCore::Prerender::ExtraData {
public:
static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraData) { return adoptRef(new ExtraDataContainer(extraData)); }
virtual ~ExtraDataContainer() { }
WebPrerender::ExtraData* extraData() const { return m_extraData.get(); }
private:
explicit ExtraDataContainer(WebPrerender::ExtraData* extraData)
: m_extraData(adoptPtr(extraData))
{
}
OwnPtr<WebPrerender::ExtraData> m_extraData;
};
}
WebPrerender::WebPrerender(PassRefPtr<WebCore::Prerender> prerender)
: m_private(prerender)
{
}
const WebCore::Prerender* WebPrerender::toPrerender() const
{
return m_private.get();
}
void WebPrerender::reset()
{
m_private.reset();
}
void WebPrerender::assign(const WebPrerender& other)
{
m_private = other.m_private;
}
bool WebPrerender::isNull() const
{
return m_private.isNull();
}
WebURL WebPrerender::url() const
{
return WebURL(m_private->url());
}
unsigned WebPrerender::relTypes() const
{
return m_private->relTypes();
}
WebString WebPrerender::referrer() const
{
return m_private->referrer();
}
WebReferrerPolicy WebPrerender::referrerPolicy() const
{
return static_cast<WebReferrerPolicy>(m_private->referrerPolicy());
}
void WebPrerender::setExtraData(WebPrerender::ExtraData* extraData)
{
m_private->setExtraData(ExtraDataContainer::create(extraData));
}
const WebPrerender::ExtraData* WebPrerender::extraData() const
{
RefPtr<WebCore::Prerender::ExtraData> webcoreExtraData = m_private->extraData();
if (!webcoreExtraData)
return 0;
return static_cast<ExtraDataContainer*>(webcoreExtraData.get())->extraData();
}
void WebPrerender::didStartPrerender()
{
m_private->didStartPrerender();
}
void WebPrerender::didStopPrerender()
{
m_private->didStopPrerender();
}
void WebPrerender::didSendLoadForPrerender()
{
m_private->didSendLoadForPrerender();
}
void WebPrerender::didSendDOMContentLoadedForPrerender()
{
m_private->didSendDOMContentLoadedForPrerender();
}
}