Diff
Modified: trunk/Source/WebCore/ChangeLog (159088 => 159089)
--- trunk/Source/WebCore/ChangeLog 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebCore/ChangeLog 2013-11-12 01:51:39 UTC (rev 159089)
@@ -1,3 +1,15 @@
+2013-11-11 Anders Carlsson <[email protected]>
+
+ FrameFilter can just be an std::function instead
+ https://bugs.webkit.org/show_bug.cgi?id=124176
+
+ Reviewed by Tim Horton.
+
+ * WebCore.exp.in:
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::create):
+ * loader/archive/cf/LegacyWebArchive.h:
+
2013-11-11 Simon Fraser <[email protected]>
REGRESSION (r155660): box-shadow causes overlay scrollbars to be in the wrong position when element is composited (85647)
Modified: trunk/Source/WebCore/WebCore.exp.in (159088 => 159089)
--- trunk/Source/WebCore/WebCore.exp.in 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-11-12 01:51:39 UTC (rev 159089)
@@ -624,7 +624,7 @@
__ZN7WebCore16LegacyWebArchive21rawDataRepresentationEv
__ZN7WebCore16LegacyWebArchive6createEN3WTF10PassRefPtrINS_15ArchiveResourceEEERNS1_6VectorIS4_Lm0ENS1_15CrashOnOverflowEEERNS5_INS2_IS0_EELm0ES6_EE
__ZN7WebCore16LegacyWebArchive6createEPNS_12SharedBufferE
-__ZN7WebCore16LegacyWebArchive6createEPNS_4NodeEPNS_11FrameFilterE
+__ZN7WebCore16LegacyWebArchive6createEPNS_4NodeENSt3__18functionIFbRNS_5FrameEEEE
__ZN7WebCore16LegacyWebArchive6createEPNS_5FrameE
__ZN7WebCore16LegacyWebArchive6createEPNS_5RangeE
__ZN7WebCore16LegacyWebArchive6createEv
Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (159088 => 159089)
--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp 2013-11-12 01:51:39 UTC (rev 159089)
@@ -422,7 +422,7 @@
#endif
-PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Node* node, FrameFilter* filter)
+PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Node* node, std::function<bool (Frame&)> frameFilter)
{
ASSERT(node);
if (!node)
@@ -447,7 +447,7 @@
if (nodeType != Node::DOCUMENT_NODE && nodeType != Node::DOCUMENT_TYPE_NODE)
markupString = documentTypeString(node->document()) + markupString;
- return create(markupString, frame, nodeList, filter);
+ return create(markupString, frame, nodeList, std::move(frameFilter));
}
PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(Frame* frame)
@@ -496,7 +496,7 @@
return create(markupString, frame, nodeList, 0);
}
-PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Frame* frame, const Vector<Node*>& nodes, FrameFilter* frameFilter)
+PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Frame* frame, const Vector<Node*>& nodes, std::function<bool (Frame&)> frameFilter)
{
ASSERT(frame);
@@ -520,7 +520,7 @@
Frame* childFrame;
if ((isHTMLFrameElement(node) || isHTMLIFrameElement(node) || isHTMLObjectElement(node))
&& (childFrame = toHTMLFrameOwnerElement(node).contentFrame())) {
- if (frameFilter && !frameFilter->shouldIncludeSubframe(childFrame))
+ if (frameFilter && !frameFilter(*childFrame))
continue;
RefPtr<LegacyWebArchive> subframeArchive = create(childFrame->document(), frameFilter);
Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.h (159088 => 159089)
--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.h 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.h 2013-11-12 01:51:39 UTC (rev 159089)
@@ -30,6 +30,7 @@
#define LegacyWebArchive_h
#include "Archive.h"
+#include <functional>
namespace WebCore {
@@ -37,19 +38,13 @@
class Node;
class Range;
-class FrameFilter {
-public:
- virtual ~FrameFilter() { }
- virtual bool shouldIncludeSubframe(Frame*) const = 0;
-};
-
class LegacyWebArchive : public Archive {
public:
static PassRefPtr<LegacyWebArchive> create();
static PassRefPtr<LegacyWebArchive> create(SharedBuffer*);
static PassRefPtr<LegacyWebArchive> create(const URL&, SharedBuffer*);
static PassRefPtr<LegacyWebArchive> create(PassRefPtr<ArchiveResource> mainResource, Vector<PassRefPtr<ArchiveResource>>& subresources, Vector<PassRefPtr<LegacyWebArchive>>& subframeArchives);
- static PassRefPtr<LegacyWebArchive> create(Node*, FrameFilter* = 0);
+ static PassRefPtr<LegacyWebArchive> create(Node*, std::function<bool (Frame&)> frameFilter = nullptr);
static PassRefPtr<LegacyWebArchive> create(Frame*);
static PassRefPtr<LegacyWebArchive> createFromSelection(Frame*);
static PassRefPtr<LegacyWebArchive> create(Range*);
@@ -63,7 +58,7 @@
enum MainResourceStatus { Subresource, MainResource };
- static PassRefPtr<LegacyWebArchive> create(const String& markupString, Frame*, const Vector<Node*>& nodes, FrameFilter*);
+ static PassRefPtr<LegacyWebArchive> create(const String& markupString, Frame*, const Vector<Node*>& nodes, std::function<bool (Frame&)> frameFilter);
static PassRefPtr<ArchiveResource> createResource(CFDictionaryRef);
static ResourceResponse createResourceResponseFromMacArchivedData(CFDataRef);
static ResourceResponse createResourceResponseFromPropertyListData(CFDataRef, CFStringRef responseDataType);
Modified: trunk/Source/WebKit/mac/ChangeLog (159088 => 159089)
--- trunk/Source/WebKit/mac/ChangeLog 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebKit/mac/ChangeLog 2013-11-12 01:51:39 UTC (rev 159089)
@@ -1,3 +1,13 @@
+2013-11-11 Anders Carlsson <[email protected]>
+
+ FrameFilter can just be an std::function instead
+ https://bugs.webkit.org/show_bug.cgi?id=124176
+
+ Reviewed by Tim Horton.
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode webArchiveByFilteringSubframes:]):
+
2013-11-11 Dan Bernstein <[email protected]>
[Mac] .exp files are not source code
Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm (159088 => 159089)
--- trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm 2013-11-12 01:51:39 UTC (rev 159089)
@@ -75,34 +75,6 @@
@end
-class WebFrameFilter : public WebCore::FrameFilter {
-public:
- WebFrameFilter(WebArchiveSubframeFilter filterBlock);
- ~WebFrameFilter();
-private:
- virtual bool shouldIncludeSubframe(Frame*) const OVERRIDE;
-
- WebArchiveSubframeFilter m_filterBlock;
-};
-
-WebFrameFilter::WebFrameFilter(WebArchiveSubframeFilter filterBlock)
- : m_filterBlock(Block_copy(filterBlock))
-{
-}
-
-WebFrameFilter::~WebFrameFilter()
-{
- Block_release(m_filterBlock);
-}
-
-bool WebFrameFilter::shouldIncludeSubframe(Frame* frame) const
-{
- if (!m_filterBlock)
- return true;
-
- return m_filterBlock(kit(frame));
-}
-
@implementation DOMNode (WebDOMNodeOperations)
- (WebArchive *)webArchive
@@ -112,8 +84,11 @@
- (WebArchive *)webArchiveByFilteringSubframes:(WebArchiveSubframeFilter)webArchiveSubframeFilter
{
- WebFrameFilter filter(webArchiveSubframeFilter);
- return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self), &filter)] autorelease];
+ WebArchive *webArchive = [[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self), [webArchiveSubframeFilter](Frame& subframe) -> bool {
+ return webArchiveSubframeFilter(kit(&subframe));
+ })];
+
+ return [webArchive autorelease];
}
@end
Modified: trunk/Source/WebKit2/ChangeLog (159088 => 159089)
--- trunk/Source/WebKit2/ChangeLog 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebKit2/ChangeLog 2013-11-12 01:51:39 UTC (rev 159089)
@@ -1,5 +1,15 @@
2013-11-11 Anders Carlsson <[email protected]>
+ FrameFilter can just be an std::function instead
+ https://bugs.webkit.org/show_bug.cgi?id=124176
+
+ Reviewed by Tim Horton.
+
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::webArchiveData):
+
+2013-11-11 Anders Carlsson <[email protected]>
+
Remove unused Qt cruft
https://bugs.webkit.org/show_bug.cgi?id=124174
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (159088 => 159089)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2013-11-12 01:17:37 UTC (rev 159088)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp 2013-11-12 01:51:39 UTC (rev 159089)
@@ -734,46 +734,23 @@
}
#if PLATFORM(MAC)
-
-class WebFrameFilter : public FrameFilter {
-public:
- WebFrameFilter(WebFrame*, WebFrame::FrameFilterFunction, void* context);
-
-private:
- virtual bool shouldIncludeSubframe(Frame*) const OVERRIDE;
-
- WebFrame* m_topLevelWebFrame;
- WebFrame::FrameFilterFunction m_callback;
- void* m_context;
-};
-
-WebFrameFilter::WebFrameFilter(WebFrame* topLevelWebFrame, WebFrame::FrameFilterFunction callback, void* context)
- : m_topLevelWebFrame(topLevelWebFrame)
- , m_callback(callback)
- , m_context(context)
+RetainPtr<CFDataRef> WebFrame::webArchiveData(FrameFilterFunction callback, void* context)
{
-}
+ RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(coreFrame()->document(), [this, callback, context](Frame& frame) -> bool {
+ if (!callback)
+ return true;
-bool WebFrameFilter::shouldIncludeSubframe(Frame* frame) const
-{
- if (!m_callback)
- return true;
+ WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(frame.loader().client());
+ WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
+ ASSERT(webFrame);
- WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(frame->loader().client());
- WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0;
- ASSERT(webFrame);
+ return callback(toAPI(this), toAPI(webFrame), context);
+ });
- return m_callback(toAPI(m_topLevelWebFrame), toAPI(webFrame), m_context);
-}
+ if (!archive)
+ return nullptr;
-RetainPtr<CFDataRef> WebFrame::webArchiveData(FrameFilterFunction callback, void* context)
-{
- WebFrameFilter filter(this, callback, context);
-
- if (RefPtr<LegacyWebArchive> archive = LegacyWebArchive::create(coreFrame()->document(), &filter))
- return archive->rawDataRepresentation();
-
- return 0;
+ return archive->rawDataRepresentation();
}
#endif