Changeset 173551 in webkit
- Timestamp:
- Sep 11, 2014, 6:50:24 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h (modified) (1 diff)
-
JavaScriptCore/inspector/ScriptDebugServer.cpp (modified) (7 diffs)
-
JavaScriptCore/inspector/ScriptDebugServer.h (modified) (3 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bindings/js/WorkerScriptDebugServer.h (modified) (1 diff)
-
WebCore/inspector/PageScriptDebugServer.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r173541 r173551 1 2014-09-11 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Occasional ASSERT closing web inspector 4 https://bugs.webkit.org/show_bug.cgi?id=136762 5 6 Reviewed by Timothy Hatcher. 7 8 It is harmless, and indeed possible to have an empty set of listeners 9 now that each Page gets its own PageDebugServer instead of a shared 10 global. So we should replace the null checks with isEmpty checks. 11 Since nobody was ever returning null, convert to references as well. 12 13 * inspector/JSGlobalObjectScriptDebugServer.h: 14 * inspector/ScriptDebugServer.cpp: 15 (Inspector::ScriptDebugServer::dispatchBreakpointActionLog): 16 (Inspector::ScriptDebugServer::dispatchBreakpointActionSound): 17 (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): 18 (Inspector::ScriptDebugServer::sourceParsed): 19 (Inspector::ScriptDebugServer::dispatchFunctionToListeners): 20 (Inspector::ScriptDebugServer::notifyDoneProcessingDebuggerEvents): 21 (Inspector::ScriptDebugServer::handlePause): 22 (Inspector::ScriptDebugServer::needPauseHandling): Deleted. 23 * inspector/ScriptDebugServer.h: 24 1 25 2014-09-10 Michael Saboff <msaboff@apple.com> 2 26 -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h
r166971 r173551 48 48 49 49 private: 50 virtual ListenerSet * getListenersForGlobalObject(JSC::JSGlobalObject*) override { return &m_listeners; }50 virtual ListenerSet& getListeners() override { return m_listeners; } 51 51 virtual void didPause(JSC::JSGlobalObject*) override { } 52 52 virtual void didContinue(JSC::JSGlobalObject*) override { } -
trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp
r173410 r173551 148 148 return; 149 149 150 ListenerSet* listeners = getListenersForGlobalObject(exec->lexicalGlobalObject()); 151 if (!listeners) 152 return; 153 ASSERT(!listeners->isEmpty()); 150 ListenerSet& listeners = getListeners(); 151 if (listeners.isEmpty()) 152 return; 154 153 155 154 TemporaryChange<bool> change(m_callingListeners, true); 156 155 157 156 Vector<ScriptDebugListener*> listenersCopy; 158 copyToVector( *listeners, listenersCopy);157 copyToVector(listeners, listenersCopy); 159 158 for (auto* listener : listenersCopy) 160 159 listener->breakpointActionLog(exec, message); 161 160 } 162 161 163 void ScriptDebugServer::dispatchBreakpointActionSound(ExecState* exec, int breakpointActionIdentifier) 164 { 165 if (m_callingListeners) 166 return; 167 168 ListenerSet* listeners = getListenersForGlobalObject(exec->lexicalGlobalObject()); 169 if (!listeners) 170 return; 171 ASSERT(!listeners->isEmpty()); 162 void ScriptDebugServer::dispatchBreakpointActionSound(ExecState*, int breakpointActionIdentifier) 163 { 164 if (m_callingListeners) 165 return; 166 167 ListenerSet& listeners = getListeners(); 168 if (listeners.isEmpty()) 169 return; 172 170 173 171 TemporaryChange<bool> change(m_callingListeners, true); 174 172 175 173 Vector<ScriptDebugListener*> listenersCopy; 176 copyToVector( *listeners, listenersCopy);174 copyToVector(listeners, listenersCopy); 177 175 for (auto* listener : listenersCopy) 178 176 listener->breakpointActionSound(breakpointActionIdentifier); … … 184 182 return; 185 183 186 ListenerSet* listeners = getListenersForGlobalObject(exec->lexicalGlobalObject()); 187 if (!listeners) 188 return; 189 ASSERT(!listeners->isEmpty()); 184 ListenerSet& listeners = getListeners(); 185 if (listeners.isEmpty()) 186 return; 190 187 191 188 TemporaryChange<bool> change(m_callingListeners, true); 192 189 193 190 Vector<ScriptDebugListener*> listenersCopy; 194 copyToVector( *listeners, listenersCopy);191 copyToVector(listeners, listenersCopy); 195 192 for (auto* listener : listenersCopy) 196 193 listener->breakpointActionProbe(exec, action, m_hitCount, sample); … … 252 249 return; 253 250 254 ListenerSet* listeners = getListenersForGlobalObject(exec->lexicalGlobalObject()); 255 if (!listeners) 256 return; 257 ASSERT(!listeners->isEmpty()); 251 ListenerSet& listeners = getListeners(); 252 if (listeners.isEmpty()) 253 return; 258 254 259 255 TemporaryChange<bool> change(m_callingListeners, true); … … 261 257 bool isError = errorLine != -1; 262 258 if (isError) 263 dispatchFailedToParseSource( *listeners, sourceProvider, errorLine, errorMessage);259 dispatchFailedToParseSource(listeners, sourceProvider, errorLine, errorMessage); 264 260 else 265 dispatchDidParseSource(*listeners, sourceProvider, isContentScript(exec)); 261 dispatchDidParseSource(listeners, sourceProvider, isContentScript(exec)); 262 } 263 264 void ScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback callback) 265 { 266 if (m_callingListeners) 267 return; 268 269 TemporaryChange<bool> change(m_callingListeners, true); 270 271 ListenerSet& listeners = getListeners(); 272 if (!listeners.isEmpty()) 273 dispatchFunctionToListeners(listeners, callback); 266 274 } 267 275 … … 274 282 } 275 283 276 void ScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback callback, JSGlobalObject* globalObject)277 {278 if (m_callingListeners)279 return;280 281 TemporaryChange<bool> change(m_callingListeners, true);282 283 if (ListenerSet* listeners = getListenersForGlobalObject(globalObject)) {284 if (!listeners->isEmpty())285 dispatchFunctionToListeners(*listeners, callback);286 }287 }288 289 284 void ScriptDebugServer::notifyDoneProcessingDebuggerEvents() 290 285 { 291 286 m_doneProcessingDebuggerEvents = true; 292 }293 294 bool ScriptDebugServer::needPauseHandling(JSGlobalObject* globalObject)295 {296 return !!getListenersForGlobalObject(globalObject);297 287 } 298 288 … … 317 307 void ScriptDebugServer::handlePause(Debugger::ReasonForPause, JSGlobalObject* vmEntryGlobalObject) 318 308 { 319 dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause , vmEntryGlobalObject);309 dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause); 320 310 LegacyProfiler::profiler()->didPause(currentDebuggerCallFrame()); 321 311 didPause(vmEntryGlobalObject); … … 326 316 didContinue(vmEntryGlobalObject); 327 317 LegacyProfiler::profiler()->didContinue(currentDebuggerCallFrame()); 328 dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue , vmEntryGlobalObject);318 dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue); 329 319 } 330 320 -
trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h
r167816 r173551 75 75 ~ScriptDebugServer(); 76 76 77 virtual ListenerSet * getListenersForGlobalObject(JSC::JSGlobalObject*) = 0;77 virtual ListenerSet& getListeners() = 0; 78 78 virtual void didPause(JSC::JSGlobalObject*) = 0; 79 79 virtual void didContinue(JSC::JSGlobalObject*) = 0; … … 84 84 bool evaluateBreakpointAction(const ScriptBreakpointAction&); 85 85 86 void dispatchFunctionToListeners(JavaScriptExecutionCallback , JSC::JSGlobalObject*);86 void dispatchFunctionToListeners(JavaScriptExecutionCallback); 87 87 void dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback); 88 88 void dispatchDidPause(ScriptDebugListener*); … … 100 100 101 101 virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String& errorMsg) override final; 102 virtual bool needPauseHandling(JSC::JSGlobalObject*) override final ;102 virtual bool needPauseHandling(JSC::JSGlobalObject*) override final { return true; } 103 103 virtual void handleBreakpointHit(const JSC::Breakpoint&) override final; 104 104 virtual void handleExceptionInBreakpointCondition(JSC::ExecState*, JSC::JSValue exception) const override final; -
trunk/Source/WebCore/ChangeLog
r173549 r173551 1 2014-09-11 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Occasional ASSERT closing web inspector 4 https://bugs.webkit.org/show_bug.cgi?id=136762 5 6 Reviewed by Timothy Hatcher. 7 8 * bindings/js/WorkerScriptDebugServer.h: 9 * inspector/PageScriptDebugServer.h: 10 1 11 2014-09-11 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.h
r163777 r173551 54 54 55 55 private: 56 virtual ListenerSet * getListenersForGlobalObject(JSC::JSGlobalObject*) override { return &m_listeners; }56 virtual ListenerSet& getListeners() override { return m_listeners; } 57 57 virtual void didPause(JSC::JSGlobalObject*) override { } 58 58 virtual void didContinue(JSC::JSGlobalObject*) override { } -
trunk/Source/WebCore/inspector/PageScriptDebugServer.h
r167133 r173551 52 52 53 53 private: 54 virtual ListenerSet * getListenersForGlobalObject(JSC::JSGlobalObject*) override { return &m_listeners; }54 virtual ListenerSet& getListeners() override { return m_listeners; } 55 55 virtual void didPause(JSC::JSGlobalObject*) override; 56 56 virtual void didContinue(JSC::JSGlobalObject*) override;
Note:
See TracChangeset
for help on using the changeset viewer.