<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181044] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181044">181044</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2015-03-04 15:52:31 -0800 (Wed, 04 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
https://bugs.webkit.org/show_bug.cgi?id=142313

Reviewed by Anders Carlsson.

ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.

* WebCore.xcodeproj/project.pbxproj:
* platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
* platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaNetworkExtensionContentFilterh">trunk/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformContentFiltercpp">trunk/Source/WebCore/platform/ContentFilter.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformmacContentFilterMacmm">trunk/Source/WebCore/platform/mac/ContentFilterMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181043 => 181044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-04 23:39:24 UTC (rev 181043)
+++ trunk/Source/WebCore/ChangeLog        2015-03-04 23:52:31 UTC (rev 181044)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-03-04  Andy Estes  &lt;aestes@apple.com&gt;
+
+        [Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=142313
+
+        Reviewed by Anders Carlsson.
+
+        ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
+        * platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.
+
</ins><span class="cx"> 2015-03-04  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r179597): Can't see power saver banner for plugins
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (181043 => 181044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-04 23:39:24 UTC (rev 181043)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-03-04 23:52:31 UTC (rev 181044)
</span><span class="lines">@@ -1049,7 +1049,6 @@
</span><span class="cx">                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2917B566147349950052C9D0 /* LayerFlushSchedulerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */; };
</span><span class="cx">                 2919A1E916B3376600787213 /* ContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2919A1E816B3376600787213 /* ContentFilter.h */; };
</span><del>-                2919A1EB16B3378900787213 /* ContentFilterMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2919A1EA16B3378900787213 /* ContentFilterMac.mm */; };
</del><span class="cx">                 2934940A16C02C0700901318 /* PlatformSpeechSynthesisVoice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2527CC9316BF92EC009DDAC0 /* PlatformSpeechSynthesisVoice.cpp */; };
</span><span class="cx">                 2934940B16C02C0A00901318 /* PlatformSpeechSynthesisUtterance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2527CC9516BF95DD009DDAC0 /* PlatformSpeechSynthesisUtterance.cpp */; };
</span><span class="cx">                 293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3802,6 +3801,7 @@
</span><span class="cx">                 A14832CD187F682E00DA63A6 /* WebCoreThreadSafe.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329F187F508700DA63A6 /* WebCoreThreadSafe.h */; };
</span><span class="cx">                 A14832CE187F683400DA63A6 /* WebCoreThreadSystemInterface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A14832A0187F508700DA63A6 /* WebCoreThreadSystemInterface.cpp */; };
</span><span class="cx">                 A14832CF187F684700DA63A6 /* WebCoreThreadSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A15D329D1AA7CF3B009A234A /* ContentFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A15D329C1AA7CF3B009A234A /* ContentFilter.cpp */; };
</ins><span class="cx">                 A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
</span><span class="cx">                 A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
</span><span class="cx">                 A18890AE1AA13F250026C301 /* ParentalControlsContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */; };
</span><span class="lines">@@ -8104,7 +8104,6 @@
</span><span class="cx">                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerFlushSchedulerClient.h; path = ca/LayerFlushSchedulerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LayerFlushSchedulerMac.cpp; path = ca/mac/LayerFlushSchedulerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2919A1E816B3376600787213 /* ContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                2919A1EA16B3378900787213 /* ContentFilterMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentFilterMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 293EAE201356B32E0067ACF9 /* RuntimeApplicationChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeApplicationChecks.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -11035,6 +11034,7 @@
</span><span class="cx">                 A14832A9187F508700DA63A6 /* WKView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKView.h; path = ios/wak/WKView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A14832AA187F508700DA63A6 /* WKView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKView.mm; path = ios/wak/WKView.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A14832AB187F508700DA63A6 /* WKViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKViewPrivate.h; path = ios/wak/WKViewPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A15D329C1AA7CF3B009A234A /* ContentFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentFilter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ParentalControlsContentFilter.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16585,7 +16585,6 @@
</span><span class="cx">                                 F478755319983AFF0024A287 /* AxisScrollSnapAnimator.mm */,
</span><span class="cx">                                 65A640F00533BB1F0085E777 /* BlockExceptions.h */,
</span><span class="cx">                                 65F80697054D9F86008BF776 /* BlockExceptions.mm */,
</span><del>-                                2919A1EA16B3378900787213 /* ContentFilterMac.mm */,
</del><span class="cx">                                 06027CB20B1CC03D00884B2D /* ContextMenuItemMac.mm */,
</span><span class="cx">                                 93B6A0E90B0BCA8400F5027A /* ContextMenuMac.mm */,
</span><span class="cx">                                 F58784F002DE375901EA4122 /* CursorMac.mm */,
</span><span class="lines">@@ -21511,6 +21510,7 @@
</span><span class="cx">                                 C330A22113EC196B0000B45B /* ColorChooser.h */,
</span><span class="cx">                                 C37CDEBC149EF2030042090D /* ColorChooserClient.h */,
</span><span class="cx">                                 BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */,
</span><ins>+                                A15D329C1AA7CF3B009A234A /* ContentFilter.cpp */,
</ins><span class="cx">                                 2919A1E816B3376600787213 /* ContentFilter.h */,
</span><span class="cx">                                 A14090FC1AA51E480091191A /* ContentFilterUnblockHandler.h */,
</span><span class="cx">                                 41D015C90F4B5C71004A662F /* ContentType.cpp */,
</span><span class="lines">@@ -27494,7 +27494,6 @@
</span><span class="cx">                                 A7A78CD51532BA62006C21E4 /* ContainerNodeAlgorithms.cpp in Sources */,
</span><span class="cx">                                 BC5EB9800E82072500B25965 /* ContentData.cpp in Sources */,
</span><span class="cx">                                 57B791A314C6A62900F202D1 /* ContentDistributor.cpp in Sources */,
</span><del>-                                2919A1EB16B3378900787213 /* ContentFilterMac.mm in Sources */,
</del><span class="cx">                                 97C471DB12F925BD0086354B /* ContentSecurityPolicy.cpp in Sources */,
</span><span class="cx">                                 41D015CB0F4B5C71004A662F /* ContentType.cpp in Sources */,
</span><span class="cx">                                 97627B8D14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp in Sources */,
</span><span class="lines">@@ -29103,6 +29102,7 @@
</span><span class="cx">                                 CDB859F7160D48A400E5B07F /* MediaKeyEvent.cpp in Sources */,
</span><span class="cx">                                 CDA98DD816025BEF00FEA3B1 /* MediaKeyMessageEvent.cpp in Sources */,
</span><span class="cx">                                 CD1B4A65160786AE00282DF9 /* MediaKeyNeededEvent.cpp in Sources */,
</span><ins>+                                A15D329D1AA7CF3B009A234A /* ContentFilter.cpp in Sources */,
</ins><span class="cx">                                 6C568CB019DAFEA000430CA2 /* MaskImageOperation.cpp in Sources */,
</span><span class="cx">                                 CDA98E0D1603FE4A00FEA3B1 /* MediaKeys.cpp in Sources */,
</span><span class="cx">                                 7C93F34D1AA6BF0700A98BAB /* ContentExtensionCompiler.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformContentFiltercppfromrev181043trunkSourceWebCoreplatformmacContentFilterMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ContentFilter.cpp (from rev 181043, trunk/Source/WebCore/platform/mac/ContentFilterMac.mm) (0 => 181044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ContentFilter.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/ContentFilter.cpp        2015-03-04 23:52:31 UTC (rev 181044)
</span><span class="lines">@@ -0,0 +1,164 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ContentFilter.h&quot;
+
+#if ENABLE(CONTENT_FILTERING)
+
+#include &quot;NetworkExtensionContentFilter.h&quot;
+#include &quot;ParentalControlsContentFilter.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+struct ContentFilterType {
+    const std::function&lt;bool(const ResourceResponse&amp;)&gt; canHandleResponse;
+    const std::function&lt;std::unique_ptr&lt;ContentFilter&gt;(const ResourceResponse&amp;)&gt; create;
+};
+
+template &lt;typename T&gt;
+static inline ContentFilterType contentFilterType()
+{
+    return { T::canHandleResponse, T::create };
+}
+
+static const Vector&lt;ContentFilterType&gt;&amp; contentFilterTypes()
+{
+    static NeverDestroyed&lt;Vector&lt;ContentFilterType&gt;&gt; types(
+        Vector&lt;ContentFilterType&gt;({
+            contentFilterType&lt;ParentalControlsContentFilter&gt;(),
+#if HAVE(NE_FILTER_SOURCE)
+            contentFilterType&lt;NetworkExtensionContentFilter&gt;()
+#endif
+        })
+    );
+    return types;
+}
+
+class ContentFilterCollection final : public ContentFilter {
+public:
+    using Container = Vector&lt;std::unique_ptr&lt;ContentFilter&gt;&gt;;
+
+    explicit ContentFilterCollection(Container);
+
+    void addData(const char* data, int length) override;
+    void finishedAddingData() override;
+    bool needsMoreData() const override;
+    bool didBlockData() const override;
+    const char* getReplacementData(int&amp; length) const override;
+    ContentFilterUnblockHandler unblockHandler() const override;
+
+private:
+    Container m_contentFilters;
+};
+
+std::unique_ptr&lt;ContentFilter&gt; ContentFilter::createIfNeeded(const ResourceResponse&amp; response)
+{
+    ContentFilterCollection::Container filters;
+    for (auto&amp; type : contentFilterTypes()) {
+        if (type.canHandleResponse(response))
+            filters.append(type.create(response));
+    }
+
+    if (filters.isEmpty())
+        return nullptr;
+
+    return std::make_unique&lt;ContentFilterCollection&gt;(WTF::move(filters));
+}
+
+ContentFilterCollection::ContentFilterCollection(Container contentFilters)
+    : m_contentFilters { WTF::move(contentFilters) }
+{
+    ASSERT(!m_contentFilters.isEmpty());
+}
+
+void ContentFilterCollection::addData(const char* data, int length)
+{
+    ASSERT(needsMoreData());
+
+    for (auto&amp; contentFilter : m_contentFilters)
+        contentFilter-&gt;addData(data, length);
+}
+    
+void ContentFilterCollection::finishedAddingData()
+{
+    ASSERT(needsMoreData());
+
+    for (auto&amp; contentFilter : m_contentFilters)
+        contentFilter-&gt;finishedAddingData();
+
+    ASSERT(!needsMoreData());
+}
+
+bool ContentFilterCollection::needsMoreData() const
+{
+    for (auto&amp; contentFilter : m_contentFilters) {
+        if (contentFilter-&gt;needsMoreData())
+            return true;
+    }
+
+    return false;
+}
+
+bool ContentFilterCollection::didBlockData() const
+{
+    for (auto&amp; contentFilter : m_contentFilters) {
+        if (contentFilter-&gt;didBlockData())
+            return true;
+    }
+
+    return false;
+}
+
+const char* ContentFilterCollection::getReplacementData(int&amp; length) const
+{
+    ASSERT(!needsMoreData());
+
+    for (auto&amp; contentFilter : m_contentFilters) {
+        if (contentFilter-&gt;didBlockData())
+            return contentFilter-&gt;getReplacementData(length);
+    }
+
+    return m_contentFilters[0]-&gt;getReplacementData(length);
+}
+
+ContentFilterUnblockHandler ContentFilterCollection::unblockHandler() const
+{
+    ASSERT(didBlockData());
+
+    for (auto&amp; contentFilter : m_contentFilters) {
+        if (contentFilter-&gt;didBlockData())
+            return contentFilter-&gt;unblockHandler();
+    }
+
+    ASSERT_NOT_REACHED();
+    return { };
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(CONTENT_FILTERING)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaNetworkExtensionContentFilterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h (181043 => 181044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h        2015-03-04 23:39:24 UTC (rev 181043)
+++ trunk/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h        2015-03-04 23:52:31 UTC (rev 181044)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     ContentFilterUnblockHandler unblockHandler() const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    NSInteger m_neFilterSourceStatus;
</del><ins>+    long m_neFilterSourceStatus;
</ins><span class="cx">     RetainPtr&lt;NEFilterSource&gt; m_neFilterSource;
</span><span class="cx">     dispatch_queue_t m_neFilterSourceQueue;
</span><span class="cx">     RetainPtr&lt;NSMutableData&gt; m_originalData;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacContentFilterMacmm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/mac/ContentFilterMac.mm (181043 => 181044)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ContentFilterMac.mm        2015-03-04 23:39:24 UTC (rev 181043)
+++ trunk/Source/WebCore/platform/mac/ContentFilterMac.mm        2015-03-04 23:52:31 UTC (rev 181044)
</span><span class="lines">@@ -1,166 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// FIXME: Rename to ContentFilter.cpp and move to platform/.
-
-#import &quot;config.h&quot;
-#import &quot;ContentFilter.h&quot;
-
-#if ENABLE(CONTENT_FILTERING)
-
-#import &quot;NetworkExtensionContentFilter.h&quot;
-#import &quot;ParentalControlsContentFilter.h&quot;
-#import &lt;wtf/NeverDestroyed.h&gt;
-#import &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-
-struct ContentFilterType {
-    const std::function&lt;bool(const ResourceResponse&amp;)&gt; canHandleResponse;
-    const std::function&lt;std::unique_ptr&lt;ContentFilter&gt;(const ResourceResponse&amp;)&gt; create;
-};
-
-template &lt;typename T&gt;
-static inline ContentFilterType contentFilterType()
-{
-    return { T::canHandleResponse, T::create };
-}
-
-static const Vector&lt;ContentFilterType&gt;&amp; contentFilterTypes()
-{
-    static NeverDestroyed&lt;Vector&lt;ContentFilterType&gt;&gt; types(
-        Vector&lt;ContentFilterType&gt;({
-            contentFilterType&lt;ParentalControlsContentFilter&gt;(),
-#if HAVE(NE_FILTER_SOURCE)
-            contentFilterType&lt;NetworkExtensionContentFilter&gt;()
-#endif
-        })
-    );
-    return types;
-}
-
-class ContentFilterCollection final : public ContentFilter {
-public:
-    using Container = Vector&lt;std::unique_ptr&lt;ContentFilter&gt;&gt;;
-
-    explicit ContentFilterCollection(Container);
-
-    void addData(const char* data, int length) override;
-    void finishedAddingData() override;
-    bool needsMoreData() const override;
-    bool didBlockData() const override;
-    const char* getReplacementData(int&amp; length) const override;
-    ContentFilterUnblockHandler unblockHandler() const override;
-
-private:
-    Container m_contentFilters;
-};
-
-std::unique_ptr&lt;ContentFilter&gt; ContentFilter::createIfNeeded(const ResourceResponse&amp; response)
-{
-    ContentFilterCollection::Container filters;
-    for (auto&amp; type : contentFilterTypes()) {
-        if (type.canHandleResponse(response))
-            filters.append(type.create(response));
-    }
-
-    if (filters.isEmpty())
-        return nullptr;
-
-    return std::make_unique&lt;ContentFilterCollection&gt;(WTF::move(filters));
-}
-
-ContentFilterCollection::ContentFilterCollection(Container contentFilters)
-    : m_contentFilters { WTF::move(contentFilters) }
-{
-    ASSERT(!m_contentFilters.isEmpty());
-}
-
-void ContentFilterCollection::addData(const char* data, int length)
-{
-    ASSERT(needsMoreData());
-
-    for (auto&amp; contentFilter : m_contentFilters)
-        contentFilter-&gt;addData(data, length);
-}
-    
-void ContentFilterCollection::finishedAddingData()
-{
-    ASSERT(needsMoreData());
-
-    for (auto&amp; contentFilter : m_contentFilters)
-        contentFilter-&gt;finishedAddingData();
-
-    ASSERT(!needsMoreData());
-}
-
-bool ContentFilterCollection::needsMoreData() const
-{
-    for (auto&amp; contentFilter : m_contentFilters) {
-        if (contentFilter-&gt;needsMoreData())
-            return true;
-    }
-
-    return false;
-}
-
-bool ContentFilterCollection::didBlockData() const
-{
-    for (auto&amp; contentFilter : m_contentFilters) {
-        if (contentFilter-&gt;didBlockData())
-            return true;
-    }
-
-    return false;
-}
-
-const char* ContentFilterCollection::getReplacementData(int&amp; length) const
-{
-    ASSERT(!needsMoreData());
-
-    for (auto&amp; contentFilter : m_contentFilters) {
-        if (contentFilter-&gt;didBlockData())
-            return contentFilter-&gt;getReplacementData(length);
-    }
-
-    return m_contentFilters[0]-&gt;getReplacementData(length);
-}
-
-ContentFilterUnblockHandler ContentFilterCollection::unblockHandler() const
-{
-    ASSERT(didBlockData());
-
-    for (auto&amp; contentFilter : m_contentFilters) {
-        if (contentFilter-&gt;didBlockData())
-            return contentFilter-&gt;unblockHandler();
-    }
-
-    ASSERT_NOT_REACHED();
-    return { };
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(CONTENT_FILTERING)
</del></span></pre>
</div>
</div>

</body>
</html>