Changeset 200276 in webkit
- Timestamp:
- Apr 29, 2016 6:47:22 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r200272 r200276 1 2016-04-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load 4 https://bugs.webkit.org/show_bug.cgi?id=157198 5 <rdar://problem/26011049> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/InspectorBackendDispatcher.cpp: 10 (Inspector::BackendDispatcher::sendResponse): 11 While auditing the code, add a WTFMove. 12 1 13 2016-04-29 Mark Lam <mark.lam@apple.com> 2 14 -
trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
r194496 r200276 193 193 // if no error occurred during an invocation, but we do not include it at all. 194 194 Ref<InspectorObject> responseMessage = InspectorObject::create(); 195 responseMessage->setObject(ASCIILiteral("result"), result);195 responseMessage->setObject(ASCIILiteral("result"), WTFMove(result)); 196 196 responseMessage->setInteger(ASCIILiteral("id"), requestId); 197 197 m_frontendRouter->sendResponse(responseMessage->toJSONString()); -
trunk/Source/WebCore/ChangeLog
r200273 r200276 1 2016-04-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load 4 https://bugs.webkit.org/show_bug.cgi?id=157198 5 <rdar://problem/26011049> 6 7 Reviewed by Timothy Hatcher. 8 9 No new tests. This only affects inspecting an inspector. 10 11 * inspector/InspectorController.h: 12 * inspector/InspectorFrontendClient.h: 13 (WebCore::InspectorFrontendClient::pagePaused): 14 (WebCore::InspectorFrontendClient::pageUnpaused): 15 * inspector/PageScriptDebugServer.cpp: 16 (WebCore::PageScriptDebugServer::setJavaScriptPaused): 17 Inform a frontend client if the frontend page itself pauses/unpauses. 18 1 19 2016-04-29 Eric Carlson <eric.carlson@apple.com> 2 20 -
trunk/Source/WebCore/inspector/InspectorController.h
r197563 r200276 116 116 117 117 InspectorClient* inspectorClient() const { return m_inspectorClient; } 118 InspectorFrontendClient* inspectorFrontendClient() const { return m_inspectorFrontendClient; } 118 119 InspectorPageAgent* pageAgent() const { return m_pageAgent; } 119 120 -
trunk/Source/WebCore/inspector/InspectorFrontendClient.h
r194322 r200276 73 73 virtual void inspectedURLChanged(const String&) = 0; 74 74 75 virtual void pagePaused() { } 76 virtual void pageUnpaused() { } 77 75 78 WEBCORE_EXPORT virtual void sendMessageToBackend(const String&) = 0; 76 79 -
trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp
r198648 r200276 31 31 #include "EventLoop.h" 32 32 #include "FrameView.h" 33 #include "InspectorController.h" 34 #include "InspectorFrontendClient.h" 33 35 #include "JSDOMWindowCustom.h" 34 36 #include "MainFrame.h" … … 143 145 for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) 144 146 setJavaScriptPaused(frame, paused); 147 148 if (InspectorFrontendClient* frontendClient = page->inspectorController().inspectorFrontendClient()) { 149 if (paused) 150 frontendClient->pagePaused(); 151 else 152 frontendClient->pageUnpaused(); 153 } 145 154 } 146 155 -
trunk/Source/WebInspectorUI/ChangeLog
r200270 r200276 1 2016-04-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load 4 https://bugs.webkit.org/show_bug.cgi?id=157198 5 <rdar://problem/26011049> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Protocol/InspectorBackend.js: 10 (InspectorBackendClass.prototype._sendCommandToBackendWithCallback): 11 (InspectorBackendClass.prototype._sendCommandToBackendExpectingPromise): 12 While auditing, use simpler check. 13 14 * UserInterface/Proxies/FormatterWorkerProxy.js: 15 (WebInspector.FormatterWorkerProxy.canFormat): Deleted. 16 While auditing, remove dead code. 17 1 18 2016-04-29 Timothy Hatcher <timothy@apple.com> 2 19 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js
r199602 r200276 201 201 }; 202 202 203 if ( Object.keys(parameters).length)203 if (!isEmptyObject(parameters)) 204 204 messageObject["params"] = parameters; 205 205 … … 222 222 }; 223 223 224 if ( Object.keys(parameters).length)224 if (!isEmptyObject(parameters)) 225 225 messageObject["params"] = parameters; 226 226 -
trunk/Source/WebInspectorUI/UserInterface/Proxies/FormatterWorkerProxy.js
r199168 r200276 46 46 } 47 47 48 static canFormat(mimeType)49 {50 }51 52 48 // Actions 53 49 -
trunk/Source/WebKit2/ChangeLog
r200275 r200276 1 2016-04-29 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load 4 https://bugs.webkit.org/show_bug.cgi?id=157198 5 <rdar://problem/26011049> 6 7 Reviewed by Timothy Hatcher. 8 9 * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h: 10 * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: 11 (WebKit::WebInspectorFrontendAPIDispatcher::reset): 12 (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded): 13 (WebKit::WebInspectorFrontendAPIDispatcher::suspend): 14 (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend): 15 (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand): 16 (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync): 17 (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression): 18 (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions): 19 Avoid evaluating expressions when the page is paused. Generalize the 20 message queueing and dispatching for pause/suspend that we already 21 had for waiting for the frontend page to be loaded. 22 23 * WebProcess/WebPage/WebInspectorUI.h: 24 * WebProcess/WebPage/WebInspectorUI.cpp: 25 (WebKit::WebInspectorUI::pagePaused): 26 (WebKit::WebInspectorUI::pageUnpaused): 27 When the frontend page pauses/unpauses, suspend/resume the dispatcher. 28 1 29 2016-04-29 Chris Dumez <cdumez@apple.com> 2 30 -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp
r189657 r200276 28 28 29 29 #include "WebPage.h" 30 #include <JavaScriptCore/ScriptValue.h>31 30 #include <WebCore/MainFrame.h> 32 31 #include <WebCore/ScriptController.h> … … 43 42 { 44 43 m_frontendLoaded = false; 45 44 m_suspended = false; 46 45 m_queue.clear(); 47 46 } … … 51 50 m_frontendLoaded = true; 52 51 53 for (const String& expression : m_queue) 52 evaluateQueuedExpressions(); 53 } 54 55 void WebInspectorFrontendAPIDispatcher::suspend() 56 { 57 ASSERT(m_frontendLoaded); 58 ASSERT(!m_suspended); 59 ASSERT(m_queue.isEmpty()); 60 61 m_suspended = true; 62 } 63 64 void WebInspectorFrontendAPIDispatcher::unsuspend() 65 { 66 ASSERT(m_suspended); 67 68 m_suspended = false; 69 70 evaluateQueuedExpressions(); 71 } 72 73 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command) 74 { 75 evaluateOrQueueExpression(makeString("InspectorFrontendAPI.dispatch([\"", command, "\"])")); 76 } 77 78 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command, const String& argument) 79 { 80 evaluateOrQueueExpression(makeString("InspectorFrontendAPI.dispatch([\"", command, "\", \"", argument, "\"])")); 81 } 82 83 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command, bool argument) 84 { 85 evaluateOrQueueExpression(makeString("InspectorFrontendAPI.dispatch([\"", command, "\", ", argument ? "true" : "false", "])")); 86 } 87 88 void WebInspectorFrontendAPIDispatcher::dispatchMessageAsync(const String& message) 89 { 90 evaluateOrQueueExpression(makeString("InspectorFrontendAPI.dispatchMessageAsync(", message, ")")); 91 } 92 93 void WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression(const String& expression) 94 { 95 if (!m_frontendLoaded || m_suspended) { 96 m_queue.append(expression); 97 return; 98 } 99 100 ASSERT(m_queue.isEmpty()); 101 ASSERT(!m_page.corePage()->mainFrame().script().isPaused()); 102 m_page.corePage()->mainFrame().script().executeScript(expression); 103 } 104 105 void WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions() 106 { 107 if (m_queue.isEmpty()) 108 return; 109 110 for (const String& expression : m_queue) { 111 ASSERT(!m_page.corePage()->mainFrame().script().isPaused()); 54 112 m_page.corePage()->mainFrame().script().executeScript(expression); 113 } 55 114 56 115 m_queue.clear(); 57 116 } 58 117 59 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command)60 {61 evaluateExpressionOnLoad(makeString("InspectorFrontendAPI.dispatch([\"", command, "\"])"));62 }63 64 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command, const String& argument)65 {66 evaluateExpressionOnLoad(makeString("InspectorFrontendAPI.dispatch([\"", command, "\", \"", argument, "\"])"));67 }68 69 void WebInspectorFrontendAPIDispatcher::dispatchCommand(const String& command, bool argument)70 {71 evaluateExpressionOnLoad(makeString("InspectorFrontendAPI.dispatch([\"", command, "\", ", argument ? "true" : "false", "])"));72 }73 74 void WebInspectorFrontendAPIDispatcher::dispatchMessageAsync(const String& message)75 {76 evaluateExpressionOnLoad(makeString("InspectorFrontendAPI.dispatchMessageAsync(", message, ")"));77 }78 79 void WebInspectorFrontendAPIDispatcher::evaluateExpressionOnLoad(const String& expression)80 {81 if (m_frontendLoaded) {82 ASSERT(m_queue.isEmpty());83 m_page.corePage()->mainFrame().script().executeScript(expression);84 return;85 }86 87 m_queue.append(expression);88 }89 90 118 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h
r189657 r200276 36 36 class WebInspectorFrontendAPIDispatcher { 37 37 public: 38 WebInspectorFrontendAPIDispatcher(WebPage& page);38 WebInspectorFrontendAPIDispatcher(WebPage&); 39 39 40 40 void reset(); 41 41 void frontendLoaded(); 42 43 void suspend(); 44 void unsuspend(); 42 45 43 46 void dispatchCommand(const String& command); … … 47 50 48 51 private: 49 void evaluateExpressionOnLoad(const String& expression); 52 void evaluateOrQueueExpression(const String&); 53 void evaluateQueuedExpressions(); 50 54 51 55 WebPage& m_page; 52 56 Deque<String> m_queue; 53 57 bool m_frontendLoaded { false }; 58 bool m_suspended { false }; 54 59 }; 55 60 -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.cpp
r199619 r200276 259 259 } 260 260 261 void WebInspectorUI::pagePaused() 262 { 263 m_frontendAPIDispatcher.suspend(); 264 } 265 266 void WebInspectorUI::pageUnpaused() 267 { 268 m_frontendAPIDispatcher.unsuspend(); 269 } 270 261 271 void WebInspectorUI::sendMessageToBackend(const String& message) 262 272 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebInspectorUI.h
r199380 r200276 105 105 void sendMessageToBackend(const String&) override; 106 106 107 void pagePaused() override; 108 void pageUnpaused() override; 109 107 110 bool isUnderTest() override { return m_underTest; } 108 111 unsigned inspectionLevel() const override { return m_inspectionLevel; }
Note: See TracChangeset
for help on using the changeset viewer.