Diff
Modified: trunk/Source/WebKit2/ChangeLog (93879 => 93880)
--- trunk/Source/WebKit2/ChangeLog 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-26 16:15:25 UTC (rev 93880)
@@ -1,3 +1,28 @@
+2011-08-26 Jessie Berlin <[email protected]>
+
+ Gut WKPageCreateSnapshotOfVisibleContent so that it can be removed later.
+ https://bugs.webkit.org/show_bug.cgi?id=66979.
+
+ Removing the function altogether would break the nightlies.
+ This patch removes the code behind it so that it is clear that
+ WKPageCreateSnapshotOfVisibleContent should not be used, and so that the code isn't just
+ left rotting in the tree.
+
+ Reviewed by Brian Weinstein.
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageCreateSnapshotOfVisibleContent):
+ Return 0.
+ * UIProcess/API/C/WKPagePrivate.h:
+ Update the comment and add a link to the bug.
+
+ * UIProcess/WebPageProxy.cpp:
+ * UIProcess/WebPageProxy.h:
+
+ * WebProcess/WebPage/WebPage.cpp:
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2011-08-25 Anders Carlsson <[email protected]>
kNPEventStartIME doesn't work correctly for NPAPI
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (93879 => 93880)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2011-08-26 16:15:25 UTC (rev 93880)
@@ -31,7 +31,6 @@
#include "WKAPICast.h"
#include "WebBackForwardList.h"
#include "WebData.h"
-#include "WebImage.h"
#include "WebPageProxy.h"
#include "WebProcessProxy.h"
@@ -567,9 +566,8 @@
}
#endif
-WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef page)
+WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef)
{
- RefPtr<WebImage> webImage = toImpl(page)->createSnapshotOfVisibleContent();
- return toAPI(webImage.release().leakRef());
+ return 0;
}
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (93879 => 93880)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h 2011-08-26 16:15:25 UTC (rev 93880)
@@ -66,8 +66,7 @@
WK_EXPORT void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo);
WK_EXPORT void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context);
-// FIXME: This is in violation of the no synchronous messages to the Web Process policy and should
-// be removed as soon as possible.
+// FIXME https://bugs.webkit.org/show_bug.cgi?id=66979: Remove this sync call.
WK_EXPORT WKImageRef WKPageCreateSnapshotOfVisibleContent(WKPageRef page);
#ifdef __cplusplus
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (93879 => 93880)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2011-08-26 16:15:25 UTC (rev 93880)
@@ -3211,21 +3211,6 @@
process()->send(Messages::WebPage::LinkClicked(url, event), m_pageID, 0);
}
-PassRefPtr<WebImage> WebPageProxy::createSnapshotOfVisibleContent()
-{
- if (!isValid())
- return 0;
-
- ShareableBitmap::Handle snapshotHandle;
- // Do not wait for more than a second (arbitrary) for the WebProcess to get the snapshot so
- // that the UI Process is not permanently stuck waiting on a potentially crashing Web Process.
- static const double createSnapshotOfVisibleContentSyncMessageTimeout = 1.0;
- process()->sendSync(Messages::WebPage::CreateSnapshotOfVisibleContent(), Messages::WebPage::CreateSnapshotOfVisibleContent::Reply(snapshotHandle), m_pageID, createSnapshotOfVisibleContentSyncMessageTimeout);
- if (snapshotHandle.isNull())
- return 0;
- return WebImage::create(ShareableBitmap::create(snapshotHandle));
-}
-
#if PLATFORM(MAC)
void WebPageProxy::substitutionsPanelIsShowing(bool& isShowing)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (93879 => 93880)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-08-26 16:15:25 UTC (rev 93880)
@@ -558,10 +558,6 @@
WebCore::IntRect visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
- // FIXME: This is in violation of the no synchronous messages to the Web Process policy and
- // should be removed as soon as possible.
- PassRefPtr<WebImage> createSnapshotOfVisibleContent();
-
uint64_t renderTreeSize() const { return m_renderTreeSize; }
private:
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (93879 => 93880)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2011-08-26 16:15:25 UTC (rev 93880)
@@ -920,20 +920,6 @@
return scaledSnapshotInDocumentCoordinates(rect, 1, options);
}
-void WebPage::createSnapshotOfVisibleContent(ShareableBitmap::Handle& snapshotHandle)
-{
- FrameView* frameView = m_mainFrame->coreFrame()->view();
- if (!frameView)
- return;
-
- IntRect contentRect = frameView->visibleContentRect(false);
- RefPtr<WebImage> snapshotImage = scaledSnapshotInDocumentCoordinates(contentRect, 1, ImageOptionsShareable);
- if (!snapshotImage->bitmap())
- return;
-
- snapshotImage->bitmap()->createHandle(snapshotHandle);
-}
-
void WebPage::pageDidScroll()
{
// Hide the find indicator.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (93879 => 93880)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2011-08-26 16:15:25 UTC (rev 93880)
@@ -280,7 +280,6 @@
PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);
PassRefPtr<WebImage> scaledSnapshotInDocumentCoordinates(const WebCore::IntRect&, double scaleFactor, ImageOptions);
- void createSnapshotOfVisibleContent(ShareableBitmap::Handle&);
static const WebEvent* currentEvent();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (93879 => 93880)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2011-08-26 15:29:03 UTC (rev 93879)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2011-08-26 16:15:25 UTC (rev 93880)
@@ -223,6 +223,4 @@
#if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD)
HandleCorrectionPanelResult(String result)
#endif
-
- CreateSnapshotOfVisibleContent() -> (WebKit::ShareableBitmap::Handle snapshotHandle)
}