Changeset 163139 in webkit
- Timestamp:
- Jan 30, 2014 5:34:31 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r163119 r163139 1 2014-01-26 Timothy Hatcher <timothy@apple.com> 2 3 Include profile with FunctionCall and EvaluateScript Timeline records. 4 5 https://bugs.webkit.org/show_bug.cgi?id=127663 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/InjectedScriptBase.cpp: 10 (Inspector::InjectedScriptBase::callFunctionWithEvalEnabled): 11 * inspector/InspectorEnvironment.h: 12 * inspector/JSGlobalObjectInspectorController.h: 13 1 14 2014-01-29 Filip Pizlo <fpizlo@apple.com> 2 15 -
trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
r161563 r163139 95 95 96 96 if (m_environment) 97 m_environment->didCallInjectedScriptFunction( );97 m_environment->didCallInjectedScriptFunction(m_injectedScriptObject.scriptState()); 98 98 99 99 return resultValue; -
trunk/Source/JavaScriptCore/inspector/InspectorEnvironment.h
r161563 r163139 46 46 virtual InspectorEvaluateHandler evaluateHandler() const = 0; 47 47 virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) = 0; 48 virtual void didCallInjectedScriptFunction( ) = 0;48 virtual void didCallInjectedScriptFunction(JSC::ExecState*) = 0; 49 49 }; 50 50 -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
r162676 r163139 62 62 virtual InspectorEvaluateHandler evaluateHandler() const override; 63 63 virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String&, int) override { } 64 virtual void didCallInjectedScriptFunction( ) override { }64 virtual void didCallInjectedScriptFunction(JSC::ExecState*) override { } 65 65 66 66 private: -
trunk/Source/WebCore/ChangeLog
r163135 r163139 1 2014-01-26 Timothy Hatcher <timothy@apple.com> 2 3 Include profile with FunctionCall and EvaluateScript Timeline records. 4 5 https://bugs.webkit.org/show_bug.cgi?id=127663 6 7 Reviewed by Joseph Pecoraro. 8 9 * bindings/js/JSCallbackData.cpp: 10 (WebCore::JSCallbackData::invokeCallback): 11 * bindings/js/JSEventListener.cpp: 12 (WebCore::JSEventListener::handleEvent): 13 * bindings/js/JSMutationCallback.cpp: 14 (WebCore::JSMutationCallback::call): 15 * bindings/js/ScheduledAction.cpp: 16 (WebCore::ScheduledAction::executeFunctionInContext): 17 * bindings/js/ScriptController.cpp: 18 (WebCore::ScriptController::evaluateInWorld): 19 * inspector/InspectorController.cpp: 20 (WebCore::InspectorController::didCallInjectedScriptFunction): 21 * inspector/InspectorController.h: 22 * inspector/InspectorInstrumentation.cpp: 23 (WebCore::InspectorInstrumentation::didCallFunctionImpl): 24 (WebCore::InspectorInstrumentation::didEvaluateScriptImpl): 25 * inspector/InspectorInstrumentation.h: 26 (WebCore::InspectorInstrumentation::didCallFunction): 27 (WebCore::InspectorInstrumentation::didEvaluateScript): 28 * inspector/InspectorTimelineAgent.cpp: 29 (WebCore::InspectorTimelineAgent::willCallFunction): 30 (WebCore::InspectorTimelineAgent::didCallFunction): 31 (WebCore::InspectorTimelineAgent::willEvaluateScript): 32 (WebCore::InspectorTimelineAgent::didEvaluateScript): 33 (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): 34 * inspector/InspectorTimelineAgent.h: 35 * inspector/TimelineRecordFactory.cpp: 36 (WebCore::TimelineRecordFactory::appendProfile): 37 * inspector/TimelineRecordFactory.h: 38 * inspector/WorkerInspectorController.cpp: 39 (WebCore::WorkerInspectorController::didCallInjectedScriptFunction): 40 * inspector/WorkerInspectorController.h: 41 1 42 2014-01-30 Joseph Pecoraro <pecoraro@apple.com> 2 43 -
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
r155217 r163139 78 78 : JSC::call(exec, function, callType, callData, thisValue, args); 79 79 80 InspectorInstrumentation::didCallFunction(cookie );80 InspectorInstrumentation::didCallFunction(cookie, context); 81 81 82 82 if (exec->hadException()) { -
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
r159679 r163139 134 134 : JSC::call(exec, handleEventFunction, callType, callData, thisValue, args); 135 135 136 InspectorInstrumentation::didCallFunction(cookie );136 InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext); 137 137 138 138 globalObject->setCurrentEvent(savedEvent); -
trunk/Source/WebCore/bindings/js/JSMutationCallback.cpp
r157653 r163139 90 90 JSMainThreadExecState::call(exec, callback, callType, callData, jsObserver, args); 91 91 92 InspectorInstrumentation::didCallFunction(cookie );92 InspectorInstrumentation::didCallFunction(cookie, context); 93 93 94 94 if (exec->hadException()) -
trunk/Source/WebCore/bindings/js/ScheduledAction.cpp
r160457 r163139 107 107 JSC::call(exec, m_function.get(), callType, callData, thisValue, args); 108 108 109 InspectorInstrumentation::didCallFunction(cookie );109 InspectorInstrumentation::didCallFunction(cookie, context); 110 110 111 111 if (exec->hadException()) -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r163135 r163139 147 147 JSValue returnValue = JSMainThreadExecState::evaluate(exec, jsSourceCode, shell, &evaluationException); 148 148 149 InspectorInstrumentation::didEvaluateScript(cookie );149 InspectorInstrumentation::didEvaluateScript(cookie, &m_frame); 150 150 151 151 if (evaluationException) { -
trunk/Source/WebCore/inspector/InspectorController.cpp
r163079 r163139 470 470 } 471 471 472 void InspectorController::didCallInjectedScriptFunction( )472 void InspectorController::didCallInjectedScriptFunction(JSC::ExecState* scriptState) 473 473 { 474 474 ASSERT(!m_injectedScriptInstrumentationCookies.isEmpty()); 475 ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextFromExecState(scriptState); 475 476 InspectorInstrumentationCookie cookie = m_injectedScriptInstrumentationCookies.takeLast(); 476 InspectorInstrumentation::didCallFunction(cookie );477 InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext); 477 478 } 478 479 -
trunk/Source/WebCore/inspector/InspectorController.h
r163024 r163139 140 140 virtual Inspector::InspectorEvaluateHandler evaluateHandler() const override; 141 141 virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) override; 142 virtual void didCallInjectedScriptFunction( ) override;142 virtual void didCallInjectedScriptFunction(JSC::ExecState*) override; 143 143 144 144 private: -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r163079 r163139 317 317 } 318 318 319 void InspectorInstrumentation::didCallFunctionImpl(const InspectorInstrumentationCookie& cookie )319 void InspectorInstrumentation::didCallFunctionImpl(const InspectorInstrumentationCookie& cookie, ScriptExecutionContext* context) 320 320 { 321 321 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 322 timelineAgent->didCallFunction( );322 timelineAgent->didCallFunction(frameForScriptExecutionContext(context)); 323 323 } 324 324 … … 395 395 } 396 396 397 void InspectorInstrumentation::didEvaluateScriptImpl(const InspectorInstrumentationCookie& cookie )397 void InspectorInstrumentation::didEvaluateScriptImpl(const InspectorInstrumentationCookie& cookie, Frame* frame) 398 398 { 399 399 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 400 timelineAgent->didEvaluateScript( );400 timelineAgent->didEvaluateScript(frame); 401 401 } 402 402 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r163079 r163139 130 130 131 131 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine); 132 static void didCallFunction(const InspectorInstrumentationCookie& );132 static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 133 133 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*); 134 134 static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&); … … 140 140 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&); 141 141 static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber); 142 static void didEvaluateScript(const InspectorInstrumentationCookie& );142 static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame*); 143 143 static void scriptsEnabled(Page*, bool isEnabled); 144 144 static void didCreateIsolatedContext(Frame*, JSC::ExecState*, SecurityOrigin*); … … 314 314 315 315 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*); 316 static void didCallFunctionImpl(const InspectorInstrumentationCookie& );316 static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*); 317 317 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*); 318 318 static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&); … … 324 324 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&); 325 325 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, const String& url, int lineNumber, Frame*); 326 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie& );326 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame*); 327 327 static void scriptsEnabledImpl(InstrumentingAgents*, bool isEnabled); 328 328 static void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, JSC::ExecState*, SecurityOrigin*); … … 824 824 825 825 826 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie )826 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie, ScriptExecutionContext* context) 827 827 { 828 828 #if ENABLE(INSPECTOR) 829 829 FAST_RETURN_IF_NO_FRONTENDS(void()); 830 830 if (cookie.isValid()) 831 didCallFunctionImpl(cookie );831 didCallFunctionImpl(cookie, context); 832 832 #else 833 833 UNUSED_PARAM(cookie); 834 UNUSED_PARAM(context); 834 835 #endif 835 836 } … … 947 948 } 948 949 949 inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie )950 inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie, Frame* frame) 950 951 { 951 952 #if ENABLE(INSPECTOR) 952 953 FAST_RETURN_IF_NO_FRONTENDS(void()); 953 954 if (cookie.isValid()) 954 didEvaluateScriptImpl(cookie );955 didEvaluateScriptImpl(cookie, frame); 955 956 #else 956 957 UNUSED_PARAM(cookie); 958 UNUSED_PARAM(frame); 957 959 #endif 958 960 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r162676 r163139 52 52 #include "ResourceRequest.h" 53 53 #include "ResourceResponse.h" 54 #include "ScriptProfiler.h" 54 55 #include "TimelineRecordFactory.h" 55 56 #include <wtf/CurrentTime.h> … … 138 139 { 139 140 pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame); 140 } 141 142 void InspectorTimelineAgent::didCallFunction() 143 { 141 142 if (frame && !m_recordingProfile) { 143 m_recordingProfile = true; 144 ScriptProfiler::start(toJSDOMWindow(frame, debuggerWorld())->globalExec(), ASCIILiteral("Timeline FunctionCall")); 145 } 146 } 147 148 void InspectorTimelineAgent::didCallFunction(Frame* frame) 149 { 150 if (frame && m_recordingProfile) { 151 if (m_recordStack.isEmpty()) 152 return; 153 154 TimelineRecordEntry& entry = m_recordStack.last(); 155 ASSERT(entry.type == TimelineRecordType::FunctionCall); 156 157 RefPtr<ScriptProfile> profile = ScriptProfiler::stop(toJSDOMWindow(frame, debuggerWorld())->globalExec(), ASCIILiteral("Timeline FunctionCall")); 158 TimelineRecordFactory::appendProfile(entry.data.get(), profile.release()); 159 160 m_recordingProfile = false; 161 } 162 144 163 didCompleteCurrentRecord(TimelineRecordType::FunctionCall); 145 164 } … … 300 319 { 301 320 pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true, frame); 302 } 303 304 void InspectorTimelineAgent::didEvaluateScript() 305 { 321 322 if (frame && !m_recordingProfile) { 323 m_recordingProfile = true; 324 ScriptProfiler::start(toJSDOMWindow(frame, debuggerWorld())->globalExec(), ASCIILiteral("Timeline EvaluateScript")); 325 } 326 } 327 328 void InspectorTimelineAgent::didEvaluateScript(Frame* frame) 329 { 330 if (frame && m_recordingProfile) { 331 if (m_recordStack.isEmpty()) 332 return; 333 334 TimelineRecordEntry& entry = m_recordStack.last(); 335 ASSERT(entry.type == TimelineRecordType::EvaluateScript); 336 337 RefPtr<ScriptProfile> profile = ScriptProfiler::stop(toJSDOMWindow(frame, debuggerWorld())->globalExec(), ASCIILiteral("Timeline EvaluateScript")); 338 TimelineRecordFactory::appendProfile(entry.data.get(), profile.release()); 339 340 m_recordingProfile = false; 341 } 342 306 343 didCompleteCurrentRecord(TimelineRecordType::EvaluateScript); 307 344 } … … 593 630 , m_enabled(false) 594 631 , m_includeDOMCounters(false) 632 , m_recordingProfile(false) 595 633 { 596 634 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r162676 r163139 146 146 // Methods called from WebCore. 147 147 void willCallFunction(const String& scriptName, int scriptLine, Frame*); 148 void didCallFunction( );148 void didCallFunction(Frame*); 149 149 150 150 void willDispatchEvent(const Event&, Frame*); … … 185 185 186 186 void willEvaluateScript(const String&, int, Frame*); 187 void didEvaluateScript( );187 void didEvaluateScript(Frame*); 188 188 189 189 void didTimeStamp(Frame*, const String&); … … 269 269 bool m_enabled; 270 270 bool m_includeDOMCounters; 271 bool m_recordingProfile; 271 272 }; 272 273 -
trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp
r160457 r163139 43 43 #include "ScriptCallStack.h" 44 44 #include "ScriptCallStackFactory.h" 45 #include "ScriptProfile.h" 45 46 #include <inspector/InspectorValues.h> 46 47 #include <wtf/CurrentTime.h> … … 252 253 } 253 254 255 void TimelineRecordFactory::appendProfile(InspectorObject* data, PassRefPtr<ScriptProfile> profile) 256 { 257 data->setValue("profile", profile->buildInspectorObjectForHead()); 258 } 259 254 260 } // namespace WebCore 255 261 -
trunk/Source/WebCore/inspector/TimelineRecordFactory.h
r160457 r163139 43 43 class ResourceRequest; 44 44 class ResourceResponse; 45 class ScriptProfile; 45 46 46 47 class TimelineRecordFactory { … … 93 94 static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&); 94 95 96 static void appendProfile(Inspector::InspectorObject*, PassRefPtr<ScriptProfile>); 97 95 98 #if ENABLE(WEB_SOCKETS) 96 99 static inline PassRefPtr<Inspector::InspectorObject> createWebSocketCreateData(unsigned long identifier, const URL& url, const String& protocol) -
trunk/Source/WebCore/inspector/WorkerInspectorController.cpp
r163024 r163139 167 167 } 168 168 169 void WorkerInspectorController::didCallInjectedScriptFunction( )169 void WorkerInspectorController::didCallInjectedScriptFunction(JSC::ExecState* scriptState) 170 170 { 171 171 ASSERT(!m_injectedScriptInstrumentationCookies.isEmpty()); 172 ScriptExecutionContext* scriptExecutionContext = scriptExecutionContextFromExecState(scriptState); 172 173 InspectorInstrumentationCookie cookie = m_injectedScriptInstrumentationCookies.takeLast(); 173 InspectorInstrumentation::didCallFunction(cookie );174 InspectorInstrumentation::didCallFunction(cookie, scriptExecutionContext); 174 175 } 175 176 -
trunk/Source/WebCore/inspector/WorkerInspectorController.h
r163024 r163139 73 73 virtual Inspector::InspectorEvaluateHandler evaluateHandler() const override; 74 74 virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) override; 75 virtual void didCallInjectedScriptFunction( ) override;75 virtual void didCallInjectedScriptFunction(JSC::ExecState*) override; 76 76 77 77 private:
Note: See TracChangeset
for help on using the changeset viewer.