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
+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.
String url = inspectorPageURL();
if (shouldOpenAttached())
url += "?docked=true";
+ m_page->process()->assumeReadAccessToBaseURL(inspectorBaseURL());
inspectorPage->loadURL(url);
}
// Implemented the platform WebInspectorProxy file
String inspectorPageURL() const;
+ String inspectorBaseURL() const;
// Called by WebInspectorProxy messages
void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&);
if (!isValid())
reattachToWebProcess();
- process()->willLoadHTMLStringWithBaseURL(baseURL);
+ process()->assumeReadAccessToBaseURL(baseURL);
process()->send(Messages::WebPage::LoadHTMLString(htmlString, baseURL), m_pageID);
process()->responsivenessTimer()->start();
}
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();
}
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())
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&);
return String();
}
+String WebInspectorProxy::inspectorBaseURL() const
+{
+ notImplemented();
+ return String();
+}
+
unsigned WebInspectorProxy::platformInspectedWindowHeight()
{
notImplemented();
return String();
}
+String WebInspectorProxy::inspectorBaseURL() const
+{
+ notImplemented();
+ return String();
+}
+
unsigned WebInspectorProxy::platformInspectedWindowHeight()
{
notImplemented();
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)
notImplemented();
}
-String WebInspectorProxy::inspectorPageURL() const
+String WebInspectorProxy::inspectorBaseURL() const
{
notImplemented();
return String();
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)