Index: chrome/renderer/prerender/prerendering_platform.cc |
diff --git a/chrome/renderer/prerender/prerendering_platform.cc b/chrome/renderer/prerender/prerendering_platform.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c61203fc9a352ee68315664533f160e976b26cd |
--- /dev/null |
+++ b/chrome/renderer/prerender/prerendering_platform.cc |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/renderer/prerender/prerendering_platform.h" |
+ |
+#include "chrome/common/prerender_messages.h" |
+#include "chrome/renderer/prerender/prerender_extra_data.h" |
+#include "content/public/common/referrer.h" |
+#include "content/public/renderer/render_thread.h" |
+#include "content/public/renderer/render_view.h" |
+#include "third_party/WebKit/Source/Platform/chromium/public/WebPrerenderingPlatform.h" |
+ |
+namespace prerender { |
+ |
+void PrerenderingPlatform::add(const WebKit::WebPrerender& prerender) { |
+ const PrerenderExtraData& extra_data = |
+ PrerenderExtraData::fromPrerender(prerender); |
+ content::RenderThread::Get()->Send(new PrerenderHostMsg_AddPrerender( |
+ extra_data.prerender_id(), GURL(prerender.url()), |
+ content::Referrer(GURL(prerender.referrer()), prerender.referrerPolicy()), |
+ extra_data.size(), extra_data.render_view_route_id())); |
+} |
+ |
+void PrerenderingPlatform::cancel(const WebKit::WebPrerender& prerender) { |
+ const PrerenderExtraData& extra_data = |
+ PrerenderExtraData::fromPrerender(prerender); |
+ content::RenderThread::Get()->Send(new PrerenderHostMsg_CancelPrerender( |
+ extra_data.prerender_id())); |
+} |
+ |
+void PrerenderingPlatform::abandon(const WebKit::WebPrerender& prerender) { |
+ const PrerenderExtraData& extra_data = |
+ PrerenderExtraData::fromPrerender(prerender); |
+ content::RenderThread::Get()->Send(new PrerenderHostMsg_AbandonPrerender( |
+ extra_data.prerender_id())); |
+} |
+ |
+} |