Changeset 68056 in webkit
- Timestamp:
- Sep 22, 2010 10:33:56 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r68054 r68056 1 2010-09-22 Jamey Hicks <jamey.hicks@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Web Inspector: Remote Web Inspector support for QtWebKit 6 https://bugs.webkit.org/show_bug.cgi?id=43988 7 8 Runs a web debug server on port specified by QtTestBrowser 9 argument -remote-inspector-port. Property 10 _q_webInspectorServerPort of the QWebPage instance will be set 11 according to the argument. All pages with that property set will 12 be remotely inspectable. 13 14 URL for remote inspection of first QWebPage is 15 http://localhost:9222/webkit/inspector/inspector.html?page=1 16 where 1 is the number of the QWebPage instance. 17 18 The base URL yields an index page with links to the individual inspectors: 19 http://localhost:9222/ 20 21 * WebCore.pro 22 1 23 2010-09-21 Darin Adler <darin@apple.com> 2 24 -
trunk/WebCore/WebCore.pro
r68022 r68056 2504 2504 xml/XSLTUnicodeSort.h \ 2505 2505 $$PWD/../WebKit/qt/Api/qwebplugindatabase_p.h \ 2506 $$PWD/../WebKit/qt/WebCoreSupport/InspectorServerQt.h \ 2506 2507 $$PWD/../WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h \ 2507 2508 $$PWD/../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h \ … … 2610 2611 ../WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp \ 2611 2612 ../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp \ 2613 ../WebKit/qt/WebCoreSupport/InspectorServerQt.cpp \ 2612 2614 ../WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp \ 2613 2615 ../WebKit/qt/WebCoreSupport/PageClientQt.cpp \ -
trunk/WebKit/qt/Api/qwebinspector.cpp
r59456 r68056 197 197 } 198 198 199 /*! 200 * \internal 201 */ 202 void QWebInspectorPrivate::attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend) 203 { 204 if (remoteFrontend) 205 remoteFrontend->setParent(0); 206 207 remoteFrontend = newRemoteFrontend; 208 209 if (remoteFrontend) 210 remoteFrontend->setParent(q); 211 } 212 213 /*! 214 * \internal 215 */ 216 void QWebInspectorPrivate::detachRemoteFrontend() 217 { 218 if (remoteFrontend) { 219 remoteFrontend->deleteLater(); 220 remoteFrontend = 0; 221 } 222 } 223 199 224 void QWebInspectorPrivate::adjustFrontendSize(const QSize& size) 200 225 { -
trunk/WebKit/qt/Api/qwebinspector_p.h
r48808 r68056 34 34 , page(0) 35 35 , frontend(0) 36 , remoteFrontend(0) 36 37 {} 37 38 38 39 void setFrontend(QWidget* newFrontend); 40 void attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend); 41 void detachRemoteFrontend(); 39 42 void adjustFrontendSize(const QSize& size); 40 43 … … 42 45 QWebPage* page; 43 46 QWidget* frontend; 47 QObject* remoteFrontend; 44 48 }; 45 49 -
trunk/WebKit/qt/Api/qwebpage.cpp
r68039 r68056 78 78 #include "HTMLNames.h" 79 79 #include "HitTestResult.h" 80 #include "InspectorServerQt.h" 80 81 #include "WindowFeatures.h" 81 82 #include "WebPlatformStrategies.h" … … 1303 1304 } 1304 1305 #endif 1306 else if (event->propertyName() == "_q_webInspectorServerPort") { 1307 InspectorServerQt* inspectorServer = InspectorServerQt::server(); 1308 inspectorServer->listen(inspectorServerPort()); 1309 } 1305 1310 } 1306 1311 #endif … … 1560 1565 } 1561 1566 1567 quint16 QWebPagePrivate::inspectorServerPort() 1568 { 1569 #if ENABLE(INSPECTOR) && !defined(QT_NO_PROPERTIES) 1570 if (q && q->property("_q_webInspectorServerPort").isValid()) 1571 return q->property("_q_webInspectorServerPort").toInt(); 1572 #endif 1573 return 0; 1574 } 1562 1575 1563 1576 /*! -
trunk/WebKit/qt/Api/qwebpage.h
r67376 r68056 56 56 class FrameLoaderClientQt; 57 57 class InspectorClientQt; 58 class InspectorServerRequestHandlerQt; 58 59 class InspectorFrontendClientQt; 59 60 class NotificationPresenterClientQt; … … 426 427 friend class WebCore::FrameLoaderClientQt; 427 428 friend class WebCore::InspectorClientQt; 429 friend class WebCore::InspectorServerRequestHandlerQt; 428 430 friend class WebCore::InspectorFrontendClientQt; 429 431 friend class WebCore::NotificationPresenterClientQt; -
trunk/WebKit/qt/Api/qwebpage_p.h
r67376 r68056 140 140 QWebInspector* getOrCreateInspector(); 141 141 WebCore::InspectorController* inspectorController(); 142 quint16 inspectorServerPort(); 142 143 143 144 #ifndef QT_NO_SHORTCUT -
trunk/WebKit/qt/ChangeLog
r68039 r68056 1 2010-09-22 Jamey Hicks <jamey.hicks@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Web Inspector: Remote Web Inspector support for QtWebKit 6 https://bugs.webkit.org/show_bug.cgi?id=43988 7 8 Runs a web debug server on port specified by QtTestBrowser 9 argument -remote-inspector-port. Property 10 _q_webInspectorServerPort of the QWebPage instance will be set 11 according to the argument. All pages with that property set will 12 be remotely inspectable. 13 14 URL for remote inspection of first QWebPage is 15 http://localhost:9222/webkit/inspector/inspector.html?page=1 16 where 1 is the number of the QWebPage instance. 17 18 The base URL yields an index page with links to the individual inspectors: 19 http://localhost:9222/ 20 21 * Api/qwebinspector.cpp: 22 (QWebInspectorPrivate::attachAndReplaceRemoteFrontend): 23 (QWebInspectorPrivate::detachRemoteFrontend): 24 * Api/qwebinspector_p.h: 25 (QWebInspectorPrivate::QWebInspectorPrivate): 26 * Api/qwebpage.cpp: 27 (QWebPagePrivate::dynamicPropertyChangeEvent): 28 (QWebPagePrivate::inspectorServerPort): 29 * Api/qwebpage.h: 30 * Api/qwebpage_p.h: 31 * WebCoreSupport/InspectorClientQt.cpp: 32 (WebCore::InspectorClientQt::InspectorClientQt): 33 (WebCore::InspectorClientQt::inspectorDestroyed): 34 (WebCore::InspectorClientQt::openInspectorFrontend): 35 (WebCore::InspectorClientQt::attachAndReplaceRemoteFrontend): 36 (WebCore::InspectorClientQt::detachRemoteFrontend): 37 (WebCore::InspectorClientQt::sendMessageToFrontend): 38 * WebCoreSupport/InspectorClientQt.h: 39 * WebCoreSupport/InspectorServerQt.cpp: Added. 40 (WebCore::generateWebSocketChallengeResponse): 41 (WebCore::parseWebSocketChallengeNumber): 42 (WebCore::InspectorServerQt::server): 43 (WebCore::InspectorServerQt::InspectorServerQt): 44 (WebCore::InspectorServerQt::~InspectorServerQt): 45 (WebCore::InspectorServerQt::listen): 46 (WebCore::InspectorServerQt::close): 47 (WebCore::InspectorServerQt::inspectorClientForPage): 48 (WebCore::InspectorServerQt::registerClient): 49 (WebCore::InspectorServerQt::unregisterClient): 50 (WebCore::InspectorServerQt::newConnection): 51 (WebCore::InspectorServerRequestHandlerQt::InspectorServerRequestHandlerQt): 52 (WebCore::InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt): 53 (WebCore::InspectorServerRequestHandlerQt::tcpReadyRead): 54 (WebCore::InspectorServerRequestHandlerQt::tcpConnectionDisconnected): 55 (WebCore::InspectorServerRequestHandlerQt::webSocketSend): 56 (WebCore::InspectorServerRequestHandlerQt::webSocketReadyRead): 57 (WebCore::RemoteFrontendChannel::RemoteFrontendChannel): 58 (WebCore::RemoteFrontendChannel::sendMessageToFrontend): 59 * WebCoreSupport/InspectorServerQt.h: Added. 60 1 61 2010-09-22 Balazs Kelemen <kb@inf.u-szeged.hu> 2 62 -
trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
r67488 r68056 33 33 34 34 #include "Frame.h" 35 #include "InspectorBackendDispatcher.h" 35 36 #include "InspectorController.h" 37 #include "InspectorFrontend.h" 38 #include "InspectorServerQt.h" 36 39 #include "NotImplemented.h" 37 40 #include "Page.h" … … 116 119 , m_frontendWebPage(0) 117 120 , m_frontendClient(0) 118 {} 121 { 122 InspectorServerQt* webInspectorServer = InspectorServerQt::server(); 123 if (webInspectorServer) 124 webInspectorServer->registerClient(this); 125 } 119 126 120 127 void InspectorClientQt::inspectorDestroyed() … … 122 129 if (m_frontendClient) 123 130 m_frontendClient->inspectorClientDestroyed(); 131 132 InspectorServerQt* webInspectorServer = InspectorServerQt::server(); 133 if (webInspectorServer) 134 webInspectorServer->unregisterClient(this); 135 124 136 delete this; 125 137 } 126 138 127 139 128 void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController* )140 void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController* inspectorController) 129 141 { 130 142 #if USE(V8) … … 137 149 138 150 QWebInspector* inspector = m_inspectedWebPage->d->getOrCreateInspector(); 151 // Remote frontend was attached. 152 if (m_inspectedWebPage->d->inspector->d->remoteFrontend) 153 return; 154 139 155 // This is a known hook that allows changing the default URL for the 140 156 // Web inspector. This is used for SDK purposes. Please keep this hook … … 166 182 m_frontendWebPage = 0; 167 183 m_frontendClient = 0; 184 } 185 186 void InspectorClientQt::attachAndReplaceRemoteFrontend(RemoteFrontendChannel* channel) 187 { 188 #if ENABLE(INSPECTOR) 189 // Channel was allocated by InspectorServerQt. Here we transfer ownership to inspector. 190 m_inspectedWebPage->d->inspector->d->attachAndReplaceRemoteFrontend(channel); 191 m_inspectedWebPage->d->inspectorController()->connectFrontend(); 192 #endif 193 } 194 195 void InspectorClientQt::detachRemoteFrontend() 196 { 197 #if ENABLE(INSPECTOR) 198 m_inspectedWebPage->d->inspector->d->detachRemoteFrontend(); 199 m_inspectedWebPage->d->inspectorController()->disconnectFrontend(); 200 #endif 168 201 } 169 202 … … 224 257 bool InspectorClientQt::sendMessageToFrontend(const String& message) 225 258 { 259 if (m_inspectedWebPage->d->inspector->d->remoteFrontend) { 260 RemoteFrontendChannel* session = qobject_cast<RemoteFrontendChannel*>(m_inspectedWebPage->d->inspector->d->remoteFrontend); 261 if (session) 262 session->sendMessageToFrontend(message); 263 return true; 264 } 226 265 if (!m_frontendWebPage) 227 266 return false; -
trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h
r66824 r68056 43 43 namespace WebCore { 44 44 class InspectorFrontendClientQt; 45 class InspectorServerRequestHandlerQt; 45 46 class Node; 46 47 class Page; 48 class RemoteFrontendChannel; 47 49 48 50 class InspectorClientQt : public InspectorClient { … … 64 66 void releaseFrontendPage(); 65 67 68 void attachAndReplaceRemoteFrontend(RemoteFrontendChannel *channel); 69 void detachRemoteFrontend(); 70 66 71 private: 67 72 QWebPage* m_inspectedWebPage; 68 73 QWebPage* m_frontendWebPage; 69 74 InspectorFrontendClientQt* m_frontendClient; 75 bool m_remoteInspector; 76 77 friend class InspectorServerRequestHandlerQt; 70 78 }; 71 79 -
trunk/WebKitTools/ChangeLog
r68053 r68056 1 2010-09-22 Jamey Hicks <jamey.hicks@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Web Inspector: Remote Web Inspector support for QtWebKit 6 https://bugs.webkit.org/show_bug.cgi?id=43988 7 8 Runs a web debug server on port specified by QtTestBrowser 9 argument -remote-inspector-port. Property 10 _q_webInspectorServerPort of the QWebPage instance will be set 11 according to the argument. All pages with that property set will 12 be remotely inspectable. 13 14 URL for remote inspection of first QWebPage is 15 http://localhost:9222/webkit/inspector/inspector.html?page=1 16 where 1 is the number of the QWebPage instance. 17 18 The base URL yields an index page with links to the individual inspectors: 19 http://localhost:9222/ 20 21 * QtTestBrowser/launcherwindow.cpp: 22 (LauncherWindow::init): 23 * QtTestBrowser/launcherwindow.h: 24 * QtTestBrowser/main.cpp: 25 (LauncherApplication::handleUserOptions): 26 1 27 2010-09-22 Adam Roben <aroben@apple.com> 2 28 -
trunk/WebKitTools/QtTestBrowser/launcherwindow.cpp
r67689 r68056 92 92 connect(this, SIGNAL(destroyed()), m_inspector, SLOT(deleteLater())); 93 93 94 if (m_windowOptions.remoteInspectorPort) 95 page()->setProperty("_q_webInspectorServerPort", m_windowOptions.remoteInspectorPort); 96 94 97 // the zoom values are chosen to be like in Mozilla Firefox 3 95 98 if (!m_zoomLevels.count()) { -
trunk/WebKitTools/QtTestBrowser/launcherwindow.h
r67686 r68056 111 111 #endif 112 112 QUrl inspectorUrl; 113 quint16 remoteInspectorPort; 113 114 }; 114 115 -
trunk/WebKitTools/QtTestBrowser/main.cpp
r67942 r68056 189 189 windowOptions.inspectorUrl = takeOptionValue(&args, inspectorUrlIndex); 190 190 191 QString remoteInspectorPortArg("-remote-inspector-port"); 192 int remoteInspectorPortIndex = args.indexOf(remoteInspectorPortArg); 193 if (remoteInspectorPortIndex != -1) 194 windowOptions.remoteInspectorPort = takeOptionValue(&args, remoteInspectorPortIndex).toInt(); 195 191 196 int robotIndex = args.indexOf("-r"); 192 197 if (robotIndex != -1) {
Note: See TracChangeset
for help on using the changeset viewer.