Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 22:56:19 +0000 (22:56 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2015 22:56:19 +0000 (22:56 +0000)
Source/WebCore:

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getTypeFlags):

Source/WebKit2:

* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
* UIProcess/API/C/WKUserContentFilterRef.cpp:
(WKUserContentFilterCreate):
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]):

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::InMemoryCompiledContentExtension::createFromFilter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181978 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/contentextensions/ContentExtensionCompiler.cpp
Source/WebCore/contentextensions/ContentExtensionCompiler.h
Source/WebCore/contentextensions/ContentExtensionParser.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCompiledContentExtension.cpp
Source/WebKit2/UIProcess/API/C/WKUserContentFilterRef.cpp
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp

index de3310d..7f56dc9 100644 (file)
@@ -1,5 +1,15 @@
 2015-03-25  Sam Weinig  <sam@webkit.org>
 
+        Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
+
+        * contentextensions/ContentExtensionCompiler.cpp:
+        (WebCore::ContentExtensions::compileRuleList):
+        * contentextensions/ContentExtensionCompiler.h:
+        * contentextensions/ContentExtensionParser.cpp:
+        (WebCore::ContentExtensions::getTypeFlags):
+
+2015-03-25  Sam Weinig  <sam@webkit.org>
+
         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
         https://bugs.webkit.org/show_bug.cgi?id=143059
 
index 01a3459..85d43fa 100644 (file)
@@ -100,7 +100,7 @@ static Vector<unsigned> serializeActions(const Vector<ContentExtensionRule>& rul
 }
 
 
-std::error_code compileRuleList(const String& ruleList, ContentExtensionCompilationClient& client)
+std::error_code compileRuleList(ContentExtensionCompilationClient& client, const String& ruleList)
 {
     Vector<ContentExtensionRule> parsedRuleList;
     auto parserError = parseRuleList(ruleList, parsedRuleList);
index 4452b07..2ee9f79 100644 (file)
@@ -49,7 +49,7 @@ public:
     virtual void writeActions(Vector<SerializedActionByte>&&) = 0;
 };
 
-WEBCORE_EXPORT std::error_code compileRuleList(const String&, ContentExtensionCompilationClient&);
+WEBCORE_EXPORT std::error_code compileRuleList(ContentExtensionCompilationClient&, const String&);
 
 } // namespace ContentExtensions
 } // namespace WebCore
index 2841866..8906cb7 100644 (file)
@@ -47,7 +47,7 @@ namespace WebCore {
 
 namespace ContentExtensions {
 
-static std::error_code getTypeFlags(ExecState& exec, const JSValue& typeValue, ResourceFlags& flags, uint16_t(*stringToType)(const String&))
+static std::error_code getTypeFlags(ExecState& exec, const JSValue& typeValue, ResourceFlags& flags, uint16_t (*stringToType)(const String&))
 {
     if (!typeValue.isObject())
         return { };
index b4be311..9f8b01b 100644 (file)
@@ -1,5 +1,16 @@
 2015-03-25  Sam Weinig  <sam@webkit.org>
 
+        Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
+
+        * Shared/WebCompiledContentExtension.cpp:
+        (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
+        * UIProcess/API/C/WKUserContentFilterRef.cpp:
+        (WKUserContentFilterCreate):
+        * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
+        (-[_WKUserContentFilter initWithName:serializedRules:]):
+
+2015-03-25  Sam Weinig  <sam@webkit.org>
+
         [Content Extensions] Convert content extension compiling to return error codes and write its output using a client
         https://bugs.webkit.org/show_bug.cgi?id=143059
 
index 749fa5a..216937c 100644 (file)
@@ -56,7 +56,7 @@ Ref<WebCompiledContentExtension> WebCompiledContentExtension::createFromCompiled
     data.data = WTF::move(sharedMemory);
     data.bytecodeOffset = 0;
     data.bytecodeSize = compilerData.bytecode.size();
-    data.actionsOffset = compilerData.  bytecode.size();
+    data.actionsOffset = compilerData.bytecode.size();
     data.actionsSize = compilerData.actions.size();
 
     return create(WTF::move(data));
index eef9712..a1f9ea8 100644 (file)
@@ -45,7 +45,7 @@ WKUserContentFilterRef WKUserContentFilterCreate(WKStringRef nameRef, WKStringRe
     WebCore::ContentExtensions::CompiledContentExtensionData data;
     LegacyContentExtensionCompilationClient client(data);
 
-    auto compilerError = WebCore::ContentExtensions::compileRuleList(toWTFString(serializedRulesRef), client);
+    auto compilerError = WebCore::ContentExtensions::compileRuleList(client, toWTFString(serializedRulesRef));
     if (compilerError)
         return nullptr;
 
index bfd934a..4719ee7 100644 (file)
@@ -43,8 +43,7 @@
     WebCore::ContentExtensions::CompiledContentExtensionData data;
     WebKit::LegacyContentExtensionCompilationClient client(data);
 
-    auto compilerError = WebCore::ContentExtensions::compileRuleList(String(serializedRules), client);
-    if (compilerError)
+    if (auto compilerError = WebCore::ContentExtensions::compileRuleList(client, String(serializedRules)))
         [NSException raise:NSGenericException format:@"Failed to compile rules with error: %s", compilerError.message().c_str()];
 
     auto compiledContentExtension = WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData(data);
index 0b9e451..3054924 100644 (file)
@@ -1,3 +1,10 @@
+2015-03-25  Sam Weinig  <sam@webkit.org>
+
+        Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
+
+        * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
+        (TestWebKitAPI::InMemoryCompiledContentExtension::createFromFilter):
+
 2015-03-25  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Migrate update-webkit for Windows to not require Cygwin
index 93d0fbe..de67d6b 100644 (file)
@@ -101,7 +101,7 @@ public:
     {
         WebCore::ContentExtensions::CompiledContentExtensionData extensionData;
         InMemoryContentExtensionCompilationClient client(extensionData);
-        auto compilerError = ContentExtensions::compileRuleList(filter, client);
+        auto compilerError = ContentExtensions::compileRuleList(client, filter);
         if (compilerError)
             return nullptr;