Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1253)

Unified Diff: Source/core/platform/network/Preconnect.cpp

Issue 14746002: Add WebPrescientNetworking to trigger preconnect from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix coding style Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/network/Preconnect.cpp
diff --git a/Source/modules/quota/StorageErrorCallback.cpp b/Source/core/platform/network/Preconnect.cpp
similarity index 62%
copy from Source/modules/quota/StorageErrorCallback.cpp
copy to Source/core/platform/network/Preconnect.cpp
index 3ecf3da927febef3af57369efcd051cfa9e6bdc2..b15f87835ba3194f01033e545adf6a3716bcd1ed 100644
--- a/Source/modules/quota/StorageErrorCallback.cpp
+++ b/Source/core/platform/network/Preconnect.cpp
@@ -29,26 +29,39 @@
*/
#include "config.h"
+#include "core/platform/network/Preconnect.h"
-#include "modules/quota/StorageErrorCallback.h"
-
-#include "ExceptionCodeDescription.h"
-#include "core/dom/DOMCoreException.h"
+#include <public/Platform.h>
+#include <public/WebURL.h>
+#include <public/WebPrerenderingSupport.h>
namespace WebCore {
-StorageErrorCallback::CallbackTask::CallbackTask(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
- : m_callback(callback)
- , m_ec(ec)
+void preconnect(const KURL& url, PreconnectMotivation motivation)
{
-}
+ WebKit::WebPreconnectMotivation webMotivation;
+ switch (motivation) {
+ case PreconnectMotivationLinkMouseDown:
tkent 2013/05/09 02:33:55 For such 1:1 mapping, we usually just do static_ca
kouhei (in TOK) 2013/05/09 03:19:29 Done.
+ webMotivation = WebKit::WebPreconnectMotivationLinkMouseDown;
+ break;
-void StorageErrorCallback::CallbackTask::performTask(ScriptExecutionContext*)
-{
- if (!m_callback)
+ case PreconnectMotivationLinkMouseOver:
+ webMotivation = WebKit::WebPreconnectMotivationLinkMouseOver;
+ break;
+
+ case PreconnectMotivationLinkTapUnconfirmed:
+ webMotivation = WebKit::WebPreconnectMotivationLinkTapUnconfirmed;
+ break;
+
+ case PreconnectMotivationLinkTapDown:
+ webMotivation = WebKit::WebPreconnectMotivationLinkTapDown;
+ break;
+ }
+
+ WebKit::WebPrerenderingSupport* platform = WebKit::WebPrerenderingSupport::current();
+ if (!platform)
return;
- ExceptionCodeDescription description(m_ec);
- m_callback->handleEvent(DOMCoreException::create(description).get());
+ platform->preconnect(WebKit::WebURL(url), webMotivation);
}
-} // namespace WebCore
+}
« Source/core/platform/network/Preconnect.h ('K') | « Source/core/platform/network/Preconnect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698