Chromium Code Reviews| 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 |
| +} |