This source file includes following definitions.
- create
- m_referrerPolicy
- removeClient
- add
- cancel
- abandon
- didStartPrerender
- didStopPrerender
- didSendLoadForPrerender
- didSendDOMContentLoadedForPrerender
#include "config.h"
#include "platform/Prerender.h"
#include "platform/PrerenderClient.h"
#include "public/platform/WebPrerender.h"
#include "public/platform/WebPrerenderingSupport.h"
namespace WebCore {
PassRefPtr<Prerender> Prerender::create(PrerenderClient* client, const KURL& url, unsigned relTypes, const String& referrer, ReferrerPolicy policy)
{
return adoptRef(new Prerender(client, url, relTypes, referrer, policy));
}
Prerender::Prerender(PrerenderClient* client, const KURL& url, const unsigned relTypes, const String& referrer, ReferrerPolicy policy)
: m_client(client)
, m_url(url)
, m_relTypes(relTypes)
, m_referrer(referrer)
, m_referrerPolicy(policy)
{
}
Prerender::~Prerender()
{
}
void Prerender::removeClient()
{
m_client = 0;
}
void Prerender::add()
{
blink::WebPrerenderingSupport* platform = blink::WebPrerenderingSupport::current();
if (!platform)
return;
platform->add(blink::WebPrerender(this));
}
void Prerender::cancel()
{
blink::WebPrerenderingSupport* platform = blink::WebPrerenderingSupport::current();
if (!platform)
return;
platform->cancel(blink::WebPrerender(this));
}
void Prerender::abandon()
{
blink::WebPrerenderingSupport* platform = blink::WebPrerenderingSupport::current();
if (!platform)
return;
platform->abandon(blink::WebPrerender(this));
}
void Prerender::didStartPrerender()
{
if (m_client)
m_client->didStartPrerender();
}
void Prerender::didStopPrerender()
{
if (m_client)
m_client->didStopPrerender();
}
void Prerender::didSendLoadForPrerender()
{
if (m_client)
m_client->didSendLoadForPrerender();
}
void Prerender::didSendDOMContentLoadedForPrerender()
{
if (m_client)
m_client->didSendDOMContentLoadedForPrerender();
}
}