Title: [124618] trunk/Tools
Revision
124618
Author
[email protected]
Date
2012-08-03 09:05:07 -0700 (Fri, 03 Aug 2012)

Log Message

Unreviewed, rolling out r124567.
http://trac.webkit.org/changeset/124567
https://bugs.webkit.org/show_bug.cgi?id=89382

Broke some tests with external resources

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willSendRequestForFrame):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (124617 => 124618)


--- trunk/Tools/ChangeLog	2012-08-03 15:51:56 UTC (rev 124617)
+++ trunk/Tools/ChangeLog	2012-08-03 16:05:07 UTC (rev 124618)
@@ -1,3 +1,14 @@
+2012-08-03  Balazs Kelemen  <[email protected]>
+
+        Unreviewed, rolling out r124567.
+        http://trac.webkit.org/changeset/124567
+        https://bugs.webkit.org/show_bug.cgi?id=89382
+
+        Broke some tests with external resources
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::willSendRequestForFrame):
+
 2012-08-03  Philippe Normand  <[email protected]>
 
         Unreviewed, rolling out r124614.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (124617 => 124618)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-08-03 15:51:56 UTC (rev 124617)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2012-08-03 16:05:07 UTC (rev 124618)
@@ -944,18 +944,8 @@
 
 // Resource Load Client Callbacks
 
-static inline bool isLocalHost(WKStringRef host)
+WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef, uint64_t, WKURLRequestRef request, WKURLResponseRef)
 {
-    return WKStringIsEqualToUTF8CString(host, "127.0.0.1") || WKStringIsEqualToUTF8CString(host, "localhost");
-}
-
-static inline bool isHTTPOrHTTPSScheme(WKStringRef scheme)
-{
-    return WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme, "https");
-}
-
-WKURLRequestRef InjectedBundlePage::willSendRequestForFrame(WKBundlePageRef, WKBundleFrameRef frame, uint64_t, WKURLRequestRef request, WKURLResponseRef)
-{
     if (InjectedBundle::shared().isTestRunning() && InjectedBundle::shared().layoutTestController()->willSendRequestReturnsNull())
         return 0;
 
@@ -964,23 +954,14 @@
     WKRetainPtr<WKStringRef> scheme = adoptWK(WKURLCopyScheme(url.get()));
     WKRetainPtr<WKStringRef> urlString = adoptWK(WKURLCopyString(url.get()));
     if (host && !WKStringIsEmpty(host.get())
-        && isHTTPOrHTTPSScheme(scheme.get())
+        && (WKStringIsEqualToUTF8CStringIgnoringCase(scheme.get(), "http") || WKStringIsEqualToUTF8CStringIgnoringCase(scheme.get(), "https"))
+        && !WKStringIsEqualToUTF8CString(host.get(), "127.0.0.1")
         && !WKStringIsEqualToUTF8CString(host.get(), "255.255.255.255") // Used in some tests that expect to get back an error.
-        && !isLocalHost(host.get())) {
-        WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(m_page);
-        if (mainFrame != frame) {
-            WKRetainPtr<WKURLRef> mainFrameURL = adoptWK(WKBundleFrameCopyURL(mainFrame));
-            WKRetainPtr<WKStringRef> mainFrameHost = WKURLCopyHostName(mainFrameURL.get());
-            WKRetainPtr<WKStringRef> mainFrameScheme = WKURLCopyScheme(mainFrameURL.get());
-
-            bool mainFrameIsExternal = isHTTPOrHTTPSScheme(mainFrameScheme.get()) && !isLocalHost(mainFrameHost.get());
-            if (!mainFrameIsExternal) {
-                InjectedBundle::shared().stringBuilder()->append("Blocked access to external URL ");
-                InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString));
-                InjectedBundle::shared().stringBuilder()->append("\n");
-                return 0;
-            }
-        }
+        && !WKStringIsEqualToUTF8CStringIgnoringCase(host.get(), "localhost")) {
+        InjectedBundle::shared().stringBuilder()->append("Blocked access to external URL ");
+        InjectedBundle::shared().stringBuilder()->append(toWTFString(urlString));
+        InjectedBundle::shared().stringBuilder()->append("\n");
+        return 0;
     }
 
     WKRetain(request);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to