Source/WebCore: Web Inspector: Add the ability to show the resources panel on launch
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 01:05:58 +0000 (01:05 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Feb 2012 01:05:58 +0000 (01:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78641

Reviewed by Timothy Hatcher.

* WebCore.exp.in: Add a new function to be exported.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::showResources): Call showResources on load.
* inspector/InspectorFrontendClientLocal.h:
(InspectorFrontendClientLocal):
* inspector/front-end/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showResources): Show the resources panel.

Source/WebKit2: Web Inspector: Add the ability to show the resources panel on launch
https://bugs.webkit.org/show_bug.cgi?id=78641

Add WebKit2 API for the ability to show the resources panel. This calls down
from the WK API all the way to InspectorFrontendClientLocal::showResources.

Reviewed by Timothy Hatcher.

* UIProcess/API/C/WKInspector.cpp:
(WKInspectorShowResources): Call WebInspectorProxy::showResources.
* UIProcess/API/C/WKInspector.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::showResources): Send a message to the web process.
* UIProcess/WebInspectorProxy.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::showResources): Call InspectorFrontendClientLocal::showResources.
* WebProcess/WebPage/WebInspector.h:
* WebProcess/WebPage/WebInspector.messages.in: Add a ShowResources message.

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.h
Source/WebCore/inspector/front-end/InspectorFrontendAPI.js
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKInspector.cpp
Source/WebKit2/UIProcess/API/C/WKInspector.h
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebInspectorProxy.h
Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
Source/WebKit2/WebProcess/WebPage/WebInspector.h
Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in

index 9386c03..9543271 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-14  Brian Weinstein  <bweinstein@apple.com>
+
+        Web Inspector: Add the ability to show the resources panel on launch
+        https://bugs.webkit.org/show_bug.cgi?id=78641
+
+        Reviewed by Timothy Hatcher.
+
+        * WebCore.exp.in: Add a new function to be exported.
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::showResources): Call showResources on load.
+        * inspector/InspectorFrontendClientLocal.h:
+        (InspectorFrontendClientLocal):
+        * inspector/front-end/InspectorFrontendAPI.js:
+        (InspectorFrontendAPI.showResources): Show the resources panel.
+
 2012-02-14  Enrica Casucci  <enrica@apple.com>
 
         REGRESSION (r107568-r107627): Crash when copying in WebCore::SharedBuffer::hasPlatformData().
index da3e784..30d03a5 100644 (file)
@@ -1707,6 +1707,7 @@ __ZN7WebCore19InspectorController5closeEv
 __ZN7WebCore28InspectorFrontendClientLocal11showConsoleEv
 __ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff
 __ZN7WebCore28InspectorFrontendClientLocal12openInNewTabERKN3WTF6StringE
+__ZN7WebCore28InspectorFrontendClientLocal13showResourcesEv
 __ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv
 __ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
 __ZN7WebCore28InspectorFrontendClientLocal17setAttachedWindowEb
index 581965f..9841e20 100644 (file)
@@ -266,6 +266,11 @@ void InspectorFrontendClientLocal::showConsole()
     evaluateOnLoad("[\"showConsole\"]");
 }
 
+void InspectorFrontendClientLocal::showResources()
+{
+    evaluateOnLoad("[\"showResources\"]");
+}
+
 void InspectorFrontendClientLocal::showMainResourceForFrame(Frame* frame)
 {
     String frameId = m_inspectorController->pageAgent()->frameId(frame);
index 5079fec..8292d22 100644 (file)
@@ -94,6 +94,8 @@ public:
     void showConsole();
 
     void showMainResourceForFrame(Frame*);
+    
+    void showResources();
 
 protected:
     virtual void setAttachedWindowHeight(unsigned) = 0;
index e249b07..828c540 100644 (file)
@@ -90,6 +90,11 @@ InspectorFrontendAPI = {
         // FIXME: Implement this to show the source code for the main resource of a given frame.
     },
 
+    showResources: function()
+    {
+        WebInspector.inspectorView.setCurrentPanel(WebInspector.panels.resources);
+    },
+
     dispatch: function(signature)
     {
         if (WebInspector.panels) {
index 4d73437..9d0200a 100644 (file)
@@ -1,3 +1,24 @@
+2012-02-14  Brian Weinstein  <bweinstein@apple.com>
+
+        Web Inspector: Add the ability to show the resources panel on launch
+        https://bugs.webkit.org/show_bug.cgi?id=78641
+        
+        Add WebKit2 API for the ability to show the resources panel. This calls down
+        from the WK API all the way to InspectorFrontendClientLocal::showResources.
+
+        Reviewed by Timothy Hatcher.
+
+        * UIProcess/API/C/WKInspector.cpp:
+        (WKInspectorShowResources): Call WebInspectorProxy::showResources.
+        * UIProcess/API/C/WKInspector.h:
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::showResources): Send a message to the web process.
+        * UIProcess/WebInspectorProxy.h:
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::showResources): Call InspectorFrontendClientLocal::showResources.
+        * WebProcess/WebPage/WebInspector.h:
+        * WebProcess/WebPage/WebInspector.messages.in: Add a ShowResources message.
+
 2012-02-14  Matt Lilek  <mrl@apple.com>
 
         Don't ENABLE_DASHBOARD_SUPPORT unconditionally on all Mac platforms
index 0a1b175..1a4ecc7 100644 (file)
@@ -63,6 +63,11 @@ void WKInspectorShowConsole(WKInspectorRef inspectorRef)
     toImpl(inspectorRef)->showConsole();
 }
 
+void WKInspectorShowResources(WKInspectorRef inspectorRef)
+{
+    toImpl(inspectorRef)->showResources();
+}
+
 void WKInspectorShowMainResourceForFrame(WKInspectorRef inspectorRef, WKFrameRef frameRef)
 {
     toImpl(inspectorRef)->showMainResourceForFrame(toImpl(frameRef));
index c62b5d7..2e85688 100644 (file)
@@ -47,6 +47,7 @@ WK_EXPORT void WKInspectorShow(WKInspectorRef inspector);
 WK_EXPORT void WKInspectorClose(WKInspectorRef inspector);
 
 WK_EXPORT void WKInspectorShowConsole(WKInspectorRef inspector);
+WK_EXPORT void WKInspectorShowResources(WKInspectorRef inspector);
 WK_EXPORT void WKInspectorShowMainResourceForFrame(WKInspectorRef inspector, WKFrameRef frame);
 
 WK_EXPORT bool WKInspectorIsAttached(WKInspectorRef inspector);
index da55b9e..9f8941d 100644 (file)
@@ -124,6 +124,14 @@ void WebInspectorProxy::showConsole()
     m_page->process()->send(Messages::WebInspector::ShowConsole(), m_page->pageID());
 }
 
+void WebInspectorProxy::showResources()
+{
+    if (!m_page)
+        return;
+
+    m_page->process()->send(Messages::WebInspector::ShowResources(), m_page->pageID());
+}
+
 void WebInspectorProxy::showMainResourceForFrame(WebFrameProxy* frame)
 {
     if (!m_page)
index 9575cab..aebb6f9 100644 (file)
@@ -92,6 +92,7 @@ public:
 #endif
 
     void showConsole();
+    void showResources();
     void showMainResourceForFrame(WebFrameProxy*);
 
     bool isAttached() const { return m_isAttached; }
index c5d4151..5a42d11 100644 (file)
@@ -140,6 +140,13 @@ void WebInspector::showConsole()
         m_frontendClient->showConsole();
 }
 
+void WebInspector::showResources()
+{
+    m_page->corePage()->inspectorController()->show();
+    if (m_frontendClient)
+        m_frontendClient->showResources();
+}
+
 void WebInspector::showMainResourceForFrame(uint64_t frameID)
 {
     WebFrame* frame = WebProcess::shared().webFrame(frameID);
index 447cde3..221b976 100644 (file)
@@ -92,6 +92,8 @@ private:
 
     void showConsole();
 
+    void showResources();
+
     void showMainResourceForFrame(uint64_t frameID);
 
     void startJavaScriptDebugging();
index b33b4c5..a1a80f0 100644 (file)
@@ -26,6 +26,7 @@ messages -> WebInspector {
     Show()
     Close()
     ShowConsole()
+    ShowResources()
     ShowMainResourceForFrame(uint64_t frameID)
     StartJavaScriptDebugging()
     StopJavaScriptDebugging()