https://bugs.webkit.org/show_bug.cgi?id=81044
This code was written by Jessie Berlin.
Reviewed by Brady Eidson.
* UIProcess/API/C/WKPage.cpp:
(WKPageLoadWebArchiveData): Added.
* UIProcess/API/C/WKPage.h: Added WKPageLoadWebArchiveData().
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadWebArchiveData): Added.
* UIProcess/WebPageProxy.h: Added loadWebArchiveData().
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadWebArchiveData): Added.
* WebProcess/WebPage/WebPage.h: Added loadWebArchiveData().
* WebProcess/WebPage/WebPage.messages.in: Added LoadWebArchiveData message.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110638
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-13 Jeff Miller <jeffm@apple.com>
+
+ Support loading a WKPage from web archive data
+ https://bugs.webkit.org/show_bug.cgi?id=81044
+
+ This code was written by Jessie Berlin.
+
+ Reviewed by Brady Eidson.
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageLoadWebArchiveData): Added.
+
+ * UIProcess/API/C/WKPage.h: Added WKPageLoadWebArchiveData().
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::loadWebArchiveData): Added.
+
+ * UIProcess/WebPageProxy.h: Added loadWebArchiveData().
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::loadWebArchiveData): Added.
+
+ * WebProcess/WebPage/WebPage.h: Added loadWebArchiveData().
+
+ * WebProcess/WebPage/WebPage.messages.in: Added LoadWebArchiveData message.
+
2012-03-13 Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com>
Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
toImpl(pageRef)->loadPlainTextString(toWTFString(plainTextStringRef));
}
+void WKPageLoadWebArchiveData(WKPageRef pageRef, WKDataRef webArchiveDataRef)
+{
+ toImpl(pageRef)->loadWebArchiveData(toImpl(webArchiveDataRef));
+}
+
void WKPageStopLoading(WKPageRef pageRef)
{
toImpl(pageRef)->stopLoading();
WK_EXPORT void WKPageLoadHTMLString(WKPageRef page, WKStringRef htmlString, WKURLRef baseURL);
WK_EXPORT void WKPageLoadAlternateHTMLString(WKPageRef page, WKStringRef htmlString, WKURLRef baseURL, WKURLRef unreachableURL);
WK_EXPORT void WKPageLoadPlainTextString(WKPageRef page, WKStringRef plainTextString);
+WK_EXPORT void WKPageLoadWebArchiveData(WKPageRef page, WKDataRef webArchiveData);
WK_EXPORT void WKPageStopLoading(WKPageRef page);
WK_EXPORT void WKPageReload(WKPageRef page);
process()->responsivenessTimer()->start();
}
+void WebPageProxy::loadWebArchiveData(const WebData* webArchiveData)
+{
+ if (!isValid())
+ reattachToWebProcess();
+
+ process()->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference()), m_pageID);
+ process()->responsivenessTimer()->start();
+}
+
void WebPageProxy::stopLoading()
{
if (!isValid())
void loadHTMLString(const String& htmlString, const String& baseURL);
void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
void loadPlainTextString(const String& string);
+ void loadWebArchiveData(const WebData*);
void stopLoading();
void reload(bool reloadFromOrigin);
loadData(sharedBuffer, "text/plain", "utf-16", blankURL(), KURL());
}
+void WebPage::loadWebArchiveData(const CoreIPC::DataReference& webArchiveData)
+{
+ RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(webArchiveData.data()), webArchiveData.size() * sizeof(uint8_t));
+ loadData(sharedBuffer, "application/x-webarchive", "utf-16", blankURL(), KURL());
+}
+
void WebPage::linkClicked(const String& url, const WebMouseEvent& event)
{
Frame* frame = m_page->mainFrame();
void loadHTMLString(const String& htmlString, const String& baseURL);
void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL);
void loadPlainTextString(const String&);
+ void loadWebArchiveData(const CoreIPC::DataReference&);
void linkClicked(const String& url, const WebMouseEvent&);
void reload(bool reloadFromOrigin, const SandboxExtension::Handle&);
void goForward(uint64_t);
LoadHTMLString(WTF::String htmlString, WTF::String baseURL)
LoadAlternateHTMLString(WTF::String htmlString, WTF::String baseURL, WTF::String unreachableURL);
LoadPlainTextString(WTF::String string)
+ LoadWebArchiveData(CoreIPC::DataReference webArchiveData)
LoadURL(WTF::String url, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
LoadURLRequest(WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
LinkClicked(WTF::String url, WebKit::WebMouseEvent event)