Changeset 60889 in webkit
- Timestamp:
- Jun 9, 2010 7:18:57 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r60887 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * inspector/InspectorClient.h: 13 * inspector/InspectorController.cpp: 14 (WebCore::InspectorController::connectFrontend): 15 (WebCore::InspectorController::disconnectFrontend): 16 * inspector/InspectorController.h: 17 * inspector/InspectorFrontend.cpp: 18 (WebCore::InspectorFrontend::InspectorFrontend): 19 * inspector/InspectorFrontend.h: 20 * inspector/InspectorFrontendClientLocal.cpp: 21 (WebCore::InspectorFrontendClientLocal::frontendLoaded): 22 * inspector/InspectorValues.cpp: 23 (WebCore::InspectorObject::writeJSON): 24 * inspector/front-end/inspector.js: 25 (WebInspector.dispatchMessageToFrontend): 26 * loader/EmptyClients.h: 27 (WebCore::EmptyInspectorClient::sendMessageToFrontend): 28 1 29 2010-06-09 Csaba Osztrogonác <ossy@webkit.org> 2 30 -
trunk/WebCore/inspector/InspectorClient.h
r56051 r60889 49 49 virtual void populateSetting(const String& key, String* value) = 0; 50 50 virtual void storeSetting(const String& key, const String& value) = 0; 51 52 virtual bool sendMessageToFrontend(const String& message) = 0; 51 53 }; 52 54 -
trunk/WebCore/inspector/InspectorController.cpp
r60843 r60889 426 426 } 427 427 428 void InspectorController::setFrontend(PassOwnPtr<InspectorFrontend> frontend) 429 { 430 ASSERT(frontend); 428 void InspectorController::connectFrontend(const ScriptObject& webInspector) 429 { 431 430 m_openingFrontend = false; 432 m_frontend = frontend;431 m_frontend = new InspectorFrontend(webInspector, m_client); 433 432 releaseDOMAgent(); 434 433 m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend.get()); -
trunk/WebCore/inspector/InspectorController.h
r60843 r60889 135 135 void showPanel(SpecialPanels); 136 136 void close(); 137 138 // We are in transition from JS transport via webInspector to native 139 // transport via InspectorClient. After migration, webInspector parameter should 140 // be removed. 141 void connectFrontend(const ScriptObject& webInspector); 137 142 void disconnectFrontend(); 138 143 … … 152 157 153 158 bool windowVisible(); 154 void setFrontend(PassOwnPtr<InspectorFrontend>);155 159 156 160 void didCommitLoad(DocumentLoader*); -
trunk/WebCore/inspector/InspectorFrontend.cpp
r60843 r60889 37 37 #include "InjectedScript.h" 38 38 #include "InjectedScriptHost.h" 39 #include "InspectorClient.h" 39 40 #include "InspectorController.h" 40 41 #include "InspectorWorkerResource.h" … … 50 51 namespace WebCore { 51 52 52 InspectorFrontend::InspectorFrontend(ScriptObject webInspector )53 : m_webInspector(webInspector) 53 InspectorFrontend::InspectorFrontend(ScriptObject webInspector, InspectorClient* inspectorClient) 54 : m_webInspector(webInspector), m_inspectorClient(inspectorClient) 54 55 { 55 56 } -
trunk/WebCore/inspector/InspectorFrontend.h
r60843 r60889 31 31 #define InspectorFrontend_h 32 32 33 #include "InspectorValues.h" 33 34 #include "ScriptArray.h" 34 35 #include "ScriptObject.h" … … 40 41 class Database; 41 42 class Frame; 43 class InspectorClient; 42 44 class InspectorResource; 45 class InspectorWorkerResource; 43 46 class Node; 44 47 class ScriptString; 45 48 class SerializedScriptValue; 46 49 class Storage; 47 class InspectorWorkerResource;48 50 49 51 class InspectorFrontend : public Noncopyable { 50 52 public: 51 InspectorFrontend(ScriptObject webInspector); 53 // We are in transition from JS transport via webInspector to native 54 // transport via inspectorClient. After migration, webInspector parameter should 55 // be removed. 56 InspectorFrontend(ScriptObject webInspector, InspectorClient* inspectorClient); 52 57 ~InspectorFrontend(); 53 58 … … 172 177 void callSimpleFunction(const String& functionName); 173 178 ScriptObject m_webInspector; 179 InspectorClient* m_inspectorClient; 174 180 }; 175 181 -
trunk/WebCore/inspector/InspectorFrontendClientLocal.cpp
r57146 r60889 90 90 return; 91 91 } 92 m_inspectorController-> setFrontend(new InspectorFrontend(webInspectorObj));92 m_inspectorController->connectFrontend(webInspectorObj); 93 93 } 94 94 -
trunk/WebCore/inspector/InspectorValues.cpp
r60774 r60889 626 626 Dictionary::const_iterator it = m_data.find(m_order[i]); 627 627 ASSERT(it != m_data.end()); 628 if (i t != m_data.begin())628 if (i) 629 629 output->append(','); 630 630 doubleQuoteString(it->first, output); -
trunk/WebCore/inspector/front-end/inspector.js
r60771 r60889 572 572 setTimeout(delayDispatch, 0); 573 573 } 574 575 WebInspector.dispatchMessageFromBackend = function(arguments) 576 { 577 var methodName = arguments.shift(); 578 WebInspector[methodName].apply(this, arguments); 579 } 580 574 581 575 582 WebInspector.windowResize = function(event) -
trunk/WebCore/loader/EmptyClients.h
r58686 r60889 487 487 virtual void populateSetting(const String&, String*) { } 488 488 virtual void storeSetting(const String&, const String&) { } 489 virtual bool sendMessageToFrontend(const String&) { return false; } 489 490 }; 490 491 -
trunk/WebKit/ChangeLog
r60488 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * efl/WebCoreSupport/InspectorClientEfl.cpp: 13 (WebCore::InspectorClientEfl::sendMessageToFrontend): 14 * efl/WebCoreSupport/InspectorClientEfl.h: 15 1 16 2010-06-01 Alexey Proskuryakov <ap@apple.com> 2 17 -
trunk/WebKit/cf/ChangeLog
r52956 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/WebInspectorClientCF.cpp: 13 (WebInspectorClient::releaseFrontendPage): 14 (WebInspectorClient::sendMessageToFrontend): 15 1 16 2010-01-07 Alexey Proskuryakov <ap@apple.com> 2 17 -
trunk/WebKit/cf/WebCoreSupport/WebInspectorClientCF.cpp
r52956 r60889 54 54 #include <CoreFoundation/CoreFoundation.h> 55 55 56 #include <WebCore/Frame.h> 57 #include <WebCore/Page.h> 56 58 #include <WebCore/PlatformString.h> 57 59 … … 93 95 CFPreferencesSetAppValue(preferencesKey.get(), objectToStore.get(), kCFPreferencesCurrentApplication); 94 96 } 97 98 void WebInspectorClient::releaseFrontendPage() 99 { 100 m_frontendPage = 0; 101 } 102 103 bool WebInspectorClient::sendMessageToFrontend(const String& message) 104 { 105 if (!m_frontendPage) 106 return false; 107 108 Frame* frame = m_frontendPage->mainFrame(); 109 if (!frame) 110 return false; 111 112 ScriptController* scriptController = frame->script(); 113 if (!scriptController) 114 return false; 115 116 String dispatchToFrontend("WebInspector.dispatchMessageFromBackend("); 117 dispatchToFrontend += message; 118 dispatchToFrontend += ");"; 119 scriptController->executeScript(dispatchToFrontend); 120 return true; 121 } -
trunk/WebKit/chromium/ChangeLog
r60886 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * src/InspectorClientImpl.cpp: 13 (WebKit::InspectorClientImpl::sendMessageToFrontend): 14 * src/InspectorClientImpl.h: 15 * src/WebDevToolsAgentImpl.cpp: 16 (WebKit::WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController): 17 1 18 2010-06-09 Yury Semikhatsky <yurys@chromium.org> 2 19 -
trunk/WebKit/chromium/src/InspectorClientImpl.cpp
r60469 r60889 36 36 #include "NotImplemented.h" 37 37 #include "Page.h" 38 #include "WebDevToolsAgentImpl.h" 39 #include "WebDevToolsMessageData.h" 38 40 #include "WebRect.h" 39 41 #include "WebURL.h" … … 103 105 } 104 106 107 bool InspectorClientImpl::sendMessageToFrontend(const WebCore::String& message) 108 { 109 WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent()); 110 if (!devToolsAgent) 111 return false; 112 113 WebVector<WebString> arguments(size_t(1)); 114 arguments[0] = message; 115 WebDevToolsMessageData data; 116 data.className = "ToolsAgentDelegate"; 117 data.methodName = "dispatchOnClient"; 118 data.arguments.swap(arguments); 119 devToolsAgent->sendRpcMessage(data); 120 return true; 121 } 122 105 123 } // namespace WebKit -
trunk/WebKit/chromium/src/InspectorClientImpl.h
r60469 r60889 37 37 38 38 namespace WebKit { 39 40 class WebDevToolsAgentClient; 39 41 class WebViewImpl; 40 42 … … 47 49 virtual void inspectorDestroyed(); 48 50 virtual void openInspectorFrontend(WebCore::InspectorController*); 51 49 52 virtual void highlight(WebCore::Node*); 50 53 virtual void hideHighlight(); 51 virtual void populateSetting(52 const WebCore::String& key,53 WebCore::String* value);54 virtual void storeSetting(55 const WebCore::String& key,56 const WebCore::String& value);57 54 55 virtual void populateSetting(const WebCore::String& key, WebCore::String* value); 56 virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); 57 58 virtual bool sendMessageToFrontend(const WebCore::String&); 58 59 private: 59 60 -
trunk/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r60436 r60889 471 471 v8::Local<v8::Context>::New(m_utilityContext)); 472 472 InspectorController* ic = inspectorController(); 473 ic->setFrontend(new InspectorFrontend( 474 ScriptObject(state, m_utilityContext->Global()))); 473 ic->connectFrontend(ScriptObject(state, m_utilityContext->Global())); 475 474 } 476 475 -
trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
r56051 r60889 59 59 } 60 60 61 bool InspectorClientEfl::sendMessageToFrontend(const String&) 62 { 63 notImpelemented(); 64 return false; 61 65 } 66 67 68 } -
trunk/WebKit/efl/WebCoreSupport/InspectorClientEfl.h
r56051 r60889 51 51 virtual void populateSetting(const String& key, String* value); 52 52 virtual void storeSetting(const String& key, const String& value); 53 54 virtual bool sendMessageToFrontend(const String&); 53 55 }; 54 56 } -
trunk/WebKit/gtk/ChangeLog
r60842 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/InspectorClientGtk.cpp: 13 (WebKit::InspectorClient::releaseFrontendPage): 14 (WebKit::InspectorClient::sendMessageToFrontend): 15 * WebCoreSupport/InspectorClientGtk.h: 16 1 17 2010-06-08 Xan Lopez <xlopez@igalia.com> 2 18 -
trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
r56825 r60889 20 20 #include "InspectorClientGtk.h" 21 21 22 #include "Frame.h" 22 23 #include "webkitwebview.h" 23 24 #include "webkitwebinspector.h" … … 39 40 InspectorClient::InspectorClient(WebKitWebView* webView) 40 41 : m_inspectedWebView(webView) 42 , m_frontendPage(0) 41 43 {} 42 44 … … 81 83 gtk_widget_show(GTK_WIDGET(inspectorWebView)); 82 84 83 Page* inspectorPage = core(inspectorWebView); 84 inspectorPage->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClient(m_inspectedWebView, inspectorWebView, webInspector, inspectorPage)); 85 m_frontendPage = core(inspectorWebView); 86 m_frontendPage->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClient(m_inspectedWebView, inspectorWebView, webInspector, m_frontendPage, this)); 87 } 88 89 void InspectorClient::releaseFrontendPage() 90 { 91 m_frontendPage = 0; 85 92 } 86 93 … … 105 112 } 106 113 114 bool InspectorClient::sendMessageToFrontend(const String& message) 115 { 116 if (!m_frontendPage) 117 return false; 118 119 Frame* frame = m_frontendPage->mainFrame(); 120 if (!frame) 121 return false; 122 123 ScriptController* scriptController = frame->script(); 124 if (!scriptController) 125 return false; 126 127 String dispatchToFrontend("WebInspector.dispatchMessageToFrontend("); 128 dispatchToFrontend += message; 129 dispatchToFrontend += ");"; 130 scriptController->executeScript(dispatchToFrontend); 131 return true; 132 } 107 133 108 134 bool destroyed = TRUE; 109 135 110 InspectorFrontendClient::InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, Page* inspectorPage )136 InspectorFrontendClient::InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, Page* inspectorPage, InspectorClient* inspectorClient) 111 137 : InspectorFrontendClientLocal(core(inspectedWebView)->inspectorController(), inspectorPage) 112 138 , m_inspectorWebView(inspectorWebView) 113 139 , m_inspectedWebView(inspectedWebView) 114 140 , m_webInspector(webInspector) 141 , m_inspectorClient(inspectorClient) 115 142 { 116 143 g_signal_connect(m_inspectorWebView, "destroy", … … 138 165 g_signal_emit_by_name(webInspector, "close-window", &handled); 139 166 ASSERT(handled); 167 168 m_inspectorClient->releaseFrontendPage(); 140 169 141 170 /* we should now dispose our own reference */ -
trunk/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h
r56051 r60889 57 57 virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); 58 58 59 virtual bool sendMessageToFrontend(const WebCore::String&); 60 61 void releaseFrontendPage(); 62 59 63 private: 60 64 WebKitWebView* m_inspectedWebView; 65 WebCore::Page* m_frontendPage; 61 66 }; 62 67 63 68 class InspectorFrontendClient : public WebCore::InspectorFrontendClientLocal { 64 69 public: 65 InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, WebCore::Page* inspectorPage );70 InspectorFrontendClient(WebKitWebView* inspectedWebView, WebKitWebView* inspectorWebView, WebKitWebInspector* webInspector, WebCore::Page* inspectorPage, InspectorClient* inspectorClient); 66 71 67 72 void destroyInspectorWindow(); … … 87 92 WebKitWebView* m_inspectedWebView; 88 93 WebKitWebInspector* m_webInspector; 94 InspectorClient* m_inspectorClient; 89 95 }; 90 96 } -
trunk/WebKit/haiku/ChangeLog
r60463 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/InspectorClientHaiku.cpp: 13 (WebCore::InspectorClientHaiku::sendMessageToFrontend): 14 * WebCoreSupport/InspectorClientHaiku.h: 15 1 16 2010-05-31 Lyon Chen <liachen@rim.com> 2 17 -
trunk/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp
r56051 r60889 68 68 } 69 69 70 bool InspectorClientHaiku::sendMessageToFrontend(const String&) 71 { 72 notImplemented(); 73 return false; 74 } 75 70 76 } // namespace WebCore 71 77 -
trunk/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h
r56051 r60889 50 50 virtual void populateSetting(const WebCore::String& key, WebCore::String* value); 51 51 virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); 52 53 virtual bool sendMessageToFrontend(const WebCore::String&); 52 54 }; 53 55 } // namespace WebCore -
trunk/WebKit/mac/ChangeLog
r60882 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/WebInspectorClient.h: 13 * WebCoreSupport/WebInspectorClient.mm: 14 (WebInspectorClient::WebInspectorClient): 15 (WebInspectorClient::openInspectorFrontend): 16 1 17 2010-06-08 Mark Rowe <mrowe@apple.com> 2 18 -
trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.h
r56051 r60889 43 43 #endif 44 44 45 namespace WebCore { 46 47 class Page; 48 49 } 50 45 51 class WebInspectorClient : public WebCore::InspectorClient { 46 52 public: … … 57 63 virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); 58 64 65 virtual bool sendMessageToFrontend(const WebCore::String&); 66 67 void releaseFrontendPage(); 68 59 69 private: 60 70 WebView *m_webView; 61 71 RetainPtr<WebNodeHighlighter> m_highlighter; 72 WebCore::Page* m_frontendPage; 62 73 }; 74 63 75 64 76 class WebInspectorFrontendClient : public WebCore::InspectorFrontendClientLocal { … … 67 79 68 80 virtual void frontendLoaded(); 69 81 70 82 virtual WebCore::String localizedStringsURL(); 71 83 virtual WebCore::String hiddenPanels(); 72 84 73 85 virtual void bringToFront(); 74 86 virtual void closeWindow(); 75 87 76 88 virtual void attachWindow(); 77 89 virtual void detachWindow(); 78 90 79 91 virtual void setAttachedWindowHeight(unsigned height); 80 92 virtual void inspectedURLChanged(const WebCore::String& newURL); -
trunk/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
r59125 r60889 51 51 WebView *_webView; 52 52 WebInspectorFrontendClient* _frontendClient; 53 WebInspectorClient* _inspectorClient; 53 54 BOOL _attachedToInspectedWebView; 54 55 BOOL _shouldAttach; … … 62 63 - (BOOL)attached; 63 64 - (void)setFrontendClient:(WebInspectorFrontendClient*)frontendClient; 65 - (void)setInspectorClient:(WebInspectorClient*)inspectorClient; 64 66 - (void)setAttachedWindowHeight:(unsigned)height; 65 67 - (void)destroyInspectorView; … … 84 86 : m_webView(webView) 85 87 , m_highlighter(AdoptNS, [[WebNodeHighlighter alloc] initWithInspectedWebView:webView]) 88 , m_frontendPage(0) 86 89 { 87 90 } … … 95 98 { 96 99 RetainPtr<WebInspectorWindowController> windowController(AdoptNS, [[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]); 97 Page* frontendPage = core([windowController.get() webView]);98 99 frontendPage->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController,frontendPage));100 [windowController.get() setInspectorClient:this]; 101 m_frontendPage = core([windowController.get() webView]); 102 m_frontendPage->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage)); 100 103 } 101 104 … … 408 411 } 409 412 413 - (void)setInspectorClient:(WebInspectorClient*)inspectorClient 414 { 415 _inspectorClient = inspectorClient; 416 } 417 410 418 - (void)setAttachedWindowHeight:(unsigned)height 411 419 { … … 439 447 if (Page* inspectedPage = [_inspectedWebView page]) 440 448 inspectedPage->inspectorController()->disconnectFrontend(); 449 450 _inspectorClient->releaseFrontendPage(); 441 451 442 452 [_webView close]; -
trunk/WebKit/qt/ChangeLog
r60841 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/InspectorClientQt.cpp: 13 (WebCore::InspectorClientQt::InspectorClientQt): 14 (WebCore::InspectorClientQt::openInspectorFrontend): 15 (WebCore::InspectorClientQt::releaseFrontendPage): 16 (WebCore::InspectorClientQt::sendMessageToFrontend): 17 * WebCoreSupport/InspectorClientQt.h: 18 1 19 2010-06-08 Antonio Gomes <tonikitoo@webkit.org> 2 20 -
trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
r60609 r60889 32 32 #include "InspectorClientQt.h" 33 33 34 #include "Frame.h" 34 35 #include "qwebinspector.h" 35 36 #include "qwebinspector_p.h" … … 45 46 #include "Page.h" 46 47 #include "PlatformString.h" 48 #include "ScriptController.h" 47 49 48 50 namespace WebCore { … … 75 77 InspectorClientQt::InspectorClientQt(QWebPage* page) 76 78 : m_inspectedWebPage(page) 79 , m_frontendWebPage(0) 77 80 {} 78 81 … … 104 107 inspector->d->setFrontend(inspectorView); 105 108 106 inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView)); 109 inspectorView->page()->d->page->inspectorController()->setInspectorFrontendClient(new InspectorFrontendClientQt(m_inspectedWebPage, inspectorView, this)); 110 m_frontendWebPage = inspectorPage; 111 } 112 113 void InspectorClientQt::releaseFrontendPage() 114 { 115 m_frontendWebPage = 0; 107 116 } 108 117 … … 161 170 } 162 171 172 bool InspectorClientQt::sendMessageToFrontend(const String& message) 173 { 174 if (!m_frontendWebPage) 175 return false; 176 177 Page* frontendPage = QWebPagePrivate::core(m_frontendWebPage); 178 if (!frontendPage) 179 return false; 180 181 Frame* frame = frontendPage->mainFrame(); 182 if (!frame) 183 return false; 184 185 ScriptController* scriptController = frame->script(); 186 if (!scriptController) 187 return false; 188 189 String dispatchToFrontend("WebInspector.dispatchMessageToFrontend("); 190 dispatchToFrontend += message; 191 dispatchToFrontend += ");"; 192 scriptController->executeScript(dispatchToFrontend); 193 return true; 194 } 195 163 196 static String variantToSetting(const QVariant& qvariant) 164 197 { … … 184 217 } 185 218 186 InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView )219 InspectorFrontendClientQt::InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient) 187 220 : InspectorFrontendClientLocal(inspectedWebPage->d->page->inspectorController(), inspectorView->page()->d->page) 188 221 , m_inspectedWebPage(inspectedWebPage) 189 222 , m_inspectorView(inspectorView) 190 223 , m_destroyingInspectorView(false) 224 , m_inspectorClient(inspectorClient) 191 225 { 192 226 } … … 226 260 m_inspectedWebPage->d->inspectorController()->disconnectFrontend(); 227 261 #endif 262 m_inspectorClient->releaseFrontendPage(); 263 228 264 // Clear pointer before deleting WebView to avoid recursive calls to its destructor. 229 265 delete m_inspectorView.release(); -
trunk/WebKit/qt/WebCoreSupport/InspectorClientQt.h
r56051 r60889 59 59 virtual void storeSetting(const String& key, const String& value); 60 60 61 virtual bool sendMessageToFrontend(const String&); 62 63 void releaseFrontendPage(); 64 61 65 private: 62 66 QWebPage* m_inspectedWebPage; 67 QWebPage* m_frontendWebPage; 63 68 }; 64 69 65 70 class InspectorFrontendClientQt : public InspectorFrontendClientLocal { 66 71 public: 67 InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView );72 InspectorFrontendClientQt(QWebPage* inspectedWebPage, PassOwnPtr<QWebView> inspectorView, InspectorClientQt* inspectorClient); 68 73 69 74 virtual void frontendLoaded(); … … 89 94 QString m_inspectedURL; 90 95 bool m_destroyingInspectorView; 96 InspectorClientQt* m_inspectorClient; 91 97 }; 92 98 } -
trunk/WebKit/win/ChangeLog
r60841 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebCoreSupport/WebInspectorClient.cpp: 13 (WebInspectorClient::WebInspectorClient): 14 (WebInspectorClient::~WebInspectorClient): 15 (WebInspectorClient::openInspectorFrontend): 16 * WebCoreSupport/WebInspectorClient.h: 17 1 18 2010-06-08 Antonio Gomes <tonikitoo@webkit.org> 2 19 -
trunk/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
r58227 r60889 70 70 WebInspectorClient::WebInspectorClient(WebView* webView) 71 71 : m_inspectedWebView(webView) 72 , m_frontendPage(0) 72 73 { 73 74 ASSERT(m_inspectedWebView); … … 77 78 WebInspectorClient::~WebInspectorClient() 78 79 { 80 m_frontendPage = 0; 79 81 } 80 82 … … 173 175 return; 174 176 175 Page* page = core(frontendWebView.get()); 176 page->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_inspectedWebView, m_inspectedWebViewHwnd, frontendHwnd, frontendWebView, frontendWebViewHwnd, this)); 177 m_frontendPage = core(frontendWebView.get()); 178 WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_inspectedWebView, m_inspectedWebViewHwnd, frontendHwnd, frontendWebView, frontendWebViewHwnd, this); 179 m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient); 177 180 m_frontendHwnd = frontendHwnd; 178 181 } -
trunk/WebKit/win/WebCoreSupport/WebInspectorClient.h
r58227 r60889 38 38 #include <windows.h> 39 39 40 namespace WebCore { 41 42 class Page; 43 44 } 45 40 46 class WebNodeHighlight; 41 47 class WebView; … … 56 62 virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); 57 63 64 virtual bool sendMessageToFrontend(const WebCore::String&); 65 58 66 void updateHighlight(); 59 void frontendClosing() { m_frontendHwnd = 0; } 67 void frontendClosing() 68 { 69 m_frontendHwnd = 0; 70 releaseFrontendPage(); 71 } 60 72 73 void releaseFrontendPage(); 61 74 private: 62 75 ~WebInspectorClient(); 63 76 64 77 WebView* m_inspectedWebView; 78 WebCore::Page* m_frontendPage; 65 79 HWND m_inspectedWebViewHwnd; 66 80 HWND m_frontendHwnd; -
trunk/WebKit/wx/ChangeLog
r60315 r60889 1 2010-06-07 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 WebInspector: On the way to Remote Debugging we want to transfer dom/timeline/etc 6 data from inspected page to WebInspector as JSON string via http. The native 7 serialization to JSON string is supported by InspectorValue's classes. This patch 8 has the implementation of sendMessageToFrontend function. WebKit version of it still 9 uses ScriptFunctionCall and will be switched to another transport a little bit later. 10 https://bugs.webkit.org/show_bug.cgi?id=40134 11 12 * WebKitSupport/InspectorClientWx.cpp: 13 (WebCore::InspectorClientWx::sendMessageToFrontend): 14 * WebKitSupport/InspectorClientWx.h: 15 1 16 2010-05-27 Kevin Ollivier <kevino@theolliviers.com> 2 17 -
trunk/WebKit/wx/WebKitSupport/InspectorClientWx.cpp
r56309 r60889 73 73 } 74 74 75 bool InspectorClientWx::sendMessageToFrontend(const String&) 76 { 77 notImplemented(); 78 return false; 79 } 80 75 81 }; -
trunk/WebKit/wx/WebKitSupport/InspectorClientWx.h
r56051 r60889 49 49 virtual void populateSetting(const String& key, String* value); 50 50 virtual void storeSetting(const String& key, const String& value); 51 52 virtual bool sendMessageToFrontend(const String&); 51 53 }; 52 54
Note: See TracChangeset
for help on using the changeset viewer.