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 |
+} |