+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
ContentFilterUnblockHandler() = default;
WEBCORE_EXPORT ContentFilterUnblockHandler(String unblockURLHost, UnblockRequesterFunction);
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
ContentFilterUnblockHandler(String unblockURLHost, RetainPtr<WebFilterEvaluator>);
#endif
String m_unblockURLHost;
URL m_unreachableURL;
UnblockRequesterFunction m_unblockRequester;
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
RetainPtr<WebFilterEvaluator> m_webFilterEvaluator;
#endif
};
#if PLATFORM(IOS)
#import "WebCoreThreadRun.h"
-#endif
#if HAVE(PARENTAL_CONTROLS)
#import "SoftLinking.h"
static NSString * const webFilterEvaluatorKey { @"webFilterEvaluator" };
#endif
+#endif
static NSString * const unblockURLHostKey { @"unblockURLHost" };
static NSString * const unreachableURLKey { @"unreachableURL" };
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) }
decisionHandler(unblocked);
});
}};
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
m_webFilterEvaluator = nullptr;
#endif
std::swap(m_unblockRequester, wrappedRequester);
bool ContentFilterUnblockHandler::needsUIProcess() const
{
-#if HAVE(PARENTAL_CONTROLS)
+#if HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS)
return m_webFilterEvaluator;
#else
return false;
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;
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;
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
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] {