Title: [198532] trunk/Source
Revision
198532
Author
[email protected]
Date
2016-03-22 10:26:03 -0700 (Tue, 22 Mar 2016)

Log Message

[GTK] WebInspector broken after r197620
https://bugs.webkit.org/show_bug.cgi?id=155497
<rdar://problem/25171910>

Patch by Carlos Garcia Campos <[email protected]> on 2016-03-22
Reviewed by Philippe Normand.

Source/WebCore:

Add resource scheme to the list of secure protocols.

* platform/SchemeRegistry.cpp:
(WebCore::secureSchemes):

Source/WebKit2:

Stop registering resource:// URLs as local, because they are not
like a local file at all. Compare also the URL protocols when
checking whether requested URL is main or test inspector page
instead of checking that the protocol is registered as local.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::isMainOrTestInspectorPage): Compare also the URL protocols.
* UIProcess/WebInspectorProxy.h:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Do not
set setAllowFileAccessFromFileURLs setting to true.
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess): Do not
register resource:// URLS as local.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (198531 => 198532)


--- trunk/Source/WebCore/ChangeLog	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebCore/ChangeLog	2016-03-22 17:26:03 UTC (rev 198532)
@@ -1,3 +1,16 @@
+2016-03-22  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebInspector broken after r197620
+        https://bugs.webkit.org/show_bug.cgi?id=155497
+        <rdar://problem/25171910>
+
+        Reviewed by Philippe Normand.
+
+        Add resource scheme to the list of secure protocols.
+
+        * platform/SchemeRegistry.cpp:
+        (WebCore::secureSchemes):
+
 2016-03-22  Brent Fulgham  <[email protected]>
 
         SharedBuffer::copy() can cause a segmentation fault.

Modified: trunk/Source/WebCore/platform/SchemeRegistry.cpp (198531 => 198532)


--- trunk/Source/WebCore/platform/SchemeRegistry.cpp	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebCore/platform/SchemeRegistry.cpp	2016-03-22 17:26:03 UTC (rev 198532)
@@ -66,6 +66,9 @@
 #if USE(QUICK_LOOK)
         secureSchemes.get().add(QLPreviewProtocol());
 #endif
+#if PLATFORM(GTK)
+        secureSchemes.get().add("resource");
+#endif
     }
 
     return secureSchemes;

Modified: trunk/Source/WebKit2/ChangeLog (198531 => 198532)


--- trunk/Source/WebKit2/ChangeLog	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-22 17:26:03 UTC (rev 198532)
@@ -1,3 +1,26 @@
+2016-03-22  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebInspector broken after r197620
+        https://bugs.webkit.org/show_bug.cgi?id=155497
+        <rdar://problem/25171910>
+
+        Reviewed by Philippe Normand.
+
+        Stop registering resource:// URLs as local, because they are not
+        like a local file at all. Compare also the URL protocols when
+        checking whether requested URL is main or test inspector page
+        instead of checking that the protocol is registered as local.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::isMainOrTestInspectorPage): Compare also the URL protocols.
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformCreateInspectorPage): Do not
+        set setAllowFileAccessFromFileURLs setting to true.
+        * UIProcess/gtk/WebProcessPoolGtk.cpp:
+        (WebKit::WebProcessPool::platformInitializeWebProcess): Do not
+        register resource:// URLS as local.
+
 2016-03-22  Alberto Garcia  <[email protected]>
 
         Unreviewed typo fixes.

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (198531 => 198532)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-03-22 17:26:03 UTC (rev 198532)
@@ -43,7 +43,6 @@
 #include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include <WebCore/NotImplemented.h>
-#include <WebCore/SchemeRegistry.h>
 #include <wtf/NeverDestroyed.h>
 
 #if ENABLE(INSPECTOR_SERVER)
@@ -332,14 +331,10 @@
 
 static bool isMainOrTestInspectorPage(WKURLRequestRef requestRef)
 {
-    URL requestURL(URL(), toImpl(requestRef)->resourceRequest().url());
-    if (!WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(requestURL.protocol()))
-        return false;
-
-    // Use URL so we can compare just the paths.
+    // Use URL so we can compare the paths and protocols.
+    const URL& requestURL = toImpl(requestRef)->resourceRequest().url();
     URL mainPageURL(URL(), WebInspectorProxy::inspectorPageURL());
-    ASSERT(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(mainPageURL.protocol()));
-    if (decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(mainPageURL.path()))
+    if (requestURL.protocol() == mainPageURL.protocol() && decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(mainPageURL.path()))
         return true;
 
     // We might not have a Test URL in Production builds.
@@ -348,8 +343,7 @@
         return false;
 
     URL testPageURL(URL(), testPageURLString);
-    ASSERT(WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal(testPageURL.protocol()));
-    return decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(testPageURL.path());
+    return requestURL.protocol() == testPageURL.protocol() && decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(testPageURL.path());
 }
 
 static void processDidCrash(WKPageRef, const void* clientInfo)

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (198531 => 198532)


--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp	2016-03-22 17:26:03 UTC (rev 198532)
@@ -74,7 +74,6 @@
     preferences->setDeveloperExtrasEnabled(true);
     preferences->setLogsPageMessagesToSystemConsoleEnabled(true);
 #endif
-    preferences->setAllowFileAccessFromFileURLs(true);
     preferences->setJavaScriptRuntimeFlags({
     });
     RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifier(), false, false);

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp (198531 => 198532)


--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp	2016-03-22 17:01:04 UTC (rev 198531)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessPoolGtk.cpp	2016-03-22 17:26:03 UTC (rev 198532)
@@ -89,12 +89,6 @@
 void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
     initInspectorServer();
-
-    if (!parameters.urlSchemesRegisteredAsLocal.contains("resource")) {
-        WebCore::SchemeRegistry::registerURLSchemeAsLocal("resource");
-        parameters.urlSchemesRegisteredAsLocal.append("resource");
-    }
-
     parameters.memoryCacheDisabled = m_memoryCacheDisabled || cacheModel() == CacheModelDocumentViewer;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to