<!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>[181200] trunk</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/181200">181200</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2015-03-06 18:41:44 -0800 (Fri, 06 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Content Extensions] Move compiling of content extensions to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=142402

Reviewed by Benjamin Poulain.

Source/WebCore:

* contentextensions/CompiledContentExtension.cpp:
(WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
(WebCore::ContentExtensions::CompiledContentExtension::create): Deleted.
(WebCore::ContentExtensions::CompiledContentExtension::CompiledContentExtension): Deleted.
* contentextensions/CompiledContentExtension.h:
(WebCore::ContentExtensions::CompiledContentExtension::bytecode): Deleted.
(WebCore::ContentExtensions::CompiledContentExtension::actions): Deleted.
Convert CompiledContentExtension to be an abstract base class so that we can back it however
we like at the WebKit level. Since it doesn't necessarily use Vectors for its backing store
any more, change the interface to use pointer/length.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
Change compileRuleList to return compiled result as the raw Vectors rather than as
a CompiledContentExtension, since that class is now abstract. It is up to the caller
to copy the data into its final home.

* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Action::deserialize):
* contentextensions/ContentExtensionRule.h:
Switch Action::deserialize to take pointer/length rather than a Vector.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
Pull getting the serialized actions from the compiled extension out of the loop
to avoid calling the virtual function multiple times. Pass the bytecode and actions
as pointer/length pairs rather than Vectors.

* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::getBits):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFABytecodeInterpreter.h:
(WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
Switch the interpreter to take pointer/length rather than a Vector.

* page/UserContentController.cpp:
(WebCore::UserContentController::addUserContentExtension):
(WebCore::UserContentController::removeUserContentExtension):
(WebCore::UserContentController::removeAllUserContentExtensions):
(WebCore::UserContentController::addUserContentFilter): Deleted.
(WebCore::UserContentController::removeUserContentFilter): Deleted.
(WebCore::UserContentController::removeAllUserContentFilters): Deleted.
* page/UserContentController.h:
Unify terminology to use the term UserContentExtension rather than UserContentFilter.

Source/WebKit2:

* Shared/API/APIObject.h:
Rename UserContentFilter type to UserContentExtension to match new unified naming.

* Shared/WebCompiledContentExtension.cpp: Added.
(WebKit::WebCompiledContentExtension::create):
(WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
(WebKit::WebCompiledContentExtension::~WebCompiledContentExtension):
(WebKit::WebCompiledContentExtension::bytecode):
(WebKit::WebCompiledContentExtension::bytecodeLength):
(WebKit::WebCompiledContentExtension::actions):
(WebKit::WebCompiledContentExtension::actionsLength):
* Shared/WebCompiledContentExtension.h: Added.
Add new WebKit2 implementation of CompiledContentExtension. Right now it is the same as the old
WebCore based CompiledContentExtension, but in subsequent patches, it will use shared/file backed
memory.

* Shared/WebCompiledContentExtensionData.cpp: Added.
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h: Added.
Add encodable/decodable holder for the compiled content extension data for use in IPC. Right
now it is doing the naive thing and always copying the data, but in subsequent patches, it will
use shared/file backed memory.

* Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode):
(WebKit::WebPageGroupData::decode):
* Shared/WebPageGroupData.h:
Rename member to match new unification on the name userContentExtension. Change the value from
the serialized JSON (as a String) to WebCompiledContentExtensionData.

* UIProcess/API/APIUserContentExtension.cpp: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp.
(API::UserContentExtension::UserContentExtension):
(API::UserContentExtension::~UserContentExtension):
(API::UserContentFilter::UserContentFilter): Deleted.
(API::UserContentFilter::~UserContentFilter): Deleted.
* UIProcess/API/APIUserContentExtension.h: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.h.
* UIProcess/API/APIUserContentFilter.cpp: Removed.
* UIProcess/API/APIUserContentFilter.h: Removed.
Renamed UserContentFilter to APIUserContentExtension. Updated to store the compiled extension (as a WebCompiledContentExtension)
rather than the serialized JSON.

* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKPageGroup.cpp:
(WKPageGroupAddUserContentFilter):
(WKPageGroupRemoveUserContentFilter):
(WKPageGroupRemoveAllUserContentFilters):
* UIProcess/API/C/WKUserContentControllerRef.cpp:
(WKUserContentControllerAddUserContentFilter):
(WKUserContentControllerRemoveAllUserContentFilters):
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController _addUserContentFilter:]):
(-[WKUserContentController _removeUserContentFilter:]):
(-[WKUserContentController _removeAllUserContentFilters]):
Update for rename of APIUserContentFilter -&gt; UserContentExtension.

* UIProcess/API/C/WKUserContentFilterRef.cpp:
(WKUserContentFilterGetTypeID):
(WKUserContentFilterCreate):
Update for rename of APIUserContentFilter -&gt; UserContentExtension. Also make WKUserContentFilterCreate eagerly
compile rule list to a WebCompiledContentExtensionData.

* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]):
(-[_WKUserContentFilter dealloc]):
(-[_WKUserContentFilter _apiObject]):
Update for rename of APIUserContentFilter -&gt; UserContentExtension. Also make initWithName:serializedRules: eagerly
compile rule list to a WebCompiledContentExtensionData.

* UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
(WebKit::wrapper):
Update for rename of APIUserContentFilter -&gt; UserContentExtension.

* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserContentExtension):
(WebKit::WebUserContentControllerProxy::removeUserContentExtension):
(WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions):
(WebKit::WebUserContentControllerProxy::addUserContentFilter): Deleted.
(WebKit::WebUserContentControllerProxy::removeUserContentFilter): Deleted.
(WebKit::WebUserContentControllerProxy::removeAllUserContentFilters): Deleted.
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::addUserContentExtension):
(WebKit::WebPageGroup::removeUserContentExtension):
(WebKit::WebPageGroup::removeAllUserContentExtensions):
(WebKit::WebPageGroup::addUserContentFilter): Deleted.
(WebKit::WebPageGroup::removeUserContentFilter): Deleted.
(WebKit::WebPageGroup::removeAllUserContentFilters): Deleted.
* UIProcess/WebPageGroup.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addUserContentExtensions):
(WebKit::WebUserContentController::removeUserContentExtension):
(WebKit::WebUserContentController::removeAllUserContentExtensions):
(WebKit::WebUserContentController::addUserContentFilters): Deleted.
(WebKit::WebUserContentController::removeUserContentFilter): Deleted.
(WebKit::WebUserContentController::removeAllUserContentFilters): Deleted.
* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.messages.in:
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::WebPageGroupProxy):
(WebKit::WebPageGroupProxy::addUserContentExtension):
(WebKit::WebPageGroupProxy::removeUserContentExtension):
(WebKit::WebPageGroupProxy::removeAllUserContentExtensions):
(WebKit::WebPageGroupProxy::addUserContentFilter): Deleted.
(WebKit::WebPageGroupProxy::removeUserContentFilter): Deleted.
(WebKit::WebPageGroupProxy::removeAllUserContentFilters): Deleted.
* WebProcess/WebPage/WebPageGroupProxy.h:
* WebProcess/WebPage/WebPageGroupProxy.messages.in:
Pipe the compiled extension from the UIProcess to the WebProcess.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp: Copied from Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp.
(TestWebKitAPI::InMemoryCompiledContentExtension::create):
(TestWebKitAPI::InMemoryCompiledContentExtension::~InMemoryCompiledContentExtension):
(TestWebKitAPI::InMemoryCompiledContentExtension::InMemoryCompiledContentExtension):
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/ContentFilter.cpp: Removed.
Update test for new name (ContentFilter -&gt; ContentExtensions) and API (CompiledContentExtension
is now abstract).</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsCompiledContentExtensioncpp">trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsCompiledContentExtensionh">trunk/Source/WebCore/contentextensions/CompiledContentExtension.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionCompilercpp">trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionCompilerh">trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionRulecpp">trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionRuleh">trunk/Source/WebCore/contentextensions/ContentExtensionRule.h</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsDFABytecodeInterpreterh">trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h</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="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIAPIObjecth">trunk/Source/WebKit2/Shared/API/APIObject.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageGroupDatacpp">trunk/Source/WebKit2/Shared/WebPageGroupData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPageGroupDatah">trunk/Source/WebKit2/Shared/WebPageGroupData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKAPICasth">trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPageGroupcpp">trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefcpp">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefcpp">trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFiltermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.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="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</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>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedWebCompiledContentExtensioncpp">trunk/Source/WebKit2/Shared/WebCompiledContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCompiledContentExtensionh">trunk/Source/WebKit2/Shared/WebCompiledContentExtension.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCompiledContentExtensionDatacpp">trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCompiledContentExtensionDatah">trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentExtensioncpp">trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentExtensionh">trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreContentExtensionscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentFiltercpp">trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIUserContentFilterh">trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreContentFiltercpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/ChangeLog        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2015-03-06  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [Content Extensions] Move compiling of content extensions to the UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=142402
+
+        Reviewed by Benjamin Poulain.
+
+        * contentextensions/CompiledContentExtension.cpp:
+        (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
+        (WebCore::ContentExtensions::CompiledContentExtension::create): Deleted.
+        (WebCore::ContentExtensions::CompiledContentExtension::CompiledContentExtension): Deleted.
+        * contentextensions/CompiledContentExtension.h:
+        (WebCore::ContentExtensions::CompiledContentExtension::bytecode): Deleted.
+        (WebCore::ContentExtensions::CompiledContentExtension::actions): Deleted.
+        Convert CompiledContentExtension to be an abstract base class so that we can back it however
+        we like at the WebKit level. Since it doesn't necessarily use Vectors for its backing store
+        any more, change the interface to use pointer/length.
+
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::compileRuleList):
+        * contentextensions/ContentExtensionCompiler.h:
+        Change compileRuleList to return compiled result as the raw Vectors rather than as
+        a CompiledContentExtension, since that class is now abstract. It is up to the caller
+        to copy the data into its final home.
+
+        * contentextensions/ContentExtensionRule.cpp:
+        (WebCore::ContentExtensions::Action::deserialize):
+        * contentextensions/ContentExtensionRule.h:
+        Switch Action::deserialize to take pointer/length rather than a Vector.
+
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
+        Pull getting the serialized actions from the compiled extension out of the loop
+        to avoid calling the virtual function multiple times. Pass the bytecode and actions
+        as pointer/length pairs rather than Vectors.
+
+        * contentextensions/DFABytecodeInterpreter.cpp:
+        (WebCore::ContentExtensions::getBits):
+        (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
+        * contentextensions/DFABytecodeInterpreter.h:
+        (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
+        Switch the interpreter to take pointer/length rather than a Vector.
+
+        * page/UserContentController.cpp:
+        (WebCore::UserContentController::addUserContentExtension):
+        (WebCore::UserContentController::removeUserContentExtension):
+        (WebCore::UserContentController::removeAllUserContentExtensions):
+        (WebCore::UserContentController::addUserContentFilter): Deleted.
+        (WebCore::UserContentController::removeUserContentFilter): Deleted.
+        (WebCore::UserContentController::removeAllUserContentFilters): Deleted.
+        * page/UserContentController.h:
+        Unify terminology to use the term UserContentExtension rather than UserContentFilter.
+
</ins><span class="cx"> 2015-03-06  Roger Fong  &lt;roger_fong@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Redraw timeline background when updating media time.
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsCompiledContentExtensioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/CompiledContentExtension.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -31,17 +31,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-Ref&lt;CompiledContentExtension&gt; CompiledContentExtension::create(Vector&lt;DFABytecode&gt;&amp;&amp; bytecode, Vector&lt;SerializedActionByte&gt;&amp;&amp; actions)
</del><ins>+CompiledContentExtension::~CompiledContentExtension()
</ins><span class="cx"> {
</span><del>-    return WTF::adoptRef(*new CompiledContentExtension(WTF::move(bytecode), WTF::move(actions)));
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-CompiledContentExtension::CompiledContentExtension(Vector&lt;DFABytecode&gt;&amp;&amp; bytecode, Vector&lt;SerializedActionByte&gt;&amp;&amp; actions)
-    : m_bytecode(WTF::move(bytecode))
-    , m_actions(WTF::move(actions))
-{
-}
-
</del><span class="cx"> } // namespace ContentExtensions
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsCompiledContentExtensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/CompiledContentExtension.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/CompiledContentExtension.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/CompiledContentExtension.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -34,25 +34,19 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-
</del><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-class CompiledContentExtension : public ThreadSafeRefCounted&lt;CompiledContentExtension&gt; {
</del><ins>+class WEBCORE_EXPORT CompiledContentExtension : public ThreadSafeRefCounted&lt;CompiledContentExtension&gt; {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;CompiledContentExtension&gt; create(Vector&lt;DFABytecode&gt;&amp;&amp;, Vector&lt;SerializedActionByte&gt;&amp;&amp;);
</del><ins>+    virtual ~CompiledContentExtension();
</ins><span class="cx"> 
</span><del>-    const Vector&lt;DFABytecode&gt;&amp; bytecode() const { return m_bytecode; }
-    const Vector&lt;SerializedActionByte&gt;&amp; actions() const { return m_actions; }
-
-private:
-    CompiledContentExtension(Vector&lt;DFABytecode&gt;&amp;&amp;, Vector&lt;SerializedActionByte&gt;&amp;&amp;);
-
-    Vector&lt;DFABytecode&gt; m_bytecode;
-    Vector&lt;SerializedActionByte&gt; m_actions;
</del><ins>+    virtual const DFABytecode* bytecode() const = 0;
+    virtual unsigned bytecodeLength() const = 0;
+    virtual const SerializedActionByte* actions() const = 0;
+    virtual unsigned actionsLength() const = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span><del>-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(CONTENT_EXTENSIONS)
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Ref&lt;CompiledContentExtension&gt; compileRuleList(const String&amp; ruleList)
</del><ins>+CompiledContentExtensionData compileRuleList(const String&amp; ruleList)
</ins><span class="cx"> {
</span><span class="cx">     auto parsedRuleList = parseRuleList(ruleList);
</span><span class="cx"> 
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">     DFABytecodeCompiler compiler(dfa, bytecode);
</span><span class="cx">     compiler.compile();
</span><span class="cx"> 
</span><del>-    return CompiledContentExtension::create(WTF::move(bytecode), WTF::move(actions));
</del><ins>+    return { WTF::move(bytecode), WTF::move(actions) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionCompilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionCompiler.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -35,8 +35,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT Ref&lt;CompiledContentExtension&gt; compileRuleList(const String&amp;);
</del><ins>+struct CompiledContentExtensionData {
+    Vector&lt;DFABytecode&gt; bytecode;
+    Vector&lt;SerializedActionByte&gt; actions;
+};
</ins><span class="cx"> 
</span><ins>+WEBCORE_EXPORT CompiledContentExtensionData compileRuleList(const String&amp;);
+
</ins><span class="cx"> } // namespace ContentExtensions
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRulecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">     ASSERT(!m_trigger.urlFilter.isEmpty());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Action Action::deserialize(const Vector&lt;SerializedActionByte&gt;&amp; actions, unsigned location)
</del><ins>+Action Action::deserialize(const SerializedActionByte* actions, const unsigned actionsLength, unsigned location)
</ins><span class="cx"> {
</span><span class="cx">     switch (static_cast&lt;ActionType&gt;(actions[location])) {
</span><span class="cx">     case ActionType::BlockCookies:
</span><span class="lines">@@ -52,15 +52,15 @@
</span><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx">     case ActionType::CSSDisplayNone: {
</span><span class="cx">         unsigned stringStartIndex = location + sizeof(ActionType) + sizeof(unsigned) + sizeof(bool);
</span><del>-        RELEASE_ASSERT(actions.size() &gt;= stringStartIndex);
</del><ins>+        RELEASE_ASSERT(actionsLength &gt;= stringStartIndex);
</ins><span class="cx">         unsigned selectorLength = *reinterpret_cast&lt;const unsigned*&gt;(&amp;actions[location + sizeof(ActionType)]);
</span><span class="cx">         bool wideCharacters = actions[location + sizeof(ActionType) + sizeof(unsigned)];
</span><span class="cx">         
</span><span class="cx">         if (wideCharacters) {
</span><del>-            RELEASE_ASSERT(actions.size() &gt;= stringStartIndex + selectorLength * sizeof(UChar));
</del><ins>+            RELEASE_ASSERT(actionsLength &gt;= stringStartIndex + selectorLength * sizeof(UChar));
</ins><span class="cx">             return Action(ActionType::CSSDisplayNone, String(reinterpret_cast&lt;const UChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
</span><span class="cx">         }
</span><del>-        RELEASE_ASSERT(actions.size() &gt;= stringStartIndex + selectorLength * sizeof(LChar));
</del><ins>+        RELEASE_ASSERT(actionsLength &gt;= stringStartIndex + selectorLength * sizeof(LChar));
</ins><span class="cx">         return Action(ActionType::CSSDisplayNone, String(reinterpret_cast&lt;const LChar*&gt;(&amp;actions[stringStartIndex]), selectorLength));
</span><span class="cx">     }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionRuleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionRule.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionRule.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">         return m_type == other.m_type
</span><span class="cx">             &amp;&amp; m_cssSelector == other.m_cssSelector;
</span><span class="cx">     }
</span><del>-    static Action deserialize(const Vector&lt;SerializedActionByte&gt;&amp;, unsigned location);
</del><ins>+    static Action deserialize(const SerializedActionByte* actions, const unsigned actionsLength, unsigned location);
</ins><span class="cx"> 
</span><span class="cx">     ActionType type() const { return m_type; }
</span><span class="cx">     const String&amp; cssSelector() const { return m_cssSelector; }
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -67,11 +67,14 @@
</span><span class="cx">     ASSERT_WITH_MESSAGE(urlString.containsOnlyASCII(), &quot;A decoded URL should only contain ASCII characters. The matching algorithm assumes the input is ASCII.&quot;);
</span><span class="cx">     const CString&amp; urlCString = urlString.utf8();
</span><span class="cx"> 
</span><del>-    Vector&lt;Action&gt; actions;
</del><ins>+    Vector&lt;Action&gt; finalActions;
</ins><span class="cx">     for (auto&amp; compiledContentExtension : m_contentExtensions.values()) {
</span><del>-        DFABytecodeInterpreter interpreter(compiledContentExtension-&gt;bytecode());
</del><ins>+        DFABytecodeInterpreter interpreter(compiledContentExtension-&gt;bytecode(), compiledContentExtension-&gt;bytecodeLength());
</ins><span class="cx">         DFABytecodeInterpreter::Actions triggeredActions = interpreter.interpret(urlCString);
</span><span class="cx">         
</span><ins>+        const SerializedActionByte* actions = compiledContentExtension-&gt;actions();
+        const unsigned actionsLength = compiledContentExtension-&gt;actionsLength();
+        
</ins><span class="cx">         if (!triggeredActions.isEmpty()) {
</span><span class="cx">             Vector&lt;unsigned&gt; actionLocations;
</span><span class="cx">             actionLocations.reserveInitialCapacity(triggeredActions.size());
</span><span class="lines">@@ -81,14 +84,14 @@
</span><span class="cx">             
</span><span class="cx">             // Add actions in reverse order to properly deal with IgnorePreviousRules.
</span><span class="cx">             for (unsigned i = actionLocations.size(); i; i--) {
</span><del>-                Action action = Action::deserialize(compiledContentExtension-&gt;actions(), actionLocations[i - 1]);
</del><ins>+                Action action = Action::deserialize(actions, actionsLength, actionLocations[i - 1]);
</ins><span class="cx">                 if (action.type() == ActionType::IgnorePreviousRules)
</span><span class="cx">                     break;
</span><del>-                actions.append(action);
</del><ins>+                finalActions.append(action);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return actions;
</del><ins>+    return finalActions;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -35,8 +35,9 @@
</span><span class="cx"> namespace ContentExtensions {
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename IntType&gt;
</span><del>-static inline IntType getBits(const Vector&lt;DFABytecode&gt;&amp; bytecode, unsigned index)
</del><ins>+static inline IntType getBits(const DFABytecode* bytecode, unsigned bytecodeLength, unsigned index)
</ins><span class="cx"> {
</span><ins>+    ASSERT_UNUSED(bytecodeLength, index + sizeof(IntType) &lt;= bytecodeLength);
</ins><span class="cx">     return *reinterpret_cast&lt;const IntType*&gt;(&amp;bytecode[index]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +52,8 @@
</span><span class="cx">     
</span><span class="cx">     // This should always terminate if interpreting correctly compiled bytecode.
</span><span class="cx">     while (true) {
</span><del>-        switch (static_cast&lt;DFABytecodeInstruction&gt;(bytecode[programCounter])) {
</del><ins>+        ASSERT(programCounter &lt;= m_bytecodeLength);
+        switch (static_cast&lt;DFABytecodeInstruction&gt;(m_bytecode[programCounter])) {
</ins><span class="cx"> 
</span><span class="cx">         case DFABytecodeInstruction::Terminate:
</span><span class="cx">             return actions;
</span><span class="lines">@@ -60,20 +62,20 @@
</span><span class="cx">             // Check to see if the next character in the url is the value stored with the bytecode.
</span><span class="cx">             if (!url[urlIndex])
</span><span class="cx">                 return actions; // Reached null character at end.
</span><del>-            if (url[urlIndex] == getBits&lt;uint8_t&gt;(bytecode, programCounter + sizeof(DFABytecode))) {
-                programCounter = getBits&lt;unsigned&gt;(bytecode, programCounter + sizeof(DFABytecode) + sizeof(uint8_t));
</del><ins>+            if (url[urlIndex] == getBits&lt;uint8_t&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))) {
+                programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode) + sizeof(uint8_t));
</ins><span class="cx">                 urlIndex++; // This represents an edge in the DFA.
</span><span class="cx">             } else
</span><span class="cx">                 programCounter += instructionSizeWithArguments(DFABytecodeInstruction::CheckValue);
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case DFABytecodeInstruction::Jump:
</span><del>-            programCounter = getBits&lt;unsigned&gt;(bytecode, programCounter + sizeof(DFABytecode));
</del><ins>+            programCounter = getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode));
</ins><span class="cx">             urlIndex++; // This represents an edge in the DFA.
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case DFABytecodeInstruction::AppendAction:
</span><del>-            actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(bytecode, programCounter + sizeof(DFABytecode))));
</del><ins>+            actions.add(static_cast&lt;uint64_t&gt;(getBits&lt;unsigned&gt;(m_bytecode, m_bytecodeLength, programCounter + sizeof(DFABytecode))));
</ins><span class="cx">             programCounter += instructionSizeWithArguments(DFABytecodeInstruction::AppendAction);
</span><span class="cx">             break;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsDFABytecodeInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/contentextensions/DFABytecodeInterpreter.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -39,8 +39,9 @@
</span><span class="cx"> 
</span><span class="cx"> class DFABytecodeInterpreter {
</span><span class="cx"> public:
</span><del>-    DFABytecodeInterpreter(const Vector&lt;DFABytecode&gt;&amp; bytecode)
-        : bytecode(bytecode)
</del><ins>+    DFABytecodeInterpreter(const DFABytecode* bytecode, unsigned bytecodeLength)
+        : m_bytecode(bytecode)
+        , m_bytecodeLength(bytecodeLength)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -49,7 +50,8 @@
</span><span class="cx">     Actions interpret(const CString&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    const Vector&lt;DFABytecode&gt;&amp; bytecode;
</del><ins>+    const DFABytecode* m_bytecode;
+    const unsigned m_bytecodeLength;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace ContentExtensions
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -179,15 +179,15 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void UserContentController::addUserContentFilter(const String&amp; name, const String&amp; ruleList)
</del><ins>+void UserContentController::addUserContentExtension(const String&amp; name, RefPtr&lt;ContentExtensions::CompiledContentExtension&gt; contentExtension)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span><span class="cx">         m_contentExtensionBackend = std::make_unique&lt;ContentExtensions::ContentExtensionsBackend&gt;();
</span><span class="cx">     
</span><del>-    m_contentExtensionBackend-&gt;addContentExtension(name, ContentExtensions::compileRuleList(ruleList));
</del><ins>+    m_contentExtensionBackend-&gt;addContentExtension(name, contentExtension);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserContentController::removeUserContentFilter(const String&amp; name)
</del><ins>+void UserContentController::removeUserContentExtension(const String&amp; name)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span><span class="cx">         return;
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">     m_contentExtensionBackend-&gt;removeContentExtension(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserContentController::removeAllUserContentFilters()
</del><ins>+void UserContentController::removeAllUserContentExtensions()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebCore/page/UserContentController.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> class UserMessageHandlerDescriptor;
</span><span class="cx"> 
</span><span class="cx"> namespace ContentExtensions {
</span><ins>+class CompiledContentExtension;
</ins><span class="cx"> class ContentExtensionsBackend;
</span><span class="cx"> struct Action;
</span><span class="cx"> }
</span><span class="lines">@@ -80,12 +81,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    // FIXME: This should really take a pointer to a compiled UserContentFilter.
-    WEBCORE_EXPORT void addUserContentFilter(const String&amp; name, const String&amp; ruleList);
-    WEBCORE_EXPORT void removeUserContentFilter(const String&amp; name);
-    WEBCORE_EXPORT void removeAllUserContentFilters();
</del><ins>+    WEBCORE_EXPORT void addUserContentExtension(const String&amp; name, RefPtr&lt;ContentExtensions::CompiledContentExtension&gt;);
+    WEBCORE_EXPORT void removeUserContentExtension(const String&amp; name);
+    WEBCORE_EXPORT void removeAllUserContentExtensions();
</ins><span class="cx">     
</span><del>-    // FIXME: Consider putting this (and other future content filter predicates) in its own class.
</del><ins>+    // FIXME: Consider putting this (and other future content extension predicates) in its own class.
</ins><span class="cx">     Vector&lt;ContentExtensions::Action&gt; actionsForURL(const URL&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -238,6 +238,8 @@
</span><span class="cx">     Shared/VisitedLinkTable.cpp
</span><span class="cx">     Shared/WebBackForwardListItem.cpp
</span><span class="cx">     Shared/WebBatteryStatus.cpp
</span><ins>+    Shared/WebCompiledContentExtension.cpp
+    Shared/WebCompiledContentExtensionData.cpp
</ins><span class="cx">     Shared/WebConnection.cpp
</span><span class="cx">     Shared/WebConnectionClient.cpp
</span><span class="cx">     Shared/WebContextMenuItem.cpp
</span><span class="lines">@@ -389,7 +391,7 @@
</span><span class="cx">     UIProcess/API/APINavigation.cpp
</span><span class="cx">     UIProcess/API/APISessionState.cpp
</span><span class="cx">     UIProcess/API/APIWebsiteDataStore.cpp
</span><del>-    UIProcess/API/APIUserContentFilter.cpp
</del><ins>+    UIProcess/API/APIUserContentExtension.cpp
</ins><span class="cx"> 
</span><span class="cx">     UIProcess/API/C/WKApplicationCacheManager.cpp
</span><span class="cx">     UIProcess/API/C/WKAuthenticationChallenge.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/ChangeLog        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,3 +1,122 @@
</span><ins>+2015-03-06  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [Content Extensions] Move compiling of content extensions to the UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=142402
+
+        Reviewed by Benjamin Poulain.
+
+        * Shared/API/APIObject.h:
+        Rename UserContentFilter type to UserContentExtension to match new unified naming.
+
+        * Shared/WebCompiledContentExtension.cpp: Added.
+        (WebKit::WebCompiledContentExtension::create):
+        (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
+        (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension):
+        (WebKit::WebCompiledContentExtension::bytecode):
+        (WebKit::WebCompiledContentExtension::bytecodeLength):
+        (WebKit::WebCompiledContentExtension::actions):
+        (WebKit::WebCompiledContentExtension::actionsLength):
+        * Shared/WebCompiledContentExtension.h: Added.
+        Add new WebKit2 implementation of CompiledContentExtension. Right now it is the same as the old
+        WebCore based CompiledContentExtension, but in subsequent patches, it will use shared/file backed
+        memory.
+
+        * Shared/WebCompiledContentExtensionData.cpp: Added.
+        (WebKit::WebCompiledContentExtensionData::encode):
+        (WebKit::WebCompiledContentExtensionData::decode):
+        * Shared/WebCompiledContentExtensionData.h: Added.
+        Add encodable/decodable holder for the compiled content extension data for use in IPC. Right
+        now it is doing the naive thing and always copying the data, but in subsequent patches, it will
+        use shared/file backed memory.
+
+        * Shared/WebPageGroupData.cpp:
+        (WebKit::WebPageGroupData::encode):
+        (WebKit::WebPageGroupData::decode):
+        * Shared/WebPageGroupData.h:
+        Rename member to match new unification on the name userContentExtension. Change the value from
+        the serialized JSON (as a String) to WebCompiledContentExtensionData.
+
+        * UIProcess/API/APIUserContentExtension.cpp: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp.
+        (API::UserContentExtension::UserContentExtension):
+        (API::UserContentExtension::~UserContentExtension):
+        (API::UserContentFilter::UserContentFilter): Deleted.
+        (API::UserContentFilter::~UserContentFilter): Deleted.
+        * UIProcess/API/APIUserContentExtension.h: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.h.
+        * UIProcess/API/APIUserContentFilter.cpp: Removed.
+        * UIProcess/API/APIUserContentFilter.h: Removed.
+        Renamed UserContentFilter to APIUserContentExtension. Updated to store the compiled extension (as a WebCompiledContentExtension)
+        rather than the serialized JSON.
+
+        * UIProcess/API/C/WKAPICast.h:
+        * UIProcess/API/C/WKPageGroup.cpp:
+        (WKPageGroupAddUserContentFilter):
+        (WKPageGroupRemoveUserContentFilter):
+        (WKPageGroupRemoveAllUserContentFilters):
+        * UIProcess/API/C/WKUserContentControllerRef.cpp:
+        (WKUserContentControllerAddUserContentFilter):
+        (WKUserContentControllerRemoveAllUserContentFilters):
+        * UIProcess/API/Cocoa/WKUserContentController.mm:
+        (-[WKUserContentController _addUserContentFilter:]):
+        (-[WKUserContentController _removeUserContentFilter:]):
+        (-[WKUserContentController _removeAllUserContentFilters]):
+        Update for rename of APIUserContentFilter -&gt; UserContentExtension.
+
+        * UIProcess/API/C/WKUserContentFilterRef.cpp:
+        (WKUserContentFilterGetTypeID):
+        (WKUserContentFilterCreate):
+        Update for rename of APIUserContentFilter -&gt; UserContentExtension. Also make WKUserContentFilterCreate eagerly
+        compile rule list to a WebCompiledContentExtensionData.
+
+        * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
+        (-[_WKUserContentFilter initWithName:serializedRules:]):
+        (-[_WKUserContentFilter dealloc]):
+        (-[_WKUserContentFilter _apiObject]):
+        Update for rename of APIUserContentFilter -&gt; UserContentExtension. Also make initWithName:serializedRules: eagerly
+        compile rule list to a WebCompiledContentExtensionData.
+
+        * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
+        (WebKit::wrapper):
+        Update for rename of APIUserContentFilter -&gt; UserContentExtension.
+
+        * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
+        (WebKit::WebUserContentControllerProxy::addProcess):
+        (WebKit::WebUserContentControllerProxy::addUserContentExtension):
+        (WebKit::WebUserContentControllerProxy::removeUserContentExtension):
+        (WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions):
+        (WebKit::WebUserContentControllerProxy::addUserContentFilter): Deleted.
+        (WebKit::WebUserContentControllerProxy::removeUserContentFilter): Deleted.
+        (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters): Deleted.
+        * UIProcess/UserContent/WebUserContentControllerProxy.h:
+        * UIProcess/WebPageGroup.cpp:
+        (WebKit::WebPageGroup::addUserContentExtension):
+        (WebKit::WebPageGroup::removeUserContentExtension):
+        (WebKit::WebPageGroup::removeAllUserContentExtensions):
+        (WebKit::WebPageGroup::addUserContentFilter): Deleted.
+        (WebKit::WebPageGroup::removeUserContentFilter): Deleted.
+        (WebKit::WebPageGroup::removeAllUserContentFilters): Deleted.
+        * UIProcess/WebPageGroup.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/UserContent/WebUserContentController.cpp:
+        (WebKit::WebUserContentController::addUserContentExtensions):
+        (WebKit::WebUserContentController::removeUserContentExtension):
+        (WebKit::WebUserContentController::removeAllUserContentExtensions):
+        (WebKit::WebUserContentController::addUserContentFilters): Deleted.
+        (WebKit::WebUserContentController::removeUserContentFilter): Deleted.
+        (WebKit::WebUserContentController::removeAllUserContentFilters): Deleted.
+        * WebProcess/UserContent/WebUserContentController.h:
+        * WebProcess/UserContent/WebUserContentController.messages.in:
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::WebPageGroupProxy):
+        (WebKit::WebPageGroupProxy::addUserContentExtension):
+        (WebKit::WebPageGroupProxy::removeUserContentExtension):
+        (WebKit::WebPageGroupProxy::removeAllUserContentExtensions):
+        (WebKit::WebPageGroupProxy::addUserContentFilter): Deleted.
+        (WebKit::WebPageGroupProxy::removeUserContentFilter): Deleted.
+        (WebKit::WebPageGroupProxy::removeAllUserContentFilters): Deleted.
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        * WebProcess/WebPage/WebPageGroupProxy.messages.in:
+        Pipe the compiled extension from the UIProcess to the WebProcess.
+
</ins><span class="cx"> 2015-03-06  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Support &quot;plus-lighter&quot; in mix-blend mode
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIAPIObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/APIObject.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/API/APIObject.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/Shared/API/APIObject.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -80,8 +80,8 @@
</span><span class="cx">         URL,
</span><span class="cx">         URLRequest,
</span><span class="cx">         URLResponse,
</span><ins>+        UserContentExtension,
</ins><span class="cx">         UserContentURLPattern,
</span><del>-        UserContentFilter,
</del><span class="cx">         UserScript,
</span><span class="cx">         WebArchive,
</span><span class="cx">         WebArchiveResource,
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCompiledContentExtensioncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebCompiledContentExtension.cpp (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCompiledContentExtension.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/WebCompiledContentExtension.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,69 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;WebCompiledContentExtension.h&quot;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+namespace WebKit {
+
+Ref&lt;WebCompiledContentExtension&gt; WebCompiledContentExtension::create(Vector&lt;WebCore::ContentExtensions::DFABytecode&gt;&amp;&amp; bytecode, Vector&lt;WebCore::ContentExtensions::SerializedActionByte&gt;&amp;&amp; actions)
+{
+    return adoptRef(*new WebCompiledContentExtension(WTF::move(bytecode), WTF::move(actions)));
+}
+
+WebCompiledContentExtension::WebCompiledContentExtension(Vector&lt;WebCore::ContentExtensions::DFABytecode&gt;&amp;&amp; bytecode, Vector&lt;WebCore::ContentExtensions::SerializedActionByte&gt;&amp;&amp; actions)
+    : m_data { WTF::move(bytecode), WTF::move(actions) }
+{
+}
+
+WebCompiledContentExtension::~WebCompiledContentExtension()
+{
+}
+
+const WebCore::ContentExtensions::DFABytecode* WebCompiledContentExtension::bytecode() const
+{
+    return m_data.bytecode.data();
+}
+
+unsigned WebCompiledContentExtension::bytecodeLength() const
+{
+    return m_data.bytecode.size();
+}
+
+const WebCore::ContentExtensions::SerializedActionByte* WebCompiledContentExtension::actions() const
+{
+    return m_data.actions.data();
+}
+
+unsigned WebCompiledContentExtension::actionsLength() const
+{
+    return m_data.actions.size();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCompiledContentExtensionh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebCompiledContentExtension.h (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCompiledContentExtension.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/WebCompiledContentExtension.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef WebCompiledContentExtension_h
+#define WebCompiledContentExtension_h
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &quot;WebCompiledContentExtensionData.h&quot;
+
+namespace WebKit {
+
+class WebCompiledContentExtension final : public WebCore::ContentExtensions::CompiledContentExtension {
+public:
+    static Ref&lt;WebCompiledContentExtension&gt; create(Vector&lt;WebCore::ContentExtensions::DFABytecode&gt;&amp;&amp;, Vector&lt;WebCore::ContentExtensions::SerializedActionByte&gt;&amp;&amp;);
+    virtual ~WebCompiledContentExtension();
+
+    WebCompiledContentExtensionData data() const { return m_data; }
+
+private:
+    WebCompiledContentExtension(Vector&lt;WebCore::ContentExtensions::DFABytecode&gt;&amp;&amp;, Vector&lt;WebCore::ContentExtensions::SerializedActionByte&gt;&amp;&amp;);
+
+    virtual const WebCore::ContentExtensions::DFABytecode* bytecode() const override;
+    virtual unsigned bytecodeLength() const override;
+    virtual const WebCore::ContentExtensions::SerializedActionByte* actions() const override;
+    virtual unsigned actionsLength() const override;
+    
+    WebCompiledContentExtensionData m_data;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
+#endif // WebCompiledContentExtension_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCompiledContentExtensionDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;WebCompiledContentExtensionData.h&quot;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &quot;ArgumentCoders.h&quot;
+
+namespace WebKit {
+
+void WebCompiledContentExtensionData::encode(IPC::ArgumentEncoder&amp; encoder) const
+{
+    encoder &lt;&lt; bytecode;
+    encoder &lt;&lt; actions;
+}
+
+bool WebCompiledContentExtensionData::decode(IPC::ArgumentDecoder&amp; decoder, WebCompiledContentExtensionData&amp; compiledContentExtensionData)
+{
+    if (!decoder.decode(compiledContentExtensionData.bytecode))
+        return false;
+    if (!decoder.decode(compiledContentExtensionData.actions))
+        return false;
+    return true;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCompiledContentExtensionDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.h (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/WebCompiledContentExtensionData.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef WebCompiledContentExtensionData_h
+#define WebCompiledContentExtensionData_h
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &lt;WebCore/CompiledContentExtension.h&gt;
+
+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+class WebCompiledContentExtensionData {
+public:
+    void encode(IPC::ArgumentEncoder&amp;) const;
+    static bool decode(IPC::ArgumentDecoder&amp;, WebCompiledContentExtensionData&amp;);
+
+    Vector&lt;WebCore::ContentExtensions::DFABytecode&gt; bytecode;
+    Vector&lt;WebCore::ContentExtensions::SerializedActionByte&gt; actions;
+};
+
+}
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
+#endif // WebCompiledContentExtensionData_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageGroupDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageGroupData.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageGroupData.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/Shared/WebPageGroupData.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">     encoder &lt;&lt; userStyleSheets;
</span><span class="cx">     encoder &lt;&lt; userScripts;
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    encoder &lt;&lt; userContentFilters;
</del><ins>+    encoder &lt;&lt; userContentExtensions;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     if (!decoder.decode(data.userScripts))
</span><span class="cx">         return false;
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    if (!decoder.decode(data.userContentFilters))
</del><ins>+    if (!decoder.decode(data.userContentExtensions))
</ins><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPageGroupDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPageGroupData.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPageGroupData.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/Shared/WebPageGroupData.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef WebPageGroupData_h
</span><span class="cx"> #define WebPageGroupData_h
</span><span class="cx"> 
</span><ins>+#include &quot;WebCompiledContentExtensionData.h&quot;
</ins><span class="cx"> #include &lt;WebCore/UserScript.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserStyleSheet.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="lines">@@ -52,7 +53,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>-    HashMap&lt;String, String&gt; userContentFilters;
</del><ins>+    HashMap&lt;String, WebCompiledContentExtensionData&gt; userContentExtensions;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentExtensioncppfromrev180999trunkSourceWebKit2UIProcessAPIAPIUserContentFiltercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.cpp (from rev 180999, trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp) (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.cpp                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;APIUserContentExtension.h&quot;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+
+#include &quot;WebCompiledContentExtension.h&quot;
+
+namespace API {
+
+UserContentExtension::UserContentExtension(const WTF::String&amp; name, Ref&lt;WebKit::WebCompiledContentExtension&gt;&amp;&amp; contentExtension)
+    : m_name(name)
+    , m_compiledExtension(WTF::move(contentExtension))
+{
+}
+
+UserContentExtension::~UserContentExtension()
+{
+}
+
+} // namespace API
+
+#endif // ENABLE(CONTENT_EXTENSIONS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentExtensionhfromrev180999trunkSourceWebKit2UIProcessAPIAPIUserContentFilterh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.h (from rev 180999, trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h) (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentExtension.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef APIUserContentExtension_h
+#define APIUserContentExtension_h
+
+#include &quot;APIObject.h&quot;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebKit {
+class WebCompiledContentExtension;
+}
+
+namespace API {
+
+class UserContentExtension final : public ObjectImpl&lt;Object::Type::UserContentExtension&gt; {
+public:
+#if ENABLE(CONTENT_EXTENSIONS)
+    static Ref&lt;UserContentExtension&gt; create(const WTF::String&amp; name, Ref&lt;WebKit::WebCompiledContentExtension&gt;&amp;&amp; contentExtension)
+    {
+        return adoptRef(*new UserContentExtension(name, WTF::move(contentExtension)));
+    }
+
+    UserContentExtension(const WTF::String&amp; name, Ref&lt;WebKit::WebCompiledContentExtension&gt;&amp;&amp;);
+    virtual ~UserContentExtension();
+
+    const WTF::String&amp; name() const { return m_name; }
+    const WebKit::WebCompiledContentExtension&amp; compiledExtension() const { return m_compiledExtension.get(); }
+
+private:
+    WTF::String m_name;
+    Ref&lt;WebKit::WebCompiledContentExtension&gt; m_compiledExtension;
+#endif // ENABLE(CONTENT_EXTENSIONS)
+};
+
+} // namespace API
+
+#endif // APIUserContentExtension_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentFiltercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,41 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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;APIUserContentFilter.h&quot;
-
-namespace API {
-
-UserContentFilter::UserContentFilter(const WTF::String&amp; name, const WTF::String&amp; serializedRules)
-    : m_name(name)
-    , m_serializedRules(serializedRules)
-{
-}
-
-UserContentFilter::~UserContentFilter()
-{
-}
-
-} // namespace API
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIUserContentFilterh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/APIUserContentFilter.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,54 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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.
- */
-
-#ifndef APIUserContentFilter_h
-#define APIUserContentFilter_h
-
-#include &quot;APIObject.h&quot;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace API {
-
-class UserContentFilter final : public ObjectImpl&lt;Object::Type::UserContentFilter&gt; {
-public:
-    static Ref&lt;UserContentFilter&gt; create(const WTF::String&amp; name, const WTF::String&amp; serializedRules)
-    {
-        return adoptRef(*new UserContentFilter(name, serializedRules));
-    }
-
-    UserContentFilter(const WTF::String&amp; name, const WTF::String&amp; serializedRules);
-    ~UserContentFilter();
-
-    const WTF::String&amp; name() const { return m_name; }
-    const WTF::String&amp; serializedRules() const { return m_serializedRules; }
-
-private:
-    WTF::String m_name;
-    WTF::String m_serializedRules;
-};
-
-} // namespace API
-
-#endif // APIUserContentFilter_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> class PageConfiguration;
</span><span class="cx"> class ProcessPoolConfiguration;
</span><span class="cx"> class SessionState;
</span><del>-class UserContentFilter;
</del><ins>+class UserContentExtension;
</ins><span class="cx"> class UserScript;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx"> WK_ADD_API_MAPPING(WKSessionStateRef, API::SessionState)
</span><span class="cx"> WK_ADD_API_MAPPING(WKTextCheckerRef, WebTextChecker)
</span><span class="cx"> WK_ADD_API_MAPPING(WKUserContentControllerRef, WebUserContentControllerProxy)
</span><del>-WK_ADD_API_MAPPING(WKUserContentFilterRef, API::UserContentFilter)
</del><ins>+WK_ADD_API_MAPPING(WKUserContentFilterRef, API::UserContentExtension)
</ins><span class="cx"> WK_ADD_API_MAPPING(WKUserMediaPermissionRequestRef, UserMediaPermissionRequestProxy)
</span><span class="cx"> WK_ADD_API_MAPPING(WKUserScriptRef, API::UserScript)
</span><span class="cx"> WK_ADD_API_MAPPING(WKVibrationRef, WebVibrationProxy)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPageGroup.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WKPageGroup.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;APIUserContentFilter.h&quot;
</del><ins>+#include &quot;APIUserContentExtension.h&quot;
</ins><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><span class="cx"> #include &quot;WebPageGroup.h&quot;
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> void WKPageGroupAddUserContentFilter(WKPageGroupRef pageGroupRef, WKUserContentFilterRef userContentFilterRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    toImpl(pageGroupRef)-&gt;addUserContentFilter(*toImpl(userContentFilterRef));
</del><ins>+    toImpl(pageGroupRef)-&gt;addUserContentExtension(*toImpl(userContentFilterRef));
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(pageGroupRef);
</span><span class="cx">     UNUSED_PARAM(userContentFilterRef);
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> void WKPageGroupRemoveUserContentFilter(WKPageGroupRef pageGroupRef, WKStringRef userContentFilterNameRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    toImpl(pageGroupRef)-&gt;removeUserContentFilter(toWTFString(userContentFilterNameRef));
</del><ins>+    toImpl(pageGroupRef)-&gt;removeUserContentExtension(toWTFString(userContentFilterNameRef));
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(pageGroupRef);
</span><span class="cx">     UNUSED_PARAM(userContentFilterNameRef);
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> void WKPageGroupRemoveAllUserContentFilters(WKPageGroupRef pageGroupRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    toImpl(pageGroupRef)-&gt;removeAllUserContentFilters();
</del><ins>+    toImpl(pageGroupRef)-&gt;removeAllUserContentExtensions();
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(pageGroupRef);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentControllerRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentControllerRef.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WKUserContentControllerRef.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;APIUserContentFilter.h&quot;
</del><ins>+#include &quot;APIUserContentExtension.h&quot;
</ins><span class="cx"> #include &quot;APIUserScript.h&quot;
</span><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><span class="cx"> #include &quot;WebUserContentControllerProxy.h&quot;
</span><span class="lines">@@ -62,13 +62,13 @@
</span><span class="cx"> void WKUserContentControllerAddUserContentFilter(WKUserContentControllerRef userContentControllerRef, WKUserContentFilterRef userContentFilterRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    toImpl(userContentControllerRef)-&gt;addUserContentFilter(*toImpl(userContentFilterRef));
</del><ins>+    toImpl(userContentControllerRef)-&gt;addUserContentExtension(*toImpl(userContentFilterRef));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKUserContentControllerRemoveAllUserContentFilters(WKUserContentControllerRef userContentControllerRef)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    toImpl(userContentControllerRef)-&gt;removeAllUserContentFilters();
</del><ins>+    toImpl(userContentControllerRef)-&gt;removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKUserContentFilterRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -26,17 +26,28 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WKUserContentFilterRef.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;APIUserContentFilter.h&quot;
</del><ins>+#include &quot;APIUserContentExtension.h&quot;
</ins><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><ins>+#include &quot;WebCompiledContentExtension.h&quot;
+#include &lt;WebCore/ContentExtensionCompiler.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><span class="cx"> WKTypeID WKUserContentFilterGetTypeID()
</span><span class="cx"> {
</span><del>-    return toAPI(API::UserContentFilter::APIType);
</del><ins>+    return toAPI(API::UserContentExtension::APIType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WKUserContentFilterRef WKUserContentFilterCreate(WKStringRef nameRef, WKStringRef serializedRulesRef)
</span><span class="cx"> {
</span><del>-    return toAPI(&amp;API::UserContentFilter::create(toWTFString(nameRef), toWTFString(serializedRulesRef)).leakRef());
</del><ins>+#if ENABLE(CONTENT_EXTENSIONS)
+    auto compiledContentExtensionData = WebCore::ContentExtensions::compileRuleList(toWTFString(serializedRulesRef));
+    auto compiledContentExtension = WebKit::WebCompiledContentExtension::create(WTF::move(compiledContentExtensionData.bytecode), WTF::move(compiledContentExtensionData.actions));
+
+    return toAPI(&amp;API::UserContentExtension::create(toWTFString(nameRef), WTF::move(compiledContentExtension)).leakRef());
+#else
+    UNUSED_PARAM(nameRef);
+    UNUSED_PARAM(serializedRulesRef);
+    return nullptr;
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKUserContentControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.mm        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -130,21 +130,21 @@
</span><span class="cx"> - (void)_addUserContentFilter:(_WKUserContentFilter *)userContentFilter
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    _userContentControllerProxy-&gt;addUserContentFilter(*userContentFilter-&gt;_userContentFilter);
</del><ins>+    _userContentControllerProxy-&gt;addUserContentExtension(*userContentFilter-&gt;_userContentExtension);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_removeUserContentFilter:(NSString *)userContentFilterName
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    _userContentControllerProxy-&gt;removeUserContentFilter(userContentFilterName);
</del><ins>+    _userContentControllerProxy-&gt;removeUserContentExtension(userContentFilterName);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_removeAllUserContentFilters
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    _userContentControllerProxy-&gt;removeAllUserContentFilters();
</del><ins>+    _userContentControllerProxy-&gt;removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFiltermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -28,6 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+#include &quot;WebCompiledContentExtension.h&quot;
+#include &lt;WebCore/ContentExtensionCompiler.h&gt;
+
</ins><span class="cx"> @implementation _WKUserContentFilter
</span><span class="cx"> 
</span><span class="cx"> - (instancetype)initWithName:(NSString *)name serializedRules:(NSString *)serializedRules
</span><span class="lines">@@ -35,14 +38,17 @@
</span><span class="cx">     if (!(self = [super init]))
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    API::Object::constructInWrapper&lt;API::UserContentFilter&gt;(self, String(name), String(serializedRules));
</del><ins>+    auto compiledContentExtensionData = WebCore::ContentExtensions::compileRuleList(String(serializedRules));
+    auto compiledContentExtension = WebKit::WebCompiledContentExtension::create(WTF::move(compiledContentExtensionData.bytecode), WTF::move(compiledContentExtensionData.actions));
</ins><span class="cx"> 
</span><ins>+    API::Object::constructInWrapper&lt;API::UserContentExtension&gt;(self, String(name), WTF::move(compiledContentExtension));
+
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)dealloc
</span><span class="cx"> {
</span><del>-    _userContentFilter-&gt;~UserContentFilter();
</del><ins>+    _userContentExtension-&gt;~UserContentExtension();
</ins><span class="cx"> 
</span><span class="cx">     [super dealloc];
</span><span class="cx"> }
</span><span class="lines">@@ -51,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (API::Object&amp;)_apiObject
</span><span class="cx"> {
</span><del>-    return *_userContentFilter;
</del><ins>+    return *_userContentExtension;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKUserContentFilterInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilterInternal.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -27,22 +27,22 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><del>-#import &quot;APIUserContentFilter.h&quot;
</del><ins>+#import &quot;APIUserContentExtension.h&quot;
</ins><span class="cx"> #import &quot;WKObject.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-inline _WKUserContentFilter *wrapper(API::UserContentFilter&amp; userContentFilter)
</del><ins>+inline _WKUserContentFilter *wrapper(API::UserContentExtension&amp; userContentExtension)
</ins><span class="cx"> {
</span><del>-    ASSERT([userContentFilter.wrapper() isKindOfClass:[_WKUserContentFilter class]]);
-    return (_WKUserContentFilter *)userContentFilter.wrapper();
</del><ins>+    ASSERT([userContentExtension.wrapper() isKindOfClass:[_WKUserContentFilter class]]);
+    return (_WKUserContentFilter *)userContentExtension.wrapper();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @interface _WKUserContentFilter () &lt;WKObject&gt; {
</span><span class="cx"> @package
</span><del>-    API::ObjectStorage&lt;API::UserContentFilter&gt; _userContentFilter;
</del><ins>+    API::ObjectStorage&lt;API::UserContentExtension&gt; _userContentExtension;
</ins><span class="cx"> }
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -36,7 +36,8 @@
</span><span class="cx"> #include &lt;WebCore/SerializedScriptValue.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-#include &quot;APIUserContentFilter.h&quot;
</del><ins>+#include &quot;APIUserContentExtension.h&quot;
+#include &quot;WebCompiledContentExtension.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -82,10 +83,10 @@
</span><span class="cx">     webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserScriptMessageHandlers(messageHandlerHandles), m_identifier);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters;
-    for (const auto&amp; userContentFilter : m_userContentFilters.values())
-        userContentFilters.append(std::make_pair(userContentFilter-&gt;name(), userContentFilter-&gt;serializedRules()));
-    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters(userContentFilters), m_identifier);
</del><ins>+    Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt; userContentExtensions;
+    for (const auto&amp; userContentExtension : m_userContentExtensions.values())
+        userContentExtensions.append(std::make_pair(userContentExtension-&gt;name(), userContentExtension-&gt;compiledExtension().data()));
+    webProcessProxy.connection()-&gt;send(Messages::WebUserContentController::AddUserContentExtensions(userContentExtensions), m_identifier);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -182,30 +183,30 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void WebUserContentControllerProxy::addUserContentFilter(API::UserContentFilter&amp; userContentFilter)
</del><ins>+void WebUserContentControllerProxy::addUserContentExtension(API::UserContentExtension&amp; userContentExtension)
</ins><span class="cx"> {
</span><del>-    m_userContentFilters.set(userContentFilter.name(), &amp;userContentFilter);
</del><ins>+    m_userContentExtensions.set(userContentExtension.name(), &amp;userContentExtension);
</ins><span class="cx"> 
</span><del>-    auto pair = std::make_pair(userContentFilter.name(), userContentFilter.serializedRules());
</del><ins>+    auto pair = std::make_pair(userContentExtension.name(), userContentExtension.compiledExtension().data());
</ins><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserContentFilters({ pair }), m_identifier);
</del><ins>+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::AddUserContentExtensions({ pair }), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebUserContentControllerProxy::removeUserContentFilter(const String&amp; name)
</del><ins>+void WebUserContentControllerProxy::removeUserContentExtension(const String&amp; name)
</ins><span class="cx"> {
</span><del>-    m_userContentFilters.remove(name);
</del><ins>+    m_userContentExtensions.remove(name);
</ins><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserContentFilter(name), m_identifier);
</del><ins>+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveUserContentExtension(name), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebUserContentControllerProxy::removeAllUserContentFilters()
</del><ins>+void WebUserContentControllerProxy::removeAllUserContentExtensions()
</ins><span class="cx"> {
</span><del>-    m_userContentFilters.clear();
</del><ins>+    m_userContentExtensions.clear();
</ins><span class="cx"> 
</span><span class="cx">     for (WebProcessProxy* process : m_processes)
</span><del>-        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserContentFilters(), m_identifier);
</del><ins>+        process-&gt;connection()-&gt;send(Messages::WebUserContentController::RemoveAllUserContentExtensions(), m_identifier);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessUserContentWebUserContentControllerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/UserContent/WebUserContentControllerProxy.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="cx"> class Array;
</span><del>-class UserContentFilter;
</del><ins>+class UserContentExtension;
</ins><span class="cx"> class UserScript;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx">     void removeUserMessageHandlerForName(const String&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addUserContentFilter(API::UserContentFilter&amp;);
-    void removeUserContentFilter(const String&amp;);
-    void removeAllUserContentFilters();
</del><ins>+    void addUserContentExtension(API::UserContentExtension&amp;);
+    void removeUserContentExtension(const String&amp;);
+    void removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -101,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>-    HashMap&lt;String, RefPtr&lt;API::UserContentFilter&gt;&gt; m_userContentFilters;
</del><ins>+    HashMap&lt;String, RefPtr&lt;API::UserContentExtension&gt;&gt; m_userContentExtensions;
</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 (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -27,7 +27,8 @@
</span><span class="cx"> #include &quot;WebPageGroup.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIArray.h&quot;
</span><del>-#include &quot;APIUserContentFilter.h&quot;
</del><ins>+#include &quot;APIUserContentExtension.h&quot;
+#include &quot;WebCompiledContentExtension.h&quot;
</ins><span class="cx"> #include &quot;WebPageGroupProxyMessages.h&quot;
</span><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><span class="cx"> #include &quot;WebPreferences.h&quot;
</span><span class="lines">@@ -173,22 +174,22 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void WebPageGroup::addUserContentFilter(const API::UserContentFilter&amp; userContentFilter)
</del><ins>+void WebPageGroup::addUserContentExtension(const API::UserContentExtension&amp; userContentExtension)
</ins><span class="cx"> {
</span><del>-    m_data.userContentFilters.set(userContentFilter.name(), userContentFilter.serializedRules());
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserContentFilter(userContentFilter.name(), userContentFilter.serializedRules()), m_data.pageGroupID);
</del><ins>+    m_data.userContentExtensions.set(userContentExtension.name(), userContentExtension.compiledExtension().data());
+    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::AddUserContentExtension(userContentExtension.name(), userContentExtension.compiledExtension().data()), m_data.pageGroupID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageGroup::removeUserContentFilter(const String&amp; contentFilterName)
</del><ins>+void WebPageGroup::removeUserContentExtension(const String&amp; contentExtensionName)
</ins><span class="cx"> {
</span><del>-    m_data.userContentFilters.remove(contentFilterName);
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveUserContentFilter(contentFilterName), m_data.pageGroupID);
</del><ins>+    m_data.userContentExtensions.remove(contentExtensionName);
+    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveUserContentExtension(contentExtensionName), m_data.pageGroupID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageGroup::removeAllUserContentFilters()
</del><ins>+void WebPageGroup::removeAllUserContentExtensions()
</ins><span class="cx"> {
</span><del>-    m_data.userContentFilters.clear();
-    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContentFilters(), m_data.pageGroupID);
</del><ins>+    m_data.userContentExtensions.clear();
+    sendToAllProcessesInGroup(Messages::WebPageGroupProxy::RemoveAllUserContentExtensions(), m_data.pageGroupID);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageGroup.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/UIProcess/WebPageGroup.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -67,9 +67,9 @@
</span><span class="cx">     void removeAllUserContent();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addUserContentFilter(const API::UserContentFilter&amp;);
-    void removeUserContentFilter(const String&amp;);
-    void removeAllUserContentFilters();
</del><ins>+    void addUserContentExtension(const API::UserContentExtension&amp;);
+    void removeUserContentExtension(const String&amp;);
+    void removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1096,6 +1096,10 @@
</span><span class="cx">                 7C4694CC1A4B510A00AD5845 /* WebPasteboardProxyCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C4694CB1A4B510A00AD5845 /* WebPasteboardProxyCocoa.mm */; };
</span><span class="cx">                 7C4694D01A51E36800AD5845 /* WebPasteboardProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4694CD1A51E36800AD5845 /* WebPasteboardProxy.cpp */; };
</span><span class="cx">                 7C4694D11A51E36800AD5845 /* WebPasteboardProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4694CE1A51E36800AD5845 /* WebPasteboardProxy.h */; };
</span><ins>+                7C4ABED01AA8E9F00088AA37 /* WebCompiledContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4ABECE1AA8E9F00088AA37 /* WebCompiledContentExtension.cpp */; };
+                7C4ABED11AA8E9F00088AA37 /* WebCompiledContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4ABECF1AA8E9F00088AA37 /* WebCompiledContentExtension.h */; };
+                7C4ABED41AA8FCB80088AA37 /* WebCompiledContentExtensionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4ABED21AA8FCB80088AA37 /* WebCompiledContentExtensionData.cpp */; };
+                7C4ABED51AA8FCB80088AA37 /* WebCompiledContentExtensionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4ABED31AA8FCB80088AA37 /* WebCompiledContentExtensionData.h */; };
</ins><span class="cx">                 7C4ED3291A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4ED3271A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.h */; };
</span><span class="cx">                 7C6D37FC172F555F009D2847 /* PageBannerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C6D37FA172F555F009D2847 /* PageBannerMac.mm */; };
</span><span class="cx">                 7C6E70FB18B2DC7A00F24E2E /* WebProcessCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C6E70F918B2D4A000F24E2E /* WebProcessCocoa.mm */; };
</span><span class="lines">@@ -1112,8 +1116,8 @@
</span><span class="cx">                 7C89D2A31A678875003A5FDE /* WKUserScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */; };
</span><span class="cx">                 7C89D2A41A678875003A5FDE /* WKUserScriptRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C89D2A61A6789EA003A5FDE /* APIUserScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */; };
</span><del>-                7C89D2B31A6B068C003A5FDE /* APIUserContentFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */; };
-                7C89D2B41A6B068C003A5FDE /* APIUserContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */; };
</del><ins>+                7C89D2B31A6B068C003A5FDE /* APIUserContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2B11A6B068C003A5FDE /* APIUserContentExtension.cpp */; };
+                7C89D2B41A6B068C003A5FDE /* APIUserContentExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B21A6B068C003A5FDE /* APIUserContentExtension.h */; };
</ins><span class="cx">                 7C89D2B61A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B51A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7C89D2B91A6B0F2C003A5FDE /* _WKUserContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2B71A6B0F2C003A5FDE /* _WKUserContentFilter.mm */; };
</span><span class="cx">                 7C89D2BA1A6B0F2C003A5FDE /* _WKUserContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C89D2B81A6B0F2C003A5FDE /* _WKUserContentFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3286,6 +3290,10 @@
</span><span class="cx">                 7C4694CD1A51E36800AD5845 /* WebPasteboardProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPasteboardProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C4694CE1A51E36800AD5845 /* WebPasteboardProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C4694CF1A51E36800AD5845 /* WebPasteboardProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebPasteboardProxy.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C4ABECE1AA8E9F00088AA37 /* WebCompiledContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCompiledContentExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C4ABECF1AA8E9F00088AA37 /* WebCompiledContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCompiledContentExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C4ABED21AA8FCB80088AA37 /* WebCompiledContentExtensionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCompiledContentExtensionData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C4ABED31AA8FCB80088AA37 /* WebCompiledContentExtensionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCompiledContentExtensionData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C4ED3261A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleCSSStyleDeclarationHandle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C4ED3271A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleCSSStyleDeclarationHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C6D37FA172F555F009D2847 /* PageBannerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageBannerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3303,8 +3311,8 @@
</span><span class="cx">                 7C89D2A11A678875003A5FDE /* WKUserScriptRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserScriptRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2A21A678875003A5FDE /* WKUserScriptRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserScriptRef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIUserScript.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIUserContentFilter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIUserContentFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                7C89D2B11A6B068C003A5FDE /* APIUserContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIUserContentExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7C89D2B21A6B068C003A5FDE /* APIUserContentExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIUserContentExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C89D2B51A6B0DD9003A5FDE /* WKUserContentControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserContentControllerPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2B71A6B0F2C003A5FDE /* _WKUserContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKUserContentFilter.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C89D2B81A6B0F2C003A5FDE /* _WKUserContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKUserContentFilter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4725,6 +4733,10 @@
</span><span class="cx">                                 1A64245C12DE29A100CAAE2C /* UpdateInfo.h */,
</span><span class="cx">                                 1AC1336518565B5700F3EC05 /* UserData.cpp */,
</span><span class="cx">                                 1AC1336618565B5700F3EC05 /* UserData.h */,
</span><ins>+                                7C4ABECE1AA8E9F00088AA37 /* WebCompiledContentExtension.cpp */,
+                                7C4ABECF1AA8E9F00088AA37 /* WebCompiledContentExtension.h */,
+                                7C4ABED21AA8FCB80088AA37 /* WebCompiledContentExtensionData.cpp */,
+                                7C4ABED31AA8FCB80088AA37 /* WebCompiledContentExtensionData.h */,
</ins><span class="cx">                                 2684054A18B866FF0022C38B /* VisibleContentRectUpdateInfo.cpp */,
</span><span class="cx">                                 2684054218B85A630022C38B /* VisibleContentRectUpdateInfo.h */,
</span><span class="cx">                                 1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */,
</span><span class="lines">@@ -6249,8 +6261,8 @@
</span><span class="cx">                                 1AFDE65F1954E9B100C48FFA /* APISessionState.cpp */,
</span><span class="cx">                                 1AFDE6601954E9B100C48FFA /* APISessionState.h */,
</span><span class="cx">                                 1A4D664718A2D91A00D82E21 /* APIUIClient.h */,
</span><del>-                                7C89D2B11A6B068C003A5FDE /* APIUserContentFilter.cpp */,
-                                7C89D2B21A6B068C003A5FDE /* APIUserContentFilter.h */,
</del><ins>+                                7C89D2B11A6B068C003A5FDE /* APIUserContentExtension.cpp */,
+                                7C89D2B21A6B068C003A5FDE /* APIUserContentExtension.h */,
</ins><span class="cx">                                 7C89D2A51A6789EA003A5FDE /* APIUserScript.cpp */,
</span><span class="cx">                                 7C89D2921A67122F003A5FDE /* APIUserScript.h */,
</span><span class="cx">                                 1A4832C51A9BC13C008B4DFE /* APIWebsiteDataRecord.cpp */,
</span><span class="lines">@@ -7770,7 +7782,7 @@
</span><span class="cx">                                 2D5AB62E1A69D6FB0014A9CB /* MessageRecorder.h in Headers */,
</span><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><del>-                                7C89D2B41A6B068C003A5FDE /* APIUserContentFilter.h in Headers */,
</del><ins>+                                7C89D2B41A6B068C003A5FDE /* APIUserContentExtension.h in Headers */,
</ins><span class="cx">                                 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
</span><span class="cx">                                 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
</span><span class="cx">                                 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */,
</span><span class="lines">@@ -7837,6 +7849,7 @@
</span><span class="cx">                                 1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */,
</span><span class="cx">                                 2DAF06D618BD1A470081CEB1 /* SmartMagnificationController.h in Headers */,
</span><span class="cx">                                 2DE6943E18BD2A68005C15E5 /* SmartMagnificationControllerMessages.h in Headers */,
</span><ins>+                                7C4ABED51AA8FCB80088AA37 /* WebCompiledContentExtensionData.h in Headers */,
</ins><span class="cx">                                 51064D36189781C4004B2FEB /* SQLiteIDBCursor.h in Headers */,
</span><span class="cx">                                 511D81FF185BBDEE001AED56 /* SQLiteIDBTransaction.h in Headers */,
</span><span class="cx">                                 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */,
</span><span class="lines">@@ -8085,6 +8098,7 @@
</span><span class="cx">                                 3788A05C14743C90006319E5 /* WKBrowsingContextControllerPrivate.h in Headers */,
</span><span class="cx">                                 BCBAACF41452324F0053F82F /* WKBrowsingContextGroup.h in Headers */,
</span><span class="cx">                                 7C9D1537184584DA009D3918 /* WKBrowsingContextGroupInternal.h in Headers */,
</span><ins>+                                7C4ABED11AA8E9F00088AA37 /* WebCompiledContentExtension.h in Headers */,
</ins><span class="cx">                                 BCBAACF61452324F0053F82F /* WKBrowsingContextGroupPrivate.h in Headers */,
</span><span class="cx">                                 1AE00D4D182D6EB000087DD7 /* WKBrowsingContextHandle.h in Headers */,
</span><span class="cx">                                 1AE00D4F182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h in Headers */,
</span><span class="lines">@@ -9352,6 +9366,7 @@
</span><span class="cx">                                 2984F588164BA095004BC0C6 /* CustomProtocolManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 29AD3096164B4C930072DEA9 /* CustomProtocolManagerProxyMac.mm in Sources */,
</span><span class="cx">                                 2984F57C164B915F004BC0C6 /* CustomProtocolManagerProxyMessageReceiver.cpp in Sources */,
</span><ins>+                                7C4ABED01AA8E9F00088AA37 /* WebCompiledContentExtension.cpp in Sources */,
</ins><span class="cx">                                 51E351FF180F5D0F00E53BE9 /* DatabaseProcess.cpp in Sources */,
</span><span class="cx">                                 515E772B184008B90007203F /* DatabaseProcessCreationParameters.cpp in Sources */,
</span><span class="cx">                                 51D0D431183B34130097041D /* DatabaseProcessIDBConnection.cpp in Sources */,
</span><span class="lines">@@ -9743,7 +9758,7 @@
</span><span class="cx">                                 51C96118183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BCCF6ABC12C91EF9008F9C35 /* WebImage.cpp in Sources */,
</span><span class="cx">                                 1C8E28211275D15400BC7BD0 /* WebInspector.cpp in Sources */,
</span><del>-                                7C89D2B31A6B068C003A5FDE /* APIUserContentFilter.cpp in Sources */,
</del><ins>+                                7C89D2B31A6B068C003A5FDE /* APIUserContentExtension.cpp in Sources */,
</ins><span class="cx">                                 BC111A60112F4FBB00337BAB /* WebInspectorClient.cpp in Sources */,
</span><span class="cx">                                 1C8E2A351277852400BC7BD0 /* WebInspectorMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
</span><span class="lines">@@ -9948,6 +9963,7 @@
</span><span class="cx">                                 0FCB4E5118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm in Sources */,
</span><span class="cx">                                 0F174AA7142AAC610039250F /* WKGeometry.cpp in Sources */,
</span><span class="cx">                                 B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */,
</span><ins>+                                7C4ABED41AA8FCB80088AA37 /* WebCompiledContentExtensionData.cpp in Sources */,
</ins><span class="cx">                                 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */,
</span><span class="cx">                                 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */,
</span><span class="cx">                                 BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;WebUserContentController.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DataReference.h&quot;
</span><ins>+#include &quot;WebCompiledContentExtension.h&quot;
</ins><span class="cx"> #include &quot;WebFrame.h&quot;
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &quot;WebProcess.h&quot;
</span><span class="lines">@@ -181,20 +182,23 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void WebUserContentController::addUserContentFilters(const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp; userContentFilters)
</del><ins>+void WebUserContentController::addUserContentExtensions(const Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt;&amp; userContentExtensions)
</ins><span class="cx"> {
</span><del>-    for (const auto&amp; userContentFilter : userContentFilters)
-        m_userContentController-&gt;addUserContentFilter(userContentFilter.first, userContentFilter.second);
</del><ins>+    for (const auto&amp; userContentExtension : userContentExtensions) {
+        WebCompiledContentExtensionData contentExtensionData = userContentExtension.second;
+        RefPtr&lt;WebCompiledContentExtension&gt; compiledContentExtension = WebCompiledContentExtension::create(WTF::move(contentExtensionData.bytecode), WTF::move(contentExtensionData.actions));
+        m_userContentController-&gt;addUserContentExtension(userContentExtension.first, compiledContentExtension);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebUserContentController::removeUserContentFilter(const String&amp; name)
</del><ins>+void WebUserContentController::removeUserContentExtension(const String&amp; name)
</ins><span class="cx"> {
</span><del>-    m_userContentController-&gt;removeUserContentFilter(name);
</del><ins>+    m_userContentController-&gt;removeUserContentExtension(name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebUserContentController::removeAllUserContentFilters()
</del><ins>+void WebUserContentController::removeAllUserContentExtensions()
</ins><span class="cx"> {
</span><del>-    m_userContentController-&gt;removeAllUserContentFilters();
</del><ins>+    m_userContentController-&gt;removeAllUserContentExtensions();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class WebCompiledContentExtensionData;
</ins><span class="cx"> class WebUserMessageHandlerDescriptorProxy;
</span><span class="cx"> 
</span><span class="cx"> class WebUserContentController final : public RefCounted&lt;WebUserContentController&gt;, private IPC::MessageReceiver  {
</span><span class="lines">@@ -61,9 +62,9 @@
</span><span class="cx">     void removeUserScriptMessageHandler(uint64_t);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addUserContentFilters(const Vector&lt;std::pair&lt;String, String&gt;&gt;&amp;);
-    void removeUserContentFilter(const String&amp; name);
-    void removeAllUserContentFilters();
</del><ins>+    void addUserContentExtensions(const Vector&lt;std::pair&lt;String, WebCompiledContentExtensionData&gt;&gt;&amp;);
+    void removeUserContentExtension(const String&amp; name);
+    void removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     uint64_t m_identifier;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessUserContentWebUserContentControllermessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/UserContent/WebUserContentController.messages.in        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">     RemoveUserScriptMessageHandler(uint64_t identifier);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    AddUserContentFilters(Vector&lt;std::pair&lt;String, String&gt;&gt; userContentFilters);
-    RemoveUserContentFilter(String name);
-    RemoveAllUserContentFilters();
</del><ins>+    AddUserContentExtensions(Vector&lt;std::pair&lt;String, WebKit::WebCompiledContentExtensionData&gt;&gt; userContentFilters);
+    RemoveUserContentExtension(String name);
+    RemoveAllUserContentExtensions();
</ins><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 (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -26,8 +26,9 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebPageGroupProxy.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;InjectedBundle.h&quot;
+#include &quot;WebCompiledContentExtension.h&quot;
</ins><span class="cx"> #include &quot;WebProcess.h&quot;
</span><del>-#include &quot;InjectedBundle.h&quot;
</del><span class="cx"> #include &lt;WebCore/DOMWrapperWorld.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageGroup.h&gt;
</span><span class="cx"> #include &lt;WebCore/UserContentController.h&gt;
</span><span class="lines">@@ -54,8 +55,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; slot : data.userContentFilters)
-        addUserContentFilter(slot.key, slot.value);
</del><ins>+    for (auto&amp; slot : data.userContentExtensions)
+        addUserContentExtension(slot.key, slot.value);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -97,19 +98,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-void WebPageGroupProxy::addUserContentFilter(const String&amp; name, const String&amp; serializedRules)
</del><ins>+void WebPageGroupProxy::addUserContentExtension(const String&amp; name, WebCompiledContentExtensionData contentExtensionData)
</ins><span class="cx"> {
</span><del>-    userContentController().addUserContentFilter(name, serializedRules);
</del><ins>+    RefPtr&lt;WebCompiledContentExtension&gt; compiledContentExtension = WebCompiledContentExtension::create(WTF::move(contentExtensionData.bytecode), WTF::move(contentExtensionData.actions));
+    userContentController().addUserContentExtension(name, compiledContentExtension);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageGroupProxy::removeUserContentFilter(const String&amp; name)
</del><ins>+void WebPageGroupProxy::removeUserContentExtension(const String&amp; name)
</ins><span class="cx"> {
</span><del>-    userContentController().removeUserContentFilter(name);
</del><ins>+    userContentController().removeUserContentExtension(name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageGroupProxy::removeAllUserContentFilters()
</del><ins>+void WebPageGroupProxy::removeAllUserContentExtensions()
</ins><span class="cx"> {
</span><del>-    userContentController().removeAllUserContentFilters();    
</del><ins>+    userContentController().removeAllUserContentExtensions();    
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class WebCompiledContentExtensionData;
+
</ins><span class="cx"> class WebPageGroupProxy : public API::ObjectImpl&lt;API::Object::Type::BundlePageGroup&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;WebPageGroupProxy&gt; create(const WebPageGroupData&amp;);
</span><span class="lines">@@ -64,9 +66,9 @@
</span><span class="cx">     void removeAllUserContent();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    void addUserContentFilter(const String&amp; name, const String&amp; serializedRules);
-    void removeUserContentFilter(const String&amp; name);
-    void removeAllUserContentFilters();
</del><ins>+    void addUserContentExtension(const String&amp; name, WebCompiledContentExtensionData);
+    void removeUserContentExtension(const String&amp; name);
+    void removeAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageGroupProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -28,8 +28,8 @@
</span><span class="cx">     RemoveAllUserContent();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    AddUserContentFilter(String name, String serializedRules);
-    RemoveUserContentFilter(String name);
-    RemoveAllUserContentFilters();
</del><ins>+    AddUserContentExtension(String name, WebKit::WebCompiledContentExtensionData contentExtension);
+    RemoveUserContentExtension(String name);
+    RemoveAllUserContentExtensions();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Tools/ChangeLog        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-03-06  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        [Content Extensions] Move compiling of content extensions to the UIProcess
+        https://bugs.webkit.org/show_bug.cgi?id=142402
+
+        Reviewed by Benjamin Poulain.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp: Copied from Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp.
+        (TestWebKitAPI::InMemoryCompiledContentExtension::create):
+        (TestWebKitAPI::InMemoryCompiledContentExtension::~InMemoryCompiledContentExtension):
+        (TestWebKitAPI::InMemoryCompiledContentExtension::InMemoryCompiledContentExtension):
+        (TestWebKitAPI::TEST_F):
+        * TestWebKitAPI/Tests/WebCore/ContentFilter.cpp: Removed.
+        Update test for new name (ContentFilter -&gt; ContentExtensions) and API (CompiledContentExtension
+        is now abstract).
+
</ins><span class="cx"> 2015-03-06  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Correct Windows build.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">                 7C54A4C11AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C54A4BF1AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp */; };
</span><span class="cx">                 7C89D2AC1A69B80D003A5FDE /* WKPageConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C89D2AA1A69B80D003A5FDE /* WKPageConfiguration.cpp */; };
</span><span class="cx">                 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7C9ED98A17A19D0600E4DC33 /* attributedStringStrikethrough.html */; };
</span><del>-                7CB184C61AA3F2100066EDFD /* ContentFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CB184C41AA3F2100066EDFD /* ContentFilter.cpp */; };
</del><ins>+                7CB184C61AA3F2100066EDFD /* ContentExtensions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */; };
</ins><span class="cx">                 7CCE7EA41A4119F300447C4C /* InstanceMethodSwizzler.mm in Sources */ = {isa = PBXBuildFile; fileRef = C08587FF13FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm */; };
</span><span class="cx">                 7CCE7EA51A411A0800447C4C /* JavaScriptTestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C081224013FC172400DC39AE /* JavaScriptTestMac.mm */; };
</span><span class="cx">                 7CCE7EA61A411A0F00447C4C /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx">                 7C89D2AA1A69B80D003A5FDE /* WKPageConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageConfiguration.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C8DDAA91735DE1D00EA5AC0 /* CloseThenTerminate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CloseThenTerminate.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C9ED98A17A19D0600E4DC33 /* attributedStringStrikethrough.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = attributedStringStrikethrough.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7CB184C41AA3F2100066EDFD /* ContentFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentFilter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentExtensions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7CBBA07619BB8A9100BBF025 /* OSObjectPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSObjectPtr.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CC3E1FA197E234100BE6252 /* UserContentController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserContentController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CCE7E8C1A41144E00447C4C /* libTestWebKitAPI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTestWebKitAPI.a; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -824,11 +824,11 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 93A720E518F1A0E800A848E1 /* CalculationValue.cpp */,
</span><ins>+                                7CB184C41AA3F2100066EDFD /* ContentExtensions.cpp */,
</ins><span class="cx">                                 CD5451E919E41F9D0016936F /* CSSParser.cpp */,
</span><span class="cx">                                 14464012167A8305000BD218 /* LayoutUnit.cpp */,
</span><span class="cx">                                 CDC2C7141797089D00E627FB /* TimeRanges.cpp */,
</span><span class="cx">                                 440A1D3814A0103A008A66F2 /* URL.cpp */,
</span><del>-                                7CB184C41AA3F2100066EDFD /* ContentFilter.cpp */,
</del><span class="cx">                         );
</span><span class="cx">                         path = WebCore;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -1495,7 +1495,7 @@
</span><span class="cx">                                 7CCE7ECE1A411A7E00447C4C /* StopLoadingFromDidFinishLoading.mm in Sources */,
</span><span class="cx">                                 7CCE7ECF1A411A7E00447C4C /* StopLoadingFromDidReceiveResponse.mm in Sources */,
</span><span class="cx">                                 7CCE7F441A411B8E00447C4C /* StringBuilder.cpp in Sources */,
</span><del>-                                7CB184C61AA3F2100066EDFD /* ContentFilter.cpp in Sources */,
</del><ins>+                                7CB184C61AA3F2100066EDFD /* ContentExtensions.cpp in Sources */,
</ins><span class="cx">                                 7CCE7ED01A411A7E00447C4C /* StringByEvaluatingJavaScriptFromString.mm in Sources */,
</span><span class="cx">                                 7CCE7F451A411B8E00447C4C /* StringHasher.cpp in Sources */,
</span><span class="cx">                                 7CCE7F461A411B8E00447C4C /* StringImpl.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreContentExtensionscppfromrev181000trunkToolsTestWebKitAPITestsWebCoreContentFiltercpp"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp (from rev 181000, trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp) (0 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -0,0 +1,110 @@
</span><ins>+/*
+ * Copyright (C) 2015 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;PlatformUtilities.h&quot;
+#include &lt;JavaScriptCore/InitializeThreading.h&gt;
+#include &lt;WebCore/ContentExtensionCompiler.h&gt;
+#include &lt;WebCore/ContentExtensionsBackend.h&gt;
+#include &lt;WebCore/URL.h&gt;
+#include &lt;wtf/MainThread.h&gt;
+#include &lt;wtf/RunLoop.h&gt;
+
+namespace WebCore {
+namespace ContentExtensions {
+inline std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const ActionType&amp; action)
+{
+    switch (action) {
+    case ActionType::BlockLoad:
+        return os &lt;&lt; &quot;ContentFilterAction::BlockLoad&quot;;
+    case ActionType::BlockCookies:
+        return os &lt;&lt; &quot;ContentFilterAction::BlockCookies&quot;;
+    case ActionType::CSSDisplayNone:
+        return os &lt;&lt; &quot;ContentFilterAction::CSSDisplayNone&quot;;
+    case ActionType::IgnorePreviousRules:
+        return os &lt;&lt; &quot;ContentFilterAction::IgnorePreviousRules&quot;;
+    case ActionType::InvalidAction:
+        return os &lt;&lt; &quot;ContentFilterAction::InvalidAction&quot;;
+    }
+}
+}
+}
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+class ContentExtensionTest : public testing::Test {
+public:
+    virtual void SetUp()
+    {
+        WTF::initializeMainThread();
+        JSC::initializeThreading();
+        RunLoop::initializeMainRunLoop();
+    }
+};
+
+class InMemoryCompiledContentExtension : public ContentExtensions::CompiledContentExtension {
+public:
+    static RefPtr&lt;InMemoryCompiledContentExtension&gt; create(ContentExtensions::CompiledContentExtensionData&amp;&amp; data)
+    {
+        return adoptRef(new InMemoryCompiledContentExtension(WTF::move(data)));
+    }
+
+    virtual ~InMemoryCompiledContentExtension()
+    {
+    }
+
+    virtual const ContentExtensions::DFABytecode* bytecode() const override { return m_data.bytecode.data(); }
+    virtual unsigned bytecodeLength() const override { return m_data.bytecode.size(); }
+    virtual const ContentExtensions::SerializedActionByte* actions() const override { return m_data.actions.data(); }
+    virtual unsigned actionsLength() const override { return m_data.actions.size(); }
+
+private:
+    InMemoryCompiledContentExtension(ContentExtensions::CompiledContentExtensionData&amp;&amp; data)
+        : m_data(WTF::move(data))
+    {
+    }
+
+    ContentExtensions::CompiledContentExtensionData m_data;
+};
+
+const char* basicFilter = &quot;[{\&quot;action\&quot;:{\&quot;type\&quot;:\&quot;block\&quot;},\&quot;trigger\&quot;:{\&quot;url-filter\&quot;:\&quot;.*webkit.org\&quot;}}]&quot;;
+
+TEST_F(ContentExtensionTest, Basic)
+{
+    auto extensionData = ContentExtensions::compileRuleList(basicFilter);
+    auto extension = InMemoryCompiledContentExtension::create(WTF::move(extensionData));
+
+    ContentExtensions::ContentExtensionsBackend backend;
+    backend.addContentExtension(&quot;testFilter&quot;, extension);
+    
+    auto actions = backend.actionsForURL(URL(ParsedURLString, &quot;http://webkit.org/&quot;));
+    EXPECT_EQ(1u, actions.size());
+    EXPECT_EQ(ContentExtensions::ActionType::BlockLoad, actions[0].type());
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreContentFiltercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp (181199 => 181200)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp        2015-03-07 02:00:11 UTC (rev 181199)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ContentFilter.cpp        2015-03-07 02:41:44 UTC (rev 181200)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 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;PlatformUtilities.h&quot;
-#include &lt;JavaScriptCore/InitializeThreading.h&gt;
-#include &lt;WebCore/ContentExtensionCompiler.h&gt;
-#include &lt;WebCore/ContentExtensionsBackend.h&gt;
-#include &lt;WebCore/URL.h&gt;
-#include &lt;wtf/MainThread.h&gt;
-#include &lt;wtf/RunLoop.h&gt;
-
-namespace WebCore {
-namespace ContentExtensions {
-inline std::ostream&amp; operator&lt;&lt;(std::ostream&amp; os, const ActionType&amp; action)
-{
-    switch (action) {
-    case ActionType::BlockLoad:
-        return os &lt;&lt; &quot;ContentFilterAction::BlockLoad&quot;;
-    case ActionType::BlockCookies:
-        return os &lt;&lt; &quot;ContentFilterAction::BlockCookies&quot;;
-    case ActionType::CSSDisplayNone:
-        return os &lt;&lt; &quot;ContentFilterAction::CSSDisplayNone&quot;;
-    case ActionType::IgnorePreviousRules:
-        return os &lt;&lt; &quot;ContentFilterAction::IgnorePreviousRules&quot;;
-    case ActionType::InvalidAction:
-        return os &lt;&lt; &quot;ContentFilterAction::InvalidAction&quot;;
-    }
-}
-}
-}
-
-using namespace WebCore;
-
-namespace TestWebKitAPI {
-
-class ContentFilterTest : public testing::Test {
-public:
-    virtual void SetUp()
-    {
-        WTF::initializeMainThread();
-        JSC::initializeThreading();
-        RunLoop::initializeMainRunLoop();
-    }
-};
-
-const char* basicFilter = &quot;[{\&quot;action\&quot;:{\&quot;type\&quot;:\&quot;block\&quot;},\&quot;trigger\&quot;:{\&quot;url-filter\&quot;:\&quot;.*webkit.org\&quot;}}]&quot;;
-
-TEST_F(ContentFilterTest, Basic)
-{
-    RefPtr&lt;ContentExtensions::CompiledContentExtension&gt; extension = ContentExtensions::compileRuleList(basicFilter);
-
-    ContentExtensions::ContentExtensionsBackend backend;
-    backend.addContentExtension(&quot;testFilter&quot;, extension);
-    
-    auto actions = backend.actionsForURL(URL(ParsedURLString, &quot;http://webkit.org/&quot;));
-    EXPECT_EQ(1u, actions.size());
-    EXPECT_EQ(ContentExtensions::ActionType::BlockLoad, actions[0].type());
-}
-
-} // namespace TestWebKitAPI
</del></span></pre>
</div>
</div>

</body>
</html>