REGRESSION (r95747): Activating the web inspector causes the web process to be killed
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 22:46:28 +0000 (22:46 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 22:46:28 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68762

Reviewed by Anders Carlsson.

* UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage):
Tell Web process that loading resources from WebCore resources directory is OK.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadHTMLString):
(WebKit::WebPageProxy::loadAlternateHTMLString):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
* UIProcess/WebProcessProxy.h:
Renamed willLoadHTMLStringWithBaseURL to more generic assumeReadAccessToBaseURL.

* UIProcess/WebInspectorProxy.h:
* UIProcess/efl/WebInspectorEfl.cpp:
(WebKit::WebInspectorProxy::inspectorBaseURL):
* UIProcess/gtk/WebInspectorGtk.cpp:
(WebKit::WebInspectorProxy::inspectorBaseURL):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectorBaseURL):
* UIProcess/qt/WebInspectorProxyQt.cpp:
(WebKit::WebInspectorProxy::inspectorBaseURL):
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::inspectorBaseURL):
Report what base directory Inspector has access to.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/efl/WebInspectorEfl.cpp
Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp
Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp
Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp

index 3e07c45..62d3844 100644 (file)
@@ -1,3 +1,34 @@
+2011-09-26  Alexey Proskuryakov  <ap@apple.com>
+
+        REGRESSION (r95747): Activating the web inspector causes the web process to be killed
+        https://bugs.webkit.org/show_bug.cgi?id=68762
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage):
+        Tell Web process that loading resources from WebCore resources directory is OK.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::loadHTMLString):
+        (WebKit::WebPageProxy::loadAlternateHTMLString):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::assumeReadAccessToBaseURL):
+        * UIProcess/WebProcessProxy.h:
+        Renamed willLoadHTMLStringWithBaseURL to more generic assumeReadAccessToBaseURL.
+
+        * UIProcess/WebInspectorProxy.h:
+        * UIProcess/efl/WebInspectorEfl.cpp:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+        * UIProcess/gtk/WebInspectorGtk.cpp:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+        * UIProcess/qt/WebInspectorProxyQt.cpp:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+        * UIProcess/win/WebInspectorProxyWin.cpp:
+        (WebKit::WebInspectorProxy::inspectorBaseURL):
+        Report what base directory Inspector has access to.
+
 2011-09-26  Nayan Kumar K  <nayankk@motorola.com>
 
         Added WKHitTestResult API's.
index a2fed2a..56887ef 100644 (file)
@@ -212,6 +212,7 @@ void WebInspectorProxy::createInspectorPage(uint64_t& inspectorPageID, WebPageCr
     String url = inspectorPageURL();
     if (shouldOpenAttached())
         url += "?docked=true";
+    m_page->process()->assumeReadAccessToBaseURL(inspectorBaseURL());
     inspectorPage->loadURL(url);
 }
 
index b9591b9..d62a53e 100644 (file)
@@ -125,6 +125,7 @@ private:
 
     // Implemented the platform WebInspectorProxy file
     String inspectorPageURL() const;
+    String inspectorBaseURL() const;
 
     // Called by WebInspectorProxy messages
     void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&);
index 7d8d4c2..1273bc9 100644 (file)
@@ -447,7 +447,7 @@ void WebPageProxy::loadHTMLString(const String& htmlString, const String& baseUR
     if (!isValid())
         reattachToWebProcess();
 
-    process()->willLoadHTMLStringWithBaseURL(baseURL);
+    process()->assumeReadAccessToBaseURL(baseURL);
     process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
     process()->responsivenessTimer()->start();
 }
@@ -460,7 +460,7 @@ void WebPageProxy::loadAlternateHTMLString(const String& htmlString, const Strin
     if (m_mainFrame)
         m_mainFrame->setUnreachableURL(unreachableURL);
 
-    process()->willLoadHTMLStringWithBaseURL(baseURL);
+    process()->assumeReadAccessToBaseURL(baseURL);
     process()->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL), m_pageID);
     process()->responsivenessTimer()->start();
 }
index 0085cf9..de89db4 100644 (file)
@@ -203,7 +203,7 @@ void WebProcessProxy::registerNewWebBackForwardListItem(WebBackForwardListItem*
     m_backForwardListItemMap.set(item->itemID(), item);
 }
 
-void WebProcessProxy::willLoadHTMLStringWithBaseURL(const String& urlString)
+void WebProcessProxy::assumeReadAccessToBaseURL(const String& urlString)
 {
     KURL url(KURL(), urlString);
     if (!url.isLocalFile())
index 2a5b075..426874e 100644 (file)
@@ -105,7 +105,7 @@ public:
     void registerNewWebBackForwardListItem(WebBackForwardListItem*);
 
     void willAcquireUniversalFileReadSandboxExtension() { m_mayHaveUniversalFileReadSandboxExtension = true; }
-    void willLoadHTMLStringWithBaseURL(const String&);
+    void assumeReadAccessToBaseURL(const String&);
 
     bool checkURLReceivedFromWebProcess(const String&);
     bool checkURLReceivedFromWebProcess(const WebCore::KURL&);
index 5fe2388..9e76967 100644 (file)
@@ -65,6 +65,12 @@ String WebInspectorProxy::inspectorPageURL() const
     return String();
 }
 
+String WebInspectorProxy::inspectorBaseURL() const
+{
+    notImplemented();
+    return String();
+}
+
 unsigned WebInspectorProxy::platformInspectedWindowHeight()
 {
     notImplemented();
index 7b64fe8..c4502c1 100644 (file)
@@ -66,6 +66,12 @@ String WebInspectorProxy::inspectorPageURL() const
     return String();
 }
 
+String WebInspectorProxy::inspectorBaseURL() const
+{
+    notImplemented();
+    return String();
+}
+
 unsigned WebInspectorProxy::platformInspectedWindowHeight()
 {
     notImplemented();
index 73917b1..d34b082 100644 (file)
@@ -254,6 +254,15 @@ String WebInspectorProxy::inspectorPageURL() const
     return [[NSURL fileURLWithPath:path] absoluteString];
 }
 
+String WebInspectorProxy::inspectorBaseURL() const
+{
+    // Web Inspector uses localized strings, so it's not contained within inspector directory.
+    NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebCore"] resourcePath];
+    ASSERT(path);
+
+    return [[NSURL fileURLWithPath:path] absoluteString];
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)
index 802a141..9738c20 100644 (file)
@@ -80,7 +80,7 @@ void WebInspectorProxy::platformSetAttachedWindowHeight(unsigned)
     notImplemented();
 }
 
-String WebInspectorProxy::inspectorPageURL() const
+String WebInspectorProxy::inspectorBaseURL() const
 {
     notImplemented();
     return String();
index d095cb0..f0c5334 100644 (file)
@@ -325,6 +325,16 @@ String WebInspectorProxy::inspectorPageURL() const
     return String(CFURLGetString(htmlURLRef.get()));
 }
 
+String WebInspectorProxy::inspectorBaseURL() const
+{
+    // Web Inspector uses localized strings, so it's not contained within inspector directory.
+    RetainPtr<CFURLRef> htmlURLRef(AdoptCF, CFBundleCopyResourcesDirectoryURL(webKitBundle()));
+    if (!htmlURLRef)
+        return String();
+
+    return String(CFURLGetString(htmlURLRef.get()));
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)