Try to fix the Mac build after r182596.
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 09:26:46 +0000 (09:26 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Apr 2015 09:26:46 +0000 (09:26 +0000)
I was wrong to replace PLATFORM(IOS) with HAVE(PARENTAL_CONTROLS) in ContentFilterUnblockHandler.
The conditional should be HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS).

* platform/ContentFilterUnblockHandler.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
(WebCore::ContentFilterUnblockHandler::needsUIProcess):
(WebCore::ContentFilterUnblockHandler::encode):
(WebCore::ContentFilterUnblockHandler::decode):
(WebCore::ContentFilterUnblockHandler::canHandleRequest):
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/ContentFilterUnblockHandler.h
Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm

index 1807cfb..14c86d1 100644 (file)
@@ -1,5 +1,21 @@
 2015-04-09  Andy Estes  <aestes@apple.com>
 
+        Try to fix the Mac build after r182596.
+
+        I was wrong to replace PLATFORM(IOS) with HAVE(PARENTAL_CONTROLS) in ContentFilterUnblockHandler.
+        The conditional should be HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS).
+
+        * platform/ContentFilterUnblockHandler.h:
+        * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
+        (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
+        (WebCore::ContentFilterUnblockHandler::needsUIProcess):
+        (WebCore::ContentFilterUnblockHandler::encode):
+        (WebCore::ContentFilterUnblockHandler::decode):
+        (WebCore::ContentFilterUnblockHandler::canHandleRequest):
+        (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
+
+2015-04-09  Andy Estes  <aestes@apple.com>
+
         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
         https://bugs.webkit.org/show_bug.cgi?id=143559
 
index f02aad2..b9a9d00 100644 (file)
@@ -50,7 +50,7 @@ public:
 
     ContentFilterUnblockHandler() = default;
     WEBCORE_EXPORT ContentFilterUnblockHandler(String unblockURLHost, UnblockRequesterFunction);
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     ContentFilterUnblockHandler(String unblockURLHost, RetainPtr<WebFilterEvaluator>);
 #endif
 
@@ -69,7 +69,7 @@ private:
     String m_unblockURLHost;
     URL m_unreachableURL;
     UnblockRequesterFunction m_unblockRequester;
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     RetainPtr<WebFilterEvaluator> m_webFilterEvaluator;
 #endif
 };
index 3b67e4d..365d11b 100644 (file)
@@ -39,7 +39,6 @@
 
 #if PLATFORM(IOS)
 #import "WebCoreThreadRun.h"
-#endif
 
 #if HAVE(PARENTAL_CONTROLS)
 #import "SoftLinking.h"
@@ -50,6 +49,7 @@ SOFT_LINK_CLASS(WebContentAnalysis, WebFilterEvaluator);
 
 static NSString * const webFilterEvaluatorKey { @"webFilterEvaluator" };
 #endif
+#endif
 
 static NSString * const unblockURLHostKey { @"unblockURLHost" };
 static NSString * const unreachableURLKey { @"unreachableURL" };
@@ -63,7 +63,7 @@ ContentFilterUnblockHandler::ContentFilterUnblockHandler(String unblockURLHost,
     LOG(ContentFiltering, "Creating ContentFilterUnblockHandler with an unblock requester and unblock URL host <%s>.\n", unblockURLHost.ascii().data());
 }
 
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
 ContentFilterUnblockHandler::ContentFilterUnblockHandler(String unblockURLHost, RetainPtr<WebFilterEvaluator> evaluator)
     : m_unblockURLHost { WTF::move(unblockURLHost) }
     , m_webFilterEvaluator { WTF::move(evaluator) }
@@ -81,7 +81,7 @@ void ContentFilterUnblockHandler::wrapWithDecisionHandler(const DecisionHandlerF
             decisionHandler(unblocked);
         });
     }};
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     m_webFilterEvaluator = nullptr;
 #endif
     std::swap(m_unblockRequester, wrappedRequester);
@@ -89,7 +89,7 @@ void ContentFilterUnblockHandler::wrapWithDecisionHandler(const DecisionHandlerF
 
 bool ContentFilterUnblockHandler::needsUIProcess() const
 {
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     return m_webFilterEvaluator;
 #else
     return false;
@@ -102,7 +102,7 @@ void ContentFilterUnblockHandler::encode(NSCoder *coder) const
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [coder encodeObject:m_unblockURLHost forKey:unblockURLHostKey];
     [coder encodeObject:(NSURL *)m_unreachableURL forKey:unreachableURLKey];
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     [coder encodeObject:m_webFilterEvaluator.get() forKey:webFilterEvaluatorKey];
 #endif
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -114,7 +114,7 @@ bool ContentFilterUnblockHandler::decode(NSCoder *coder, ContentFilterUnblockHan
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     unblockHandler.m_unblockURLHost = [coder decodeObjectOfClass:[NSString class] forKey:unblockURLHostKey];
     unblockHandler.m_unreachableURL = [coder decodeObjectOfClass:[NSURL class] forKey:unreachableURLKey];
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     unblockHandler.m_webFilterEvaluator = [coder decodeObjectOfClass:getWebFilterEvaluatorClass() forKey:webFilterEvaluatorKey];
 #endif
     return true;
@@ -125,7 +125,7 @@ bool ContentFilterUnblockHandler::decode(NSCoder *coder, ContentFilterUnblockHan
 bool ContentFilterUnblockHandler::canHandleRequest(const ResourceRequest& request) const
 {
     if (!m_unblockRequester) {
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
         if (!m_webFilterEvaluator)
             return false;
 #else
@@ -154,7 +154,7 @@ static inline void dispatchToMainThread(void (^block)())
 
 void ContentFilterUnblockHandler::requestUnblockAsync(DecisionHandlerFunction decisionHandler) const
 {
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
     if (m_webFilterEvaluator) {
         [m_webFilterEvaluator unblockWithCompletion:[decisionHandler](BOOL unblocked, NSError *) {
             dispatchToMainThread([decisionHandler, unblocked] {