Title: [92943] branches/safari-534.51-branch/Source
Revision
92943
Author
[email protected]
Date
2011-08-11 23:25:39 -0700 (Thu, 11 Aug 2011)

Log Message

Merge r92384.

Modified Paths

Diff

Modified: branches/safari-534.51-branch/Source/WebCore/ChangeLog (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/ChangeLog	2011-08-12 06:25:39 UTC (rev 92943)
@@ -1,5 +1,28 @@
 2011-08-11  Lucas Forschler  <[email protected]>
 
+    Merged 92384
+
+    2011-08-01  Brian Weinstein  <[email protected]>
+
+            WebKit2: Web Inspector always starts in undocked mode
+            https://bugs.webkit.org/show_bug.cgi?id=65493
+            <rdar://problem/9353114>
+
+            Reviewed by Adam Roben.
+
+            Expose some methods on InspectorFrontendClient through the InspectorController so WebKit2
+            can request the inspector be docked, or ask whether or not it can be docked.
+
+            * WebCore.exp.in: Export needed methods.
+            * inspector/InspectorController.cpp:
+            (WebCore::InspectorController::requestAttachWindow): Call through to InspectorFrontendClient.
+            (WebCore::InspectorController::canAttachWindow): Ditto.
+            * inspector/InspectorController.h:
+            * inspector/InspectorFrontendClient.h:
+            * inspector/InspectorFrontendClientLocal.h:
+
+2011-08-11  Lucas Forschler  <[email protected]>
+
     Merged 92231
 
     2011-08-01  Michael Saboff  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebCore/WebCore.exp.in (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/WebCore.exp.in	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/WebCore.exp.in	2011-08-12 06:25:39 UTC (rev 92943)
@@ -1549,11 +1549,13 @@
 #if ENABLE(INSPECTOR)
 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE
 __ZN7WebCore19InspectorController14enableProfilerEv
+__ZN7WebCore19InspectorController15canAttachWindowEv
 __ZN7WebCore19InspectorController15debuggerEnabledEv
 __ZN7WebCore19InspectorController15disableDebuggerEv
 __ZN7WebCore19InspectorController15disableProfilerEv
 __ZN7WebCore19InspectorController15profilerEnabledEv
 __ZN7WebCore19InspectorController18disconnectFrontendEv
+__ZN7WebCore19InspectorController19requestAttachWindowEv
 __ZN7WebCore19InspectorController20stopTimelineProfilerEv
 __ZN7WebCore19InspectorController21showAndEnableDebuggerEv
 __ZN7WebCore19InspectorController11showConsoleEv

Modified: branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -480,6 +480,22 @@
 
 #endif
 
+void InspectorController::requestAttachWindow()
+{
+    if (!m_inspectorFrontendClient)
+        return;
+
+    m_inspectorFrontendClient->requestAttachWindow();
+}
+    
+bool InspectorController::canAttachWindow()
+{
+    if (!m_inspectorFrontendClient)
+        return false;
+    
+    return m_inspectorFrontendClient->canAttachWindow();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)

Modified: branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/inspector/InspectorController.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -119,6 +119,11 @@
     void resume();
 #endif
 
+    void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
+    
+    void requestAttachWindow();
+    bool canAttachWindow();
+
 private:
     friend class PostWorkerNotificationToFrontendTask;
 

Modified: branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClient.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClient.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClient.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -58,6 +58,7 @@
     virtual void requestAttachWindow() = 0;
     virtual void requestDetachWindow() = 0;
     virtual void changeAttachedWindowHeight(unsigned) = 0;
+    virtual bool canAttachWindow() = 0;
     virtual void saveAs(const WTF::String& fileName, const WTF::String& content) = 0;
 
     virtual void inspectedURLChanged(const String&) = 0;

Modified: branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClientLocal.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebCore/inspector/InspectorFrontendClientLocal.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -64,11 +64,11 @@
     virtual void requestAttachWindow();
     virtual void requestDetachWindow();
     virtual void changeAttachedWindowHeight(unsigned);
+    virtual bool canAttachWindow();
     virtual void saveAs(const String&, const String&) { }
 
     virtual void attachWindow() = 0;
     virtual void detachWindow() = 0;
-    bool canAttachWindow();
 
     virtual void sendMessageToBackend(const String& message);
 

Modified: branches/safari-534.51-branch/Source/WebKit/chromium/ChangeLog (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit/chromium/ChangeLog	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit/chromium/ChangeLog	2011-08-12 06:25:39 UTC (rev 92943)
@@ -1,5 +1,23 @@
 2011-08-11  Lucas Forschler  <[email protected]>
 
+    Merged 92384
+
+    2011-08-04  Brian Weinstein  <[email protected]>
+
+            WebKit2: Web Inspector always starts in undocked mode
+            https://bugs.webkit.org/show_bug.cgi?id=65493
+            <rdar://problem/9353114>
+
+            Reviewed by Adam Roben.
+
+            Add a stub method for Chromium.
+
+            * src/InspectorFrontendClientImpl.cpp:
+            (WebKit::InspectorFrontendClientImpl::canAttachWindow):
+            * src/InspectorFrontendClientImpl.h:
+
+2011-08-11  Lucas Forschler  <[email protected]>
+
     Merged 91097
 
     2011-07-15  Dan Bernstein  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -124,6 +124,12 @@
 {
     // Do nothing;
 }
+
+bool InspectorFrontendClientImpl::canAttachWindow()
+{
+    // FIXME: Implement this if it is ever called by Chromium.
+    return false;
+}
     
 void InspectorFrontendClientImpl::saveAs(const String& fileName, const String& content)
 {

Modified: branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -66,6 +66,7 @@
     virtual void requestAttachWindow();
     virtual void requestDetachWindow();
     virtual void changeAttachedWindowHeight(unsigned);
+    virtual bool canAttachWindow();
     virtual void saveAs(const WTF::String& fileName, const WTF::String& content);
 
     virtual void inspectedURLChanged(const WTF::String&);

Modified: branches/safari-534.51-branch/Source/WebKit2/ChangeLog (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/ChangeLog	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/ChangeLog	2011-08-12 06:25:39 UTC (rev 92943)
@@ -1,5 +1,51 @@
 2011-08-11  Lucas Forschler  <[email protected]>
 
+    Merged 92384
+
+    2011-08-01  Brian Weinstein  <[email protected]>
+
+            WebKit2: Web Inspector always starts in undocked mode
+            https://bugs.webkit.org/show_bug.cgi?id=65493
+            <rdar://problem/9353114>
+
+            Reviewed by Adam Roben.
+
+            When opening the inspector, the web process tells the UI process that the inspector page has loaded,
+            but now will pass another bit of data, whether the inspector can start attached, so the UI process
+            doesn't need to ask the web process to do another calculation on whether or not it can be attached.
+
+            If the user prefers the inspector to start docked (this defaults to true), and there is room for the
+            window, we send a message to the web process to try and attach the inspector. This makes sure that the
+            inspector knows it is docked (in the web process).
+
+            * UIProcess/WebInspectorProxy.cpp:
+            (WebKit::WebInspectorProxy::attach): Update the user's docked/undocked preference if the inspector is visible
+                when it was attached.
+            (WebKit::WebInspectorProxy::detach): Ditto (but when it was detached).
+            (WebKit::WebInspectorProxy::didLoadInspectorPage): If we can start docked, and the user prefers to start docked,
+                then request the inspector be attached to the window.
+            * UIProcess/WebInspectorProxy.h:
+
+            * UIProcess/mac/WebInspectorProxyMac.mm:
+            (WebKit::WebInspectorProxy::platformOpen): Only show the window if we are going to start undocked.
+            * UIProcess/win/WebInspectorProxyWin.cpp:
+            (WebKit::WebInspectorProxy::platformOpen): Ditto.
+
+            * WebProcess/WebPage/WebInspector.cpp:
+            (WebKit::WebInspector::didLoadInspectorPage): Pass whether or not we can attach the window.
+            (WebKit::WebInspector::requestAttachWindow): Call through to the InspectorController to attach the inspector.
+            (WebKit::WebInspector::canAttachWindow): Ask the InspectorController if we can attach the inspector.
+            * WebProcess/WebPage/WebInspector.h:
+
+            * Shared/WebPreferencesStore.h: Add a new preference for whether or not the inspector should
+                start attached.
+
+            * UIProcess/WebInspectorProxy.messages.in: When the inspector page is loaded, tell the UI Process whether
+                we can attach the inspector without needing another message.
+            * WebProcess/WebPage/WebInspector.messages.in: Add a new message for RequestAttachWindow
+
+2011-08-11  Lucas Forschler  <[email protected]>
+
     Merged 92231
 
     2011-08-01  Michael Saboff  <[email protected]>

Modified: branches/safari-534.51-branch/Source/WebKit2/Shared/WebPreferencesStore.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/Shared/WebPreferencesStore.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/Shared/WebPreferencesStore.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -81,6 +81,7 @@
     macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \
     macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \
     macro(AVFoundationEnabled, isAVFoundationEnabled, Bool, bool, DEFAULT_WEBKIT_AVFOUNDATION_ENABLED) \
+    macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -121,6 +121,9 @@
 void WebInspectorProxy::attach()
 {
     m_isAttached = true;
+    
+    if (m_isVisible)
+        inspectorPageGroup()->preferences()->setInspectorStartsAttached(true);
 
     platformAttach();
 }
@@ -128,6 +131,9 @@
 void WebInspectorProxy::detach()
 {
     m_isAttached = false;
+    
+    if (m_isVisible)
+        inspectorPageGroup()->preferences()->setInspectorStartsAttached(false);
 
     platformDetach();
 }
@@ -203,11 +209,15 @@
     inspectorPage->loadURL(inspectorPageURL());
 }
 
-void WebInspectorProxy::didLoadInspectorPage()
+void WebInspectorProxy::didLoadInspectorPage(bool canStartAttached)
 {
     m_isVisible = true;
 
-    platformOpen();
+    bool willOpenAttached = canStartAttached && inspectorPageGroup()->preferences()->inspectorStartsAttached();
+    platformOpen(willOpenAttached);
+    
+    if (willOpenAttached)
+        m_page->process()->send(Messages::WebInspector::RequestAttachWindow(), m_page->pageID());
 }
 
 void WebInspectorProxy::didClose()

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -114,7 +114,7 @@
     virtual Type type() const { return APIType; }
 
     WebPageProxy* platformCreateInspectorPage();
-    void platformOpen();
+    void platformOpen(bool willOpenAttached);
     void platformDidClose();
     void platformBringToFront();
     void platformInspectedURLChanged(const String&);
@@ -127,7 +127,7 @@
 
     // Called by WebInspectorProxy messages
     void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&);
-    void didLoadInspectorPage();
+    void didLoadInspectorPage(bool canStartAttached);
     void didClose();
     void bringToFront();
     void inspectedURLChanged(const String&);

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in	2011-08-12 06:25:39 UTC (rev 92943)
@@ -24,7 +24,7 @@
 
 messages -> WebInspectorProxy {
     CreateInspectorPage() -> (uint64_t inspectorPageID, WebKit::WebPageCreationParameters inspectorPageParameters)
-    DidLoadInspectorPage()
+    DidLoadInspectorPage(bool canStartAttached)
     DidClose()
     BringToFront()
     InspectedURLChanged(WTF::String urlString)

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-08-12 06:25:39 UTC (rev 92943)
@@ -109,14 +109,12 @@
     return toImpl(m_inspectorView.get().pageRef);
 }
 
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool willOpenAttached)
 {
     ASSERT(!m_inspectorWindow);
 
     m_inspectorProxyObjCAdapter.adoptNS([[WebInspectorProxyObjCAdapter alloc] initWithWebInspectorProxy:this]);
 
-    // FIXME: support opening in docked mode here.
-
     NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSTexturedBackgroundWindowMask);
     NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, initialWindowWidth, initialWindowHeight) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
     [window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
@@ -137,7 +135,8 @@
     [m_inspectorView.get() setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
     [contentView addSubview:m_inspectorView.get()];
 
-    [window makeKeyAndOrderFront:nil];
+    if (!willOpenAttached)
+        [window makeKeyAndOrderFront:nil];
 
     m_inspectorWindow.adoptNS(window);
 }

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -39,7 +39,7 @@
     return 0;
 }
 
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool)
 {
     notImplemented();
 }

Modified: branches/safari-534.51-branch/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -198,7 +198,7 @@
     return m_inspectorView->page();
 }
 
-void WebInspectorProxy::platformOpen()
+void WebInspectorProxy::platformOpen(bool willOpenAttached)
 {
     registerInspectorViewWindowClass();
 
@@ -207,7 +207,9 @@
     ASSERT(::IsWindow(m_inspectorWindow));
 
     m_inspectorView->setParentWindow(m_inspectorWindow);
-    ::ShowWindow(m_inspectorWindow, SW_SHOW);
+
+    if (!willOpenAttached)
+        ::ShowWindow(m_inspectorWindow, SW_SHOW);
 }
 
 void WebInspectorProxy::platformDidClose()

Modified: branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2011-08-12 06:25:39 UTC (rev 92943)
@@ -78,7 +78,7 @@
 // Called from WebInspectorFrontendClient
 void WebInspector::didLoadInspectorPage()
 {
-    WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(), m_page->pageID());
+    WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(canAttachWindow()), m_page->pageID());
 }
 
 void WebInspector::didClose()
@@ -171,6 +171,16 @@
     // FIXME: show the Timeline panel.
 }
 
+void WebInspector::requestAttachWindow()
+{
+    m_inspectorPage->corePage()->inspectorController()->requestAttachWindow();
+}
+
+bool WebInspector::canAttachWindow() const
+{
+    return m_inspectorPage->corePage()->inspectorController()->canAttachWindow();
+}
+
 } // namespace WebKit
 
 #endif // ENABLE(INSPECTOR)

Modified: branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.h (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.h	2011-08-12 06:25:39 UTC (rev 92943)
@@ -58,6 +58,9 @@
 
     void startPageProfiling();
     void stopPageProfiling();
+    
+    bool canAttachWindow() const;
+    void requestAttachWindow();
 
 private:
     friend class WebInspectorClient;

Modified: branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in (92942 => 92943)


--- branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2011-08-12 06:21:40 UTC (rev 92942)
+++ branches/safari-534.51-branch/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in	2011-08-12 06:25:39 UTC (rev 92943)
@@ -32,6 +32,8 @@
     StopJavaScriptProfiling()
     StartPageProfiling()
     StopPageProfiling()
+
+    RequestAttachWindow()
 }
 
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to