<!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>[180766] trunk/Source</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/180766">180766</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-02-27 10:33:39 -0800 (Fri, 27 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add API to remove a single content filter.
&lt;rdar://problem/19977764&gt; and https://bugs.webkit.org/show_bug.cgi?id=142088

Reviewed by Sam Weinig.

Source/WebCore:

* page/UserContentController.cpp:
(WebCore::UserContentController::removeUserContentFilter):
* page/UserContentController.h:

Source/WebKit2:

* Shared/WebPageGroupData.h:

* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupRemoveUserContentFilter):

* UIProcess/API/C/WKPageGroup.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController _removeUserContentFilter:]):

* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserContentFilter):
(WebKit::WebUserContentControllerProxy::removeUserContentFilter):
(WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
* UIProcess/UserContent/WebUserContentControllerProxy.h:

* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::addUserContentFilter):
(WebKit::WebPageGroup::removeUserContentFilter):
* UIProcess/WebPageGroup.h:

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::removeUserContentFilter):
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:

* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::WebPageGroupProxy):
(WebKit::WebPageGroupProxy::removeUserContentFilter):
* WebProcess/WebPage/WebPageGroupProxy.h:
* WebProcess/WebPage/WebPageGroupProxy.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllercpp">trunk/Source/WebCore/page/UserContentController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllerh">trunk/Source/WebCore/page/UserContentController.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageGroupDatah">trunk/Source/WebKit2/Shared/WebPageGroupData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageGroupcpp">trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageGrouph">trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh">trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageGroupcpp">trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageGrouph">trunk/Source/WebKit2/UIProcess/WebPageGroup.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessUserContentWebUserContentControllermessagesin">trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxycpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxyh">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageGroupProxymessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebCore/ChangeLog        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-27  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add API to remove a single content filter.
+        &lt;rdar://problem/19977764&gt; and https://bugs.webkit.org/show_bug.cgi?id=142088
+
+        Reviewed by Sam Weinig.
+
+        * page/UserContentController.cpp:
+        (WebCore::UserContentController::removeUserContentFilter):
+        * page/UserContentController.h:
+
</ins><span class="cx"> 2015-02-26  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Remove remaining SafariTheme cruft
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -187,6 +187,14 @@
</span><span class="cx">     m_contentExtensionBackend-&gt;setRuleList(name, ContentExtensions::ExtensionsManager::createRuleList(ruleList));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UserContentController::removeUserContentFilter(const String&amp; name)
+{
+    if (!m_contentExtensionBackend)
+        return;
+
+    m_contentExtensionBackend-&gt;removeRuleList(name);
+}
+
</ins><span class="cx"> void UserContentController::removeAllUserContentFilters()
</span><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebCore/page/UserContentController.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -81,6 +81,7 @@
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     // FIXME: This should really take a pointer to a compiled UserContentFilter.
</span><span class="cx">     WEBCORE_EXPORT void addUserContentFilter(const String&amp; name, const String&amp; ruleList);
</span><ins>+    WEBCORE_EXPORT void removeUserContentFilter(const String&amp; name);
</ins><span class="cx">     WEBCORE_EXPORT void removeAllUserContentFilters();
</span><span class="cx">     
</span><span class="cx">     // FIXME: Consider putting this (and other future content filter predicates) in its own class.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2015-02-27  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add API to remove a single content filter.
+        &lt;rdar://problem/19977764&gt; and https://bugs.webkit.org/show_bug.cgi?id=142088
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebPageGroupData.h:
+
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupRemoveUserContentFilter):
+
+        * UIProcess/API/C/WKPageGroup.h:
+        * UIProcess/API/Cocoa/WKUserContentController.mm:
+        (-[WKUserContentController _removeUserContentFilter:]):
+
+        * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
+        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+        (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
+        (WebKit::WebUserContentControllerProxy::addProcess):
+        (WebKit::WebUserContentControllerProxy::addUserContentFilter):
+        (WebKit::WebUserContentControllerProxy::removeUserContentFilter):
+        (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
+        * UIProcess/UserContent/WebUserContentControllerProxy.h:
+
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::addUserContentFilter):
+        (WebKit::WebPageGroup::removeUserContentFilter):
+        * UIProcess/WebPageGroup.h:
+
+        * WebProcess/UserContent/WebUserContentController.cpp:
+        (WebKit::WebUserContentController::removeUserContentFilter):
+        * WebProcess/UserContent/WebUserContentController.h:
+        * WebProcess/UserContent/WebUserContentController.messages.in:
+
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::WebPageGroupProxy):
+        (WebKit::WebPageGroupProxy::removeUserContentFilter):
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        * WebProcess/WebPage/WebPageGroupProxy.messages.in:
+
</ins><span class="cx"> 2015-02-26  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add API to remove all website data for the given data records
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageGroupDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageGroupData.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageGroupData.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/Shared/WebPageGroupData.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -28,7 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;WebCore/UserScript.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserStyleSheet.h&gt;
</span><del>-#include &lt;wtf/Vector.h&gt;
</del><ins>+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace IPC {
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx">     Vector&lt;WebCore::UserScript&gt; userScripts;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters;
</del><ins>+    HashMap&lt;String, String&gt; userContentFilters;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -89,6 +89,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKPageGroupRemoveUserContentFilter(WKPageGroupRef pageGroupRef, WKStringRef userContentFilterNameRef)
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    toImpl(pageGroupRef)-&gt;removeUserContentFilter(toWTFString(userContentFilterNameRef));
+#else
+    UNUSED_PARAM(pageGroupRef);
+    UNUSED_PARAM(userContentFilterNameRef);
+#endif
+}
+
+
</ins><span class="cx"> void WKPageGroupRemoveAllUserContentFilters(WKPageGroupRef pageGroupRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> WK_EXPORT void WKPageGroupRemoveAllUserScripts(WKPageGroupRef pageGroup);
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKPageGroupAddUserContentFilter(WKPageGroupRef pageGroup, WKUserContentFilterRef userContentFilter);
</span><ins>+WK_EXPORT void WKPageGroupRemoveUserContentFilter(WKPageGroupRef pageGroup, WKStringRef userContentFilterName);
</ins><span class="cx"> WK_EXPORT void WKPageGroupRemoveAllUserContentFilters(WKPageGroupRef pageGroup);
</span><span class="cx"> 
</span><span class="cx"> #ifdef __cplusplus
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -134,6 +134,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_removeUserContentFilter:(NSString *)userContentFilterName
+{
+#if ENABLE(CONTENT_EXTENSIONS)
+    _userContentControllerProxy-&gt;removeUserContentFilter(userContentFilterName);
+#endif
+}
+
</ins><span class="cx"> - (void)_removeAllUserContentFilters
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> @interface WKUserContentController (WKPrivate)
</span><span class="cx"> 
</span><span class="cx"> - (void)_addUserContentFilter:(_WKUserContentFilter *)userContentFilter WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
</span><ins>+- (void)_removeUserContentFilter:(NSString *)userContentFilterName WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
</ins><span class="cx"> - (void)_removeAllUserContentFilters WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -51,9 +51,6 @@
</span><span class="cx"> WebUserContentControllerProxy::WebUserContentControllerProxy()
</span><span class="cx">     : m_identifier(generateIdentifier())
</span><span class="cx">     , m_userScripts(*API::Array::create())
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-    , m_userContentFilters(*API::Array::create())
-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -86,7 +83,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters;
</span><del>-    for (const auto&amp; userContentFilter : m_userContentFilters-&gt;elementsOfType&lt;API::UserContentFilter&gt;())
</del><ins>+    for (const auto&amp; userContentFilter : m_userContentFilters.values())
</ins><span class="cx">         userContentFilters.append(std::make_pair(userContentFilter-&gt;name(), userContentFilter-&gt;serializedRules()));
</span><span class="cx">     webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters(userContentFilters), m_identifier);
</span><span class="cx"> #endif
</span><span class="lines">@@ -187,7 +184,7 @@
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> void WebUserContentControllerProxy::addUserContentFilter(API::UserContentFilter&amp; userContentFilter)
</span><span class="cx"> {
</span><del>-    m_userContentFilters-&gt;elements().append(&amp;userContentFilter);
</del><ins>+    m_userContentFilters.set(userContentFilter.name(), &amp;userContentFilter);
</ins><span class="cx"> 
</span><span class="cx">     auto pair = std::make_pair(userContentFilter.name(), userContentFilter.serializedRules());
</span><span class="cx"> 
</span><span class="lines">@@ -195,9 +192,17 @@
</span><span class="cx">         process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters({ pair }), m_identifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebUserContentControllerProxy::removeUserContentFilter(const String&amp; name)
+{
+    m_userContentFilters.remove(name);
+
+    for (WebProcessProxy* process : m_processes)
+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserContentFilter(name), m_identifier);
+}
+
</ins><span class="cx"> void WebUserContentControllerProxy::removeAllUserContentFilters()
</span><span class="cx"> {
</span><del>-    m_userContentFilters-&gt;elements().clear();
</del><ins>+    m_userContentFilters.clear();
</ins><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><span class="cx">         process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserContentFilters(), m_identifier);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><ins>+#include &lt;wtf/text/StringHash.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="cx"> class Array;
</span><span class="lines">@@ -83,6 +84,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     void addUserContentFilter(API::UserContentFilter&amp;);
</span><ins>+    void removeUserContentFilter(const String&amp;);
</ins><span class="cx">     void removeAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -99,7 +101,7 @@
</span><span class="cx">     HashMap&lt;uint64_t, RefPtr&lt;WebScriptMessageHandler&gt;&gt; m_scriptMessageHandlers;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    Ref&lt;API::Array&gt; m_userContentFilters;
</del><ins>+    HashMap&lt;String, RefPtr&lt;API::UserContentFilter&gt;&gt; m_userContentFilters;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -175,10 +175,16 @@
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> void WebPageGroup::addUserContentFilter(const API::UserContentFilter&amp; userContentFilter)
</span><span class="cx"> {
</span><del>-    m_data.userContentFilters.append(std::make_pair(userContentFilter.name(), userContentFilter.serializedRules()));
</del><ins>+    m_data.userContentFilters.set(userContentFilter.name(), userContentFilter.serializedRules());
</ins><span class="cx">     sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserContentFilter(userContentFilter.name(), userContentFilter.serializedRules()), m_data.pageGroupID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageGroup::removeUserContentFilter(const String&amp; contentFilterName)
+{
+    m_data.userContentFilters.remove(contentFilterName);
+    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveUserContentFilter(contentFilterName), m_data.pageGroupID);
+}
+
</ins><span class="cx"> void WebPageGroup::removeAllUserContentFilters()
</span><span class="cx"> {
</span><span class="cx">     m_data.userContentFilters.clear();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;WebProcessProxy.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/text/WTFString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -67,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     void addUserContentFilter(const API::UserContentFilter&amp;);
</span><ins>+    void removeUserContentFilter(const String&amp;);
</ins><span class="cx">     void removeAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -187,6 +187,11 @@
</span><span class="cx">         m_userContentController-&gt;addUserContentFilter(userContentFilter.first, userContentFilter.second);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebUserContentController::removeUserContentFilter(const String&amp; name)
+{
+    m_userContentController-&gt;removeUserContentFilter(name);
+}
+
</ins><span class="cx"> void WebUserContentController::removeAllUserContentFilters()
</span><span class="cx"> {
</span><span class="cx">     m_userContentController-&gt;removeAllUserContentFilters();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     void addUserContentFilters(const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;);
</span><ins>+    void removeUserContentFilter(const String&amp; name);
</ins><span class="cx">     void removeAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     AddUserContentFilters(Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters);
</span><ins>+    RemoveUserContentFilter(String name);
</ins><span class="cx">     RemoveAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -54,8 +54,8 @@
</span><span class="cx">         addUserScript(userScript);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    for (const auto&amp; pair : data.userContentFilters)
-        addUserContentFilter(pair.first, pair.second);
</del><ins>+    for (const auto&amp; slot : data.userContentFilters)
+        addUserContentFilter(slot.key, slot.value);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -102,6 +102,11 @@
</span><span class="cx">     userContentController().addUserContentFilter(name, serializedRules);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageGroupProxy::removeUserContentFilter(const String&amp; name)
+{
+    userContentController().removeUserContentFilter(name);
+}
+
</ins><span class="cx"> void WebPageGroupProxy::removeAllUserContentFilters()
</span><span class="cx"> {
</span><span class="cx">     userContentController().removeAllUserContentFilters();    
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     void addUserContentFilter(const String&amp; name, const String&amp; serializedRules);
</span><ins>+    void removeUserContentFilter(const String&amp; name);
</ins><span class="cx">     void removeAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in (180765 => 180766)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2015-02-27 18:09:46 UTC (rev 180765)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2015-02-27 18:33:39 UTC (rev 180766)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     AddUserContentFilter(String name, String serializedRules);
</span><ins>+    RemoveUserContentFilter(String name);
</ins><span class="cx">     RemoveAllUserContentFilters();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>