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

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: minimize cl 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..6ed57668107c792b9a5e8d1e378d05cff259be9a 100644
--- a/Source/modules/quota/StorageErrorCallback.cpp
+++ b/Source/core/platform/network/Preconnect.cpp
@@ -29,26 +29,39 @@
*/
#include "config.h"
+#include "Preconnect.h"
tkent 2013/05/08 23:12:47 should be core/platform/network/Preconnect.h
kouhei (in TOK) 2013/05/09 01:08:34 Done.
-#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:
+ 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
+}

Powered by Google App Engine
This is Rietveld 408576698