Changeset 92587 in webkit
- Timestamp:
- Aug 8, 2011 1:12:36 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92585 r92587 1 2011-08-05 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: implement dock/undock in WebKit2 without getting into WebCore. 4 https://bugs.webkit.org/show_bug.cgi?id=65763 5 6 InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value 7 since in the multiprocess environment, you can't immediately get back to it from the host. 8 9 r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder 10 was asking itself a question. This loop was fixed. 11 12 Reviewed by Yury Semikhatsky. 13 14 * WebCore.exp.in: 15 * inspector/InspectorController.cpp: 16 * inspector/InspectorController.h: 17 * inspector/InspectorFrontendClient.h: 18 * inspector/InspectorFrontendClientLocal.h: 19 * inspector/front-end/inspector.js: 20 (windowLoaded): 21 1 22 2011-07-28 Kent Tamura <tkent@chromium.org> 2 23 -
trunk/Source/WebCore/WebCore.exp.in
r92533 r92587 1583 1583 __ZN7WebCore15InspectorClient31doDispatchMessageOnFrontendPageEPNS_4PageERKN3WTF6StringE 1584 1584 __ZN7WebCore19InspectorController14enableProfilerEv 1585 __ZN7WebCore19InspectorController15canAttachWindowEv1586 1585 __ZN7WebCore19InspectorController15debuggerEnabledEv 1587 1586 __ZN7WebCore19InspectorController15disableDebuggerEv … … 1589 1588 __ZN7WebCore19InspectorController15profilerEnabledEv 1590 1589 __ZN7WebCore19InspectorController18disconnectFrontendEv 1591 __ZN7WebCore19InspectorController19requestAttachWindowEv1592 1590 __ZN7WebCore19InspectorController20stopTimelineProfilerEv 1593 1591 __ZN7WebCore19InspectorController21showAndEnableDebuggerEv -
trunk/Source/WebCore/inspector/InspectorController.cpp
r92384 r92587 510 510 } 511 511 512 void InspectorController::requestAttachWindow()513 {514 if (!m_inspectorFrontendClient)515 return;516 517 m_inspectorFrontendClient->requestAttachWindow();518 }519 520 bool InspectorController::canAttachWindow()521 {522 if (!m_inspectorFrontendClient)523 return false;524 525 return m_inspectorFrontendClient->canAttachWindow();526 }527 528 512 } // namespace WebCore 529 513 -
trunk/Source/WebCore/inspector/InspectorController.h
r92384 r92587 122 122 123 123 void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize); 124 125 void requestAttachWindow();126 bool canAttachWindow();127 124 128 125 private: -
trunk/Source/WebCore/inspector/InspectorFrontendClient.h
r92384 r92587 59 59 virtual void requestDetachWindow() = 0; 60 60 virtual void changeAttachedWindowHeight(unsigned) = 0; 61 virtual bool canAttachWindow() = 0;62 61 virtual void saveAs(const WTF::String& fileName, const WTF::String& content) = 0; 63 62 -
trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.h
r92384 r92587 65 65 virtual void requestDetachWindow(); 66 66 virtual void changeAttachedWindowHeight(unsigned); 67 virtual bool canAttachWindow();68 67 virtual void saveAs(const String&, const String&) { } 69 68 … … 72 71 73 72 virtual void sendMessageToBackend(const String& message); 73 74 bool canAttachWindow(); 74 75 75 76 static unsigned constrainedAttachedWindowHeight(unsigned preferredHeight, unsigned totalWindowHeight); -
trunk/Source/WebCore/inspector/front-end/inspector.js
r92284 r92587 592 592 } else 593 593 WebInspector.loaded(); 594 595 WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true"); 594 596 595 597 window.removeEventListener("DOMContentLoaded", windowLoaded, false); -
trunk/Source/WebKit/chromium/ChangeLog
r92576 r92587 1 2011-08-05 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: implement dock/undock in WebKit2 without getting into WebCore. 4 https://bugs.webkit.org/show_bug.cgi?id=65763 5 6 Reviewed by Yury Semikhatsky. 7 8 * src/InspectorFrontendClientImpl.cpp: 9 * src/InspectorFrontendClientImpl.h: 10 * src/js/DevTools.js: 11 (devtools.domContentLoaded): 12 1 13 2011-08-07 James Kozianski <koz@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
r92384 r92587 126 126 } 127 127 128 bool InspectorFrontendClientImpl::canAttachWindow()129 {130 // FIXME: Implement this if it is ever called by Chromium.131 return false;132 }133 134 128 void InspectorFrontendClientImpl::saveAs(const String& fileName, const String& content) 135 129 { -
trunk/Source/WebKit/chromium/src/InspectorFrontendClientImpl.h
r92384 r92587 67 67 virtual void requestDetachWindow(); 68 68 virtual void changeAttachedWindowHeight(unsigned); 69 virtual bool canAttachWindow();70 69 virtual void saveAs(const WTF::String& fileName, const WTF::String& content); 71 70 -
trunk/Source/WebKit/chromium/src/js/DevTools.js
r92213 r92587 66 66 devtools.domContentLoaded = function() 67 67 { 68 WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true");69 68 if (WebInspector.queryParamsObject.toolbarColor && WebInspector.queryParamsObject.textColor) 70 69 WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbarColor, WebInspector.queryParamsObject.textColor); -
trunk/Source/WebKit2/ChangeLog
r92574 r92587 1 2011-08-05 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: implement dock/undock in WebKit2 without getting into WebCore. 4 https://bugs.webkit.org/show_bug.cgi?id=65763 5 6 InspectorFrontendClient.h can't have synchronous canAttachWindow() returning value 7 since in the multiprocess environment, you can't immediately get back to it from the host. 8 9 r92384 introduced an unhealthy WebKit -> WebCore -> WebKit canAttach query where embedder 10 was asking itself a question. This loop was fixed. 11 12 Reviewed by Yury Semikhatsky. 13 14 * UIProcess/WebInspectorProxy.cpp: 15 (WebKit::WebInspectorProxy::attach): 16 (WebKit::WebInspectorProxy::createInspectorPage): 17 (WebKit::WebInspectorProxy::didLoadInspectorPage): 18 (WebKit::WebInspectorProxy::shouldOpenAttached): 19 * UIProcess/WebInspectorProxy.h: 20 * UIProcess/WebInspectorProxy.messages.in: 21 * UIProcess/efl/WebInspectorEfl.cpp: 22 (WebKit::WebInspectorProxy::platformInspectedWindowHeight): 23 * UIProcess/gtk/WebInspectorGtk.cpp: 24 (WebKit::WebInspectorProxy::platformInspectedWindowHeight): 25 * UIProcess/mac/WebInspectorProxyMac.mm: 26 (WebKit::WebInspectorProxy::platformOpen): 27 (WebKit::WebInspectorProxy::platformInspectedWindowHeight): 28 * UIProcess/qt/WebInspectorProxyQt.cpp: 29 (WebKit::WebInspectorProxy::platformOpen): 30 (WebKit::WebInspectorProxy::platformInspectedWindowHeight): 31 * UIProcess/win/WebInspectorProxyWin.cpp: 32 (WebKit::WebInspectorProxy::platformOpen): 33 (WebKit::WebInspectorProxy::platformInspectedWindowHeight): 34 * WebProcess/WebPage/WebInspector.cpp: 35 (WebKit::WebInspector::didLoadInspectorPage): 36 * WebProcess/WebPage/WebInspector.h: 37 * WebProcess/WebPage/WebInspector.messages.in: 38 1 39 2011-08-07 Joseph Pecoraro <joepeck@webkit.org> 2 40 -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
r92384 r92587 121 121 void WebInspectorProxy::attach() 122 122 { 123 if (!canAttach()) 124 return; 125 123 126 m_isAttached = true; 124 127 125 128 if (m_isVisible) 126 129 inspectorPageGroup()->preferences()->setInspectorStartsAttached(true); … … 207 210 inspectorPageParameters = inspectorPage->creationParameters(); 208 211 209 inspectorPage->loadURL(inspectorPageURL()); 210 } 211 212 void WebInspectorProxy::didLoadInspectorPage(bool canStartAttached) 212 String url = inspectorPageURL(); 213 if (shouldOpenAttached()) 214 url += "?docked=true"; 215 inspectorPage->loadURL(url); 216 } 217 218 void WebInspectorProxy::didLoadInspectorPage() 213 219 { 214 220 m_isVisible = true; 215 216 bool willOpenAttached = canStartAttached && inspectorPageGroup()->preferences()->inspectorStartsAttached(); 217 platformOpen(willOpenAttached); 218 219 if (willOpenAttached) 220 m_page->process()->send(Messages::WebInspector::RequestAttachWindow(), m_page->pageID()); 221 m_isAttached = shouldOpenAttached(); 222 223 // platformOpen is responsible for rendering attached mode depending on m_isAttached. 224 platformOpen(); 221 225 } 222 226 … … 244 248 } 245 249 250 bool WebInspectorProxy::canAttach() 251 { 252 unsigned inspectedWindowHeight = platformInspectedWindowHeight(); 253 return inspectedWindowHeight && minimumAttachedHeight <= (inspectedWindowHeight * 3 / 4); 254 } 255 256 bool WebInspectorProxy::shouldOpenAttached() 257 { 258 return inspectorPageGroup()->preferences()->inspectorStartsAttached() && canAttach(); 259 } 260 246 261 } // namespace WebKit 247 262 -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.h
r92384 r92587 115 115 116 116 WebPageProxy* platformCreateInspectorPage(); 117 void platformOpen( bool willOpenAttached);117 void platformOpen(); 118 118 void platformDidClose(); 119 119 void platformBringToFront(); 120 120 void platformInspectedURLChanged(const String&); 121 unsigned platformInspectedWindowHeight(); 121 122 void platformAttach(); 122 123 void platformDetach(); … … 128 129 // Called by WebInspectorProxy messages 129 130 void createInspectorPage(uint64_t& inspectorPageID, WebPageCreationParameters&); 130 void didLoadInspectorPage( bool canStartAttached);131 void didLoadInspectorPage(); 131 132 void didClose(); 132 133 void bringToFront(); 133 134 void inspectedURLChanged(const String&); 135 136 bool canAttach(); 137 bool shouldOpenAttached(); 134 138 135 139 static WebPageGroup* inspectorPageGroup(); … … 154 158 static const unsigned initialWindowWidth = 750; 155 159 static const unsigned initialWindowHeight = 650; 160 static const unsigned minimumAttachedHeight = 250; 156 161 157 162 WebPageProxy* m_page; -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.messages.in
r92384 r92587 25 25 messages -> WebInspectorProxy { 26 26 CreateInspectorPage() -> (uint64_t inspectorPageID, WebKit::WebPageCreationParameters inspectorPageParameters) 27 DidLoadInspectorPage( bool canStartAttached)27 DidLoadInspectorPage() 28 28 DidClose() 29 29 BringToFront() 30 30 InspectedURLChanged(WTF::String urlString) 31 31 32 32 Attach() 33 33 Detach() -
trunk/Source/WebKit2/UIProcess/efl/WebInspectorEfl.cpp
r88707 r92587 66 66 } 67 67 68 unsigned WebInspectorProxy::platformInspectedWindowHeight() 69 { 70 notImplemented(); 71 return 0; 72 } 73 68 74 void WebInspectorProxy::platformAttach() 69 75 { -
trunk/Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp
r85457 r92587 67 67 } 68 68 69 unsigned WebInspectorProxy::platformInspectedWindowHeight() 70 { 71 notImplemented(); 72 return 0; 73 } 74 69 75 void WebInspectorProxy::platformAttach() 70 76 { -
trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm
r92384 r92587 110 110 } 111 111 112 void WebInspectorProxy::platformOpen( bool willOpenAttached)112 void WebInspectorProxy::platformOpen() 113 113 { 114 114 ASSERT(!m_inspectorWindow); … … 136 136 [contentView addSubview:m_inspectorView.get()]; 137 137 138 if (!willOpenAttached) 138 m_inspectorWindow.adoptNS(window); 139 140 if (m_isAttached) 141 platformAttach(); 142 else 139 143 [window makeKeyAndOrderFront:nil]; 140 141 m_inspectorWindow.adoptNS(window);142 144 } 143 145 … … 184 186 } 185 187 188 unsigned WebInspectorProxy::platformInspectedWindowHeight() 189 { 190 WKView *inspectedView = m_page->wkView(); 191 NSRect inspectedViewRect = [inspectedView frame]; 192 return static_cast<unsigned>(inspectedViewRect.size.height); 193 } 194 186 195 void WebInspectorProxy::platformAttach() 187 196 { -
trunk/Source/WebKit2/UIProcess/qt/WebInspectorProxyQt.cpp
r92384 r92587 40 40 } 41 41 42 void WebInspectorProxy::platformOpen( bool)42 void WebInspectorProxy::platformOpen() 43 43 { 44 44 notImplemented(); … … 58 58 { 59 59 notImplemented(); 60 } 61 62 unsigned WebInspectorProxy::platformInspectedWindowHeight() 63 { 64 notImplemented(); 65 return 0; 60 66 } 61 67 -
trunk/Source/WebKit2/UIProcess/win/WebInspectorProxyWin.cpp
r92384 r92587 199 199 } 200 200 201 void WebInspectorProxy::platformOpen( bool willOpenAttached)201 void WebInspectorProxy::platformOpen() 202 202 { 203 203 registerInspectorViewWindowClass(); … … 209 209 m_inspectorView->setParentWindow(m_inspectorWindow); 210 210 211 if (!willOpenAttached) 211 if (m_isAttached) 212 platformAttach(); 213 else 212 214 ::ShowWindow(m_inspectorWindow, SW_SHOW); 213 215 } … … 246 248 } 247 249 250 unsigned WebInspectorProxy::platformInspectedWindowHeight() 251 { 252 HWND inspectedWindow = m_page->nativeWindow(); 253 254 RECT inspectedWindowRect; 255 ::GetWindowRect(inspectedWindow, &inspectedWindowRect); 256 257 return static_cast<unsigned>(inspectedWindowRect.bottom - inspectedWindowRect.top); 258 } 259 248 260 void WebInspectorProxy::platformAttach() 249 261 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp
r92384 r92587 79 79 void WebInspector::didLoadInspectorPage() 80 80 { 81 WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage( canAttachWindow()), m_page->pageID());81 WebProcess::shared().connection()->send(Messages::WebInspectorProxy::DidLoadInspectorPage(), m_page->pageID()); 82 82 } 83 83 … … 182 182 } 183 183 184 void WebInspector::requestAttachWindow()185 {186 m_inspectorPage->corePage()->inspectorController()->requestAttachWindow();187 }188 189 bool WebInspector::canAttachWindow() const190 {191 return m_inspectorPage->corePage()->inspectorController()->canAttachWindow();192 }193 194 184 } // namespace WebKit 195 185 -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.h
r92384 r92587 60 60 void startPageProfiling(); 61 61 void stopPageProfiling(); 62 63 bool canAttachWindow() const;64 void requestAttachWindow();65 62 66 63 private: -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.messages.in
r92384 r92587 33 33 StartPageProfiling() 34 34 StopPageProfiling() 35 36 RequestAttachWindow()37 35 } 38 36
Note: See TracChangeset
for help on using the changeset viewer.