Title: [230538] branches/safari-605-branch/Source
- Revision
- 230538
- Author
- kocsen_ch...@apple.com
- Date
- 2018-04-11 11:15:03 -0700 (Wed, 11 Apr 2018)
Log Message
Cherry-pick r230467. rdar://problem/39317878
Refactor Ignore HSTS code
https://bugs.webkit.org/show_bug.cgi?id=184433
<rdar://problem/39298238>
Reviewed by Darin Adler.
This patch refactors our ignore HSTS code. The convenience functions are moved
out of CFNetwork SPI in PAL, and into where they are used. It also switches
from performSelector: calls to straight function calls, after checking that
there is a responder.
Source/WebCore:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::schemeWasUpgradedDueToDynamicHSTS):
Add convenience function here since it was moved out of
CFNetworkSPI.h.
Source/WebCore/PAL:
* pal/spi/cf/CFNetworkSPI.h:
(schemeWasUpgradedDueToDynamicHSTS): Deleted.
(setIgnoreHSTS): Deleted.
(ignoreHSTS): Deleted.
Source/WebKit:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(schemeWasUpgradedDueToDynamicHSTS):
(setIgnoreHSTS):
(ignoreHSTS):
Add convenience functions here since they were moved out of
CFNetworkSPI.h.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (230537 => 230538)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-04-11 18:15:03 UTC (rev 230538)
@@ -1,3 +1,62 @@
+2018-04-10 Kocsen Chung <kocsen_ch...@apple.com>
+
+ Cherry-pick r230467. rdar://problem/39317878
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ Source/WebCore:
+
+ * platform/network/mac/WebCoreURLResponse.mm:
+ (WebCore::schemeWasUpgradedDueToDynamicHSTS):
+ Add convenience function here since it was moved out of
+ CFNetworkSPI.h.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/cf/CFNetworkSPI.h:
+ (schemeWasUpgradedDueToDynamicHSTS): Deleted.
+ (setIgnoreHSTS): Deleted.
+ (ignoreHSTS): Deleted.
+
+ Source/WebKit:
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (schemeWasUpgradedDueToDynamicHSTS):
+ (setIgnoreHSTS):
+ (ignoreHSTS):
+ Add convenience functions here since they were moved out of
+ CFNetworkSPI.h.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-04-09 John Wilander <wilan...@apple.com>
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ * platform/network/mac/WebCoreURLResponse.mm:
+ (WebCore::schemeWasUpgradedDueToDynamicHSTS):
+ Add convenience function here since it was moved out of
+ CFNetworkSPI.h.
+
2018-04-05 Jason Marcell <jmarc...@apple.com>
Cherry-pick r228334. rdar://problem/38712636
Modified: branches/safari-605-branch/Source/WebCore/PAL/ChangeLog (230537 => 230538)
--- branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebCore/PAL/ChangeLog 2018-04-11 18:15:03 UTC (rev 230538)
@@ -1,3 +1,62 @@
+2018-04-10 Kocsen Chung <kocsen_ch...@apple.com>
+
+ Cherry-pick r230467. rdar://problem/39317878
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ Source/WebCore:
+
+ * platform/network/mac/WebCoreURLResponse.mm:
+ (WebCore::schemeWasUpgradedDueToDynamicHSTS):
+ Add convenience function here since it was moved out of
+ CFNetworkSPI.h.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/cf/CFNetworkSPI.h:
+ (schemeWasUpgradedDueToDynamicHSTS): Deleted.
+ (setIgnoreHSTS): Deleted.
+ (ignoreHSTS): Deleted.
+
+ Source/WebKit:
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (schemeWasUpgradedDueToDynamicHSTS):
+ (setIgnoreHSTS):
+ (ignoreHSTS):
+ Add convenience functions here since they were moved out of
+ CFNetworkSPI.h.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-04-09 John Wilander <wilan...@apple.com>
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ * pal/spi/cf/CFNetworkSPI.h:
+ (schemeWasUpgradedDueToDynamicHSTS): Deleted.
+ (setIgnoreHSTS): Deleted.
+ (ignoreHSTS): Deleted.
+
2018-04-06 Jason Marcell <jmarc...@apple.com>
Cherry-pick r230311. rdar://problem/39217770
Modified: branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (230537 => 230538)
--- branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h 2018-04-11 18:15:03 UTC (rev 230538)
@@ -346,24 +346,4 @@
- (void)_setMIMEType:(NSString *)type;
@end
-static bool schemeWasUpgradedDueToDynamicHSTS(NSURLRequest *request)
-{
- if ([request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)])
- return [request performSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)];
- return false;
-}
-
-static void setIgnoreHSTS(NSMutableURLRequest *request, bool ignoreHSTS)
-{
- if ([request respondsToSelector:@selector(_setIgnoreHSTS:)])
- [request performSelector:@selector(_setIgnoreHSTS:) withObject:[NSNumber numberWithBool:ignoreHSTS]];
-}
-
-static bool ignoreHSTS(NSURLRequest *request)
-{
- if ([request respondsToSelector:@selector(_ignoreHSTS)])
- return [request performSelector:@selector(_ignoreHSTS)];
- return false;
-}
-
#endif // defined(__OBJC__)
Modified: branches/safari-605-branch/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm (230537 => 230538)
--- branches/safari-605-branch/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebCore/platform/network/mac/WebCoreURLResponse.mm 2018-04-11 18:15:03 UTC (rev 230538)
@@ -327,6 +327,17 @@
}
#endif
+static bool schemeWasUpgradedDueToDynamicHSTS(NSURLRequest *request)
+{
+#if !USE(CFNETWORK_IGNORE_HSTS)
+ UNUSED_PARAM(request);
+ return false;
+#else
+ return [request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)]
+ && [request _schemeWasUpgradedDueToDynamicHSTS];
+#endif
+}
+
NSURLResponse *synthesizeRedirectResponseIfNecessary(NSURLRequest *currentRequest, NSURLRequest *newRequest, NSURLResponse *redirectResponse)
{
if (redirectResponse)
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (230537 => 230538)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-04-11 18:15:03 UTC (rev 230538)
@@ -1,3 +1,64 @@
+2018-04-10 Kocsen Chung <kocsen_ch...@apple.com>
+
+ Cherry-pick r230467. rdar://problem/39317878
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ Source/WebCore:
+
+ * platform/network/mac/WebCoreURLResponse.mm:
+ (WebCore::schemeWasUpgradedDueToDynamicHSTS):
+ Add convenience function here since it was moved out of
+ CFNetworkSPI.h.
+
+ Source/WebCore/PAL:
+
+ * pal/spi/cf/CFNetworkSPI.h:
+ (schemeWasUpgradedDueToDynamicHSTS): Deleted.
+ (setIgnoreHSTS): Deleted.
+ (ignoreHSTS): Deleted.
+
+ Source/WebKit:
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (schemeWasUpgradedDueToDynamicHSTS):
+ (setIgnoreHSTS):
+ (ignoreHSTS):
+ Add convenience functions here since they were moved out of
+ CFNetworkSPI.h.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-04-09 John Wilander <wilan...@apple.com>
+
+ Refactor Ignore HSTS code
+ https://bugs.webkit.org/show_bug.cgi?id=184433
+ <rdar://problem/39298238>
+
+ Reviewed by Darin Adler.
+
+ This patch refactors our ignore HSTS code. The convenience functions are moved
+ out of CFNetwork SPI in PAL, and into where they are used. It also switches
+ from performSelector: calls to straight function calls, after checking that
+ there is a responder.
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (schemeWasUpgradedDueToDynamicHSTS):
+ (setIgnoreHSTS):
+ (ignoreHSTS):
+ Add convenience functions here since they were moved out of
+ CFNetworkSPI.h.
+
2018-03-21 Jason Marcell <jmarc...@apple.com>
Cherry-pick r229297. rdar://problem/38682578
Modified: branches/safari-605-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (230537 => 230538)
--- branches/safari-605-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-04-11 18:15:00 UTC (rev 230537)
+++ branches/safari-605-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2018-04-11 18:15:03 UTC (rev 230538)
@@ -180,6 +180,24 @@
ASSERT_NOT_REACHED();
return request;
}
+
+static bool schemeWasUpgradedDueToDynamicHSTS(NSURLRequest *request)
+{
+ return [request respondsToSelector:@selector(_schemeWasUpgradedDueToDynamicHSTS)]
+ && [request _schemeWasUpgradedDueToDynamicHSTS];
+}
+
+static void setIgnoreHSTS(NSMutableURLRequest *request, bool ignoreHSTS)
+{
+ if ([request respondsToSelector:@selector(_setIgnoreHSTS:)])
+ [request _setIgnoreHSTS:ignoreHSTS];
+}
+
+static bool ignoreHSTS(NSURLRequest *request)
+{
+ return [request respondsToSelector:@selector(_ignoreHSTS)]
+ && [request _ignoreHSTS];
+}
#endif
static NSURLRequest* updateIgnoreStrictTransportSecuritySettingIfNecessary(NSURLRequest *request, bool shouldIgnoreHSTS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes