Changeset 202196 in webkit
- Timestamp:
- Jun 17, 2016, 8:33:19 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202195 r202196 1 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202152. 4 https://bugs.webkit.org/show_bug.cgi?id=158897 5 6 The new test is very unstable, timing out frequently 7 (Requested by ap on #webkit). 8 9 Reverted changeset: 10 11 "Web Inspector: console.profile should use the new Sampling 12 Profiler" 13 https://bugs.webkit.org/show_bug.cgi?id=153499 14 http://trac.webkit.org/changeset/202152 15 1 16 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/JavaScriptCore/ChangeLog
r202157 r202196 1 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202152. 4 https://bugs.webkit.org/show_bug.cgi?id=158897 5 6 The new test is very unstable, timing out frequently 7 (Requested by ap on #webkit). 8 9 Reverted changeset: 10 11 "Web Inspector: console.profile should use the new Sampling 12 Profiler" 13 https://bugs.webkit.org/show_bug.cgi?id=153499 14 http://trac.webkit.org/changeset/202152 15 1 16 2016-06-14 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/debugger/Debugger.h
r202152 r202196 79 79 void activateBreakpoints() { setBreakpointsActivated(true); } 80 80 void deactivateBreakpoints() { setBreakpointsActivated(false); } 81 bool breakpointsActive() const { return m_breakpointsActivated; }82 81 83 82 enum PauseOnExceptionsState { -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp
r202152 r202196 29 29 #include "ConsoleMessage.h" 30 30 #include "InspectorConsoleAgent.h" 31 #include "InspectorDebuggerAgent.h"32 #include "InspectorScriptProfilerAgent.h"33 31 #include "ScriptArguments.h" 34 32 #include "ScriptCallStack.h" … … 55 53 } 56 54 57 JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent , InspectorDebuggerAgent* debuggerAgent, InspectorScriptProfilerAgent* scriptProfilerAgent)55 JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent) 58 56 : ConsoleClient() 59 57 , m_consoleAgent(consoleAgent) 60 , m_debuggerAgent(debuggerAgent)61 , m_scriptProfilerAgent(scriptProfilerAgent)62 58 { 63 59 } … … 78 74 } 79 75 80 void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String& title)76 void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String&) 81 77 { 82 if (!m_consoleAgent->enabled()) 83 return; 84 85 // Allow duplicate unnamed profiles. Disallow duplicate named profiles. 86 if (!title.isEmpty()) { 87 for (auto& existingTitle : m_profiles) { 88 if (existingTitle == title) { 89 // FIXME: Send an enum to the frontend for localization? 90 String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists"); 91 m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning)); 92 return; 93 } 94 } 95 } 96 97 m_profiles.append(title); 98 startConsoleProfile(); 78 // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466> 99 79 } 100 80 101 void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String& title)81 void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String&) 102 82 { 103 if (!m_consoleAgent->enabled()) 104 return; 105 106 // Stop profiles in reverse order. If the title is empty, then stop the last profile. 107 // Otherwise, match the title of the profile to stop. 108 for (ptrdiff_t i = m_profiles.size() - 1; i >= 0; --i) { 109 if (title.isEmpty() || m_profiles[i] == title) { 110 m_profiles.remove(i); 111 if (m_profiles.isEmpty()) 112 stopConsoleProfile(); 113 return; 114 } 115 } 116 117 // FIXME: Send an enum to the frontend for localization? 118 String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist"); 119 m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning)); 120 } 121 122 void JSGlobalObjectConsoleClient::startConsoleProfile() 123 { 124 // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection 125 m_scriptProfilerAgent->programmaticCaptureStarted(); 126 127 m_profileRestoreBreakpointActiveValue = m_debuggerAgent->breakpointsActive(); 128 129 ErrorString unused; 130 m_debuggerAgent->setBreakpointsActive(unused, false); 131 132 const bool includeSamples = true; 133 m_scriptProfilerAgent->startTracking(unused, &includeSamples); 134 } 135 136 void JSGlobalObjectConsoleClient::stopConsoleProfile() 137 { 138 ErrorString unused; 139 m_scriptProfilerAgent->stopTracking(unused); 140 141 m_debuggerAgent->setBreakpointsActive(unused, m_profileRestoreBreakpointActiveValue); 142 143 // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection 144 m_scriptProfilerAgent->programmaticCaptureStopped(); 83 // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466> 145 84 } 146 85 -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h
r202152 r202196 24 24 */ 25 25 26 #pragma once 26 #ifndef JSGlobalObjectConsoleClient_h 27 #define JSGlobalObjectConsoleClient_h 27 28 28 29 #include "ConsoleClient.h" 29 #include <wtf/Vector.h>30 #include <wtf/text/WTFString.h>31 30 32 31 namespace Inspector { 33 32 34 33 class InspectorConsoleAgent; 35 class InspectorDebuggerAgent;36 class InspectorScriptProfilerAgent;37 34 38 35 class JSGlobalObjectConsoleClient final : public JSC::ConsoleClient { 39 36 WTF_MAKE_FAST_ALLOCATED; 40 37 public: 41 explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent* , InspectorDebuggerAgent*, InspectorScriptProfilerAgent*);38 explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*); 42 39 virtual ~JSGlobalObjectConsoleClient() { } 43 40 … … 59 56 void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&); 60 57 61 void startConsoleProfile();62 void stopConsoleProfile();63 64 58 InspectorConsoleAgent* m_consoleAgent; 65 InspectorDebuggerAgent* m_debuggerAgent;66 InspectorScriptProfilerAgent* m_scriptProfilerAgent;67 Vector<String> m_profiles;68 bool m_profileRestoreBreakpointActiveValue { false };69 59 }; 70 60 71 61 } 62 63 #endif // !defined(JSGlobalObjectConsoleClient_h) -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
r202152 r202196 89 89 auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(context, heapAgent.get()); 90 90 auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(context, consoleAgent.get()); 91 auto scriptProfilerAgent = std::make_unique<InspectorScriptProfilerAgent>(context);92 91 93 92 m_inspectorAgent = inspectorAgent.get(); 94 93 m_debuggerAgent = debuggerAgent.get(); 95 94 m_consoleAgent = consoleAgent.get(); 96 m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent , m_debuggerAgent, scriptProfilerAgent.get());95 m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent); 97 96 98 97 m_agents.append(WTFMove(inspectorAgent)); … … 101 100 m_agents.append(WTFMove(debuggerAgent)); 102 101 m_agents.append(WTFMove(heapAgent)); 103 m_agents.append( WTFMove(scriptProfilerAgent));102 m_agents.append(std::make_unique<InspectorScriptProfilerAgent>(context)); 104 103 105 104 m_executionStopwatch->start(); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r202152 r202196 126 126 } 127 127 128 bool InspectorDebuggerAgent::breakpointsActive() const129 {130 return m_scriptDebugServer.breakpointsActive();131 }132 133 128 void InspectorDebuggerAgent::setBreakpointsActive(ErrorString&, bool active) 134 129 { … … 139 134 } 140 135 141 bool InspectorDebuggerAgent::isPaused() const136 bool InspectorDebuggerAgent::isPaused() 142 137 { 143 138 return m_scriptDebugServer.isPaused(); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
r202152 r202196 84 84 void setOverlayMessage(ErrorString&, const String*) override; 85 85 86 bool isPaused() const; 87 bool breakpointsActive() const; 86 bool isPaused(); 88 87 89 88 void setSuppressAllPauses(bool); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.cpp
r202152 r202196 217 217 } 218 218 219 void InspectorScriptProfilerAgent::programmaticCaptureStarted()220 {221 m_frontendDispatcher->programmaticCaptureStarted();222 }223 224 void InspectorScriptProfilerAgent::programmaticCaptureStopped()225 {226 m_frontendDispatcher->programmaticCaptureStopped();227 }228 229 219 } // namespace Inspector -
trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.h
r202152 r202196 54 54 void stopTracking(ErrorString&) override; 55 55 56 void programmaticCaptureStarted();57 void programmaticCaptureStopped();58 59 56 // Debugger::ProfilingClient 60 57 bool isAlreadyProfiling() const override; -
trunk/Source/JavaScriptCore/inspector/protocol/ScriptProfiler.json
r202152 r202196 87 87 { "name": "samples", "$ref": "Samples", "optional": true, "description": "Stack traces." } 88 88 ] 89 },90 {91 "name": "programmaticCaptureStarted",92 "description": "Fired when programmatic capture starts (console.profile). JSContext inspection only."93 },94 {95 "name": "programmaticCaptureStopped",96 "description": "Fired when programmatic capture stops (console.profileEnd). JSContext inspection only."97 89 } 98 90 ] -
trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json
r202152 r202196 106 106 "name": "autoCaptureStarted", 107 107 "description": "Fired when auto capture started." 108 },109 {110 "name": "programmaticCaptureStarted",111 "description": "Fired when programmatic capture starts (console.profile)."112 },113 {114 "name": "programmaticCaptureStopped",115 "description": "Fired when programmatic capture stops (console.profileEnd)."116 108 } 117 109 ] -
trunk/Source/WebCore/ChangeLog
r202195 r202196 1 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202152. 4 https://bugs.webkit.org/show_bug.cgi?id=158897 5 6 The new test is very unstable, timing out frequently 7 (Requested by ap on #webkit). 8 9 Reverted changeset: 10 11 "Web Inspector: console.profile should use the new Sampling 12 Profiler" 13 https://bugs.webkit.org/show_bug.cgi?id=153499 14 http://trac.webkit.org/changeset/202152 15 1 16 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r202152 r202196 44 44 #include "ScriptState.h" 45 45 #include "TimelineRecordFactory.h" 46 #include "WebConsoleAgent.h"47 #include <inspector/ConsoleMessage.h>48 46 #include <inspector/ScriptBreakpoint.h> 49 47 #include <inspector/agents/InspectorDebuggerAgent.h> … … 244 242 } 245 243 246 void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String& title) 247 { 248 // Allow duplicate unnamed profiles. Disallow duplicate named profiles. 249 if (!title.isEmpty()) { 250 for (const TimelineRecordEntry& record : m_pendingConsoleProfileRecords) { 251 String recordTitle; 252 record.data->getString(ASCIILiteral("title"), recordTitle); 253 if (recordTitle == title) { 254 if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) { 255 // FIXME: Send an enum to the frontend for localization? 256 String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists"); 257 consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning)); 258 } 259 return; 260 } 261 } 262 } 263 264 if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty()) 265 startProgrammaticCapture(); 266 267 m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec))); 268 } 269 270 void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& title) 271 { 272 // Stop profiles in reverse order. If the title is empty, then stop the last profile. 273 // Otherwise, match the title of the profile to stop. 274 for (int i = m_pendingConsoleProfileRecords.size() - 1; i >= 0; --i) { 275 const TimelineRecordEntry& record = m_pendingConsoleProfileRecords[i]; 276 277 String recordTitle; 278 record.data->getString(ASCIILiteral("title"), recordTitle); 279 if (title.isEmpty() || recordTitle == title) { 280 didCompleteRecordEntry(record); 281 m_pendingConsoleProfileRecords.remove(i); 282 283 if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty()) 284 stopProgrammaticCapture(); 285 286 return; 287 } 288 } 289 290 if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) { 291 // FIXME: Send an enum to the frontend for localization? 292 String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist"); 293 consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning)); 294 } 244 void InspectorTimelineAgent::startFromConsole(JSC::ExecState*, const String&) 245 { 246 // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler 247 } 248 249 void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String&) 250 { 251 // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler 295 252 } 296 253 … … 449 406 m_frontendDispatcher->autoCaptureStarted(); 450 407 451 toggleInstruments(InstrumentState::Start); 452 } 453 454 void InspectorTimelineAgent::startProgrammaticCapture() 455 { 456 ASSERT(!m_enabled); 457 458 // Disable breakpoints during programmatic capture. 459 if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) { 460 m_programmaticCaptureRestoreBreakpointActiveValue = debuggerAgent->breakpointsActive(); 461 if (m_programmaticCaptureRestoreBreakpointActiveValue) { 462 ErrorString unused; 463 debuggerAgent->setBreakpointsActive(unused, false); 464 } 465 } else 466 m_programmaticCaptureRestoreBreakpointActiveValue = false; 467 468 m_frontendDispatcher->programmaticCaptureStarted(); 469 470 toggleScriptProfilerInstrument(InstrumentState::Start); // Ensure JavaScript samping data. 471 toggleTimelineInstrument(InstrumentState::Start); // Ensure Console Profile event records. 472 toggleInstruments(InstrumentState::Start); // Any other instruments the frontend wants us to record. 473 } 474 475 void InspectorTimelineAgent::stopProgrammaticCapture() 476 { 477 ASSERT(m_enabled); 478 ASSERT(!m_enabledFromFrontend); 479 480 toggleInstruments(InstrumentState::Stop); 481 toggleTimelineInstrument(InstrumentState::Stop); 482 toggleScriptProfilerInstrument(InstrumentState::Stop); 483 484 // Re-enable breakpoints if they were enabled. 485 if (m_programmaticCaptureRestoreBreakpointActiveValue) { 486 if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) { 487 ErrorString unused; 488 debuggerAgent->setBreakpointsActive(unused, true); 489 } 490 } 491 492 m_frontendDispatcher->programmaticCaptureStopped(); 493 } 494 495 void InspectorTimelineAgent::toggleInstruments(InstrumentState state) 496 { 408 // Enable instruments. 497 409 for (auto instrumentType : m_instruments) { 498 410 switch (instrumentType) { 499 411 case Inspector::Protocol::Timeline::Instrument::ScriptProfiler: { 500 toggleScriptProfilerInstrument(state); 412 if (m_scriptProfilerAgent) { 413 ErrorString unused; 414 const bool includeSamples = true; 415 m_scriptProfilerAgent->startTracking(unused, &includeSamples); 416 } 501 417 break; 502 418 } 503 419 case Inspector::Protocol::Timeline::Instrument::Heap: { 504 toggleHeapInstrument(state); 420 if (m_heapAgent) { 421 ErrorString unused; 422 m_heapAgent->startTracking(unused); 423 } 505 424 break; 506 425 } 507 426 case Inspector::Protocol::Timeline::Instrument::Memory: { 508 toggleMemoryInstrument(state); 427 #if ENABLE(RESOURCE_USAGE) 428 if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) { 429 ErrorString unused; 430 memoryAgent->startTracking(unused); 431 } 432 #endif 509 433 break; 510 434 } 511 435 case Inspector::Protocol::Timeline::Instrument::Timeline: 512 toggleTimelineInstrument(state);436 internalStart(); 513 437 break; 514 438 } 515 439 } 516 }517 518 void InspectorTimelineAgent::toggleScriptProfilerInstrument(InstrumentState state)519 {520 if (m_scriptProfilerAgent) {521 ErrorString unused;522 if (state == InstrumentState::Start) {523 const bool includeSamples = true;524 m_scriptProfilerAgent->startTracking(unused, &includeSamples);525 } else526 m_scriptProfilerAgent->stopTracking(unused);527 }528 }529 530 void InspectorTimelineAgent::toggleHeapInstrument(InstrumentState state)531 {532 if (m_heapAgent) {533 ErrorString unused;534 if (state == InstrumentState::Start)535 m_heapAgent->startTracking(unused);536 else537 m_heapAgent->stopTracking(unused);538 }539 }540 541 void InspectorTimelineAgent::toggleMemoryInstrument(InstrumentState state)542 {543 #if ENABLE(RESOURCE_USAGE)544 if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) {545 ErrorString unused;546 if (state == InstrumentState::Start)547 memoryAgent->startTracking(unused);548 else549 memoryAgent->stopTracking(unused);550 }551 #else552 UNUSED_PARAM(state);553 #endif554 }555 556 void InspectorTimelineAgent::toggleTimelineInstrument(InstrumentState state)557 {558 if (state == InstrumentState::Start)559 internalStart();560 else561 internalStop();562 440 } 563 441 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r202152 r202196 154 154 void breakpointActionProbe(JSC::ExecState&, const Inspector::ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue result) final; 155 155 156 void startProgrammaticCapture();157 void stopProgrammaticCapture();158 159 enum class InstrumentState { Start, Stop };160 void toggleInstruments(InstrumentState);161 void toggleScriptProfilerInstrument(InstrumentState);162 void toggleHeapInstrument(InstrumentState);163 void toggleMemoryInstrument(InstrumentState);164 void toggleTimelineInstrument(InstrumentState);165 void disableBreakpoints();166 void enableBreakpoints();167 168 156 friend class TimelineRecordStack; 169 157 … … 213 201 214 202 Vector<TimelineRecordEntry> m_recordStack; 215 Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;216 203 217 204 int m_id { 1 }; … … 220 207 bool m_enabled { false }; 221 208 bool m_enabledFromFrontend { false }; 222 bool m_programmaticCaptureRestoreBreakpointActiveValue { false };223 209 224 210 bool m_autoCaptureEnabled { false }; -
trunk/Source/WebInspectorUI/ChangeLog
r202152 r202196 1 2016-06-17 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202152. 4 https://bugs.webkit.org/show_bug.cgi?id=158897 5 6 The new test is very unstable, timing out frequently 7 (Requested by ap on #webkit). 8 9 Reverted changeset: 10 11 "Web Inspector: console.profile should use the new Sampling 12 Profiler" 13 https://bugs.webkit.org/show_bug.cgi?id=153499 14 http://trac.webkit.org/changeset/202152 15 1 16 2016-06-16 Joseph Pecoraro <pecoraro@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r202152 r202196 263 263 } 264 264 265 autoCaptureStarted( )265 autoCaptureStarted(startTime) 266 266 { 267 267 // Called from WebInspector.TimelineObserver. … … 273 273 // between sending the Timeline.start command and receiving Timeline.capturingStarted event. 274 274 // In that case, there is no need to call startCapturing again. Reuse the fresh recording. 275 if (!this._waitingForCapturingStartedEvent) { 276 const createNewRecording = true; 277 this.startCapturing(createNewRecording); 278 } 275 if (!this._waitingForCapturingStartedEvent) 276 this.startCapturing(true); 279 277 280 278 this._shouldSetAutoCapturingMainResource = true; 281 }282 283 programmaticCaptureStarted()284 {285 // Called from WebInspector.TimelineObserver.286 287 this._activeRecording.addScriptInstrumentForProgrammaticCapture();288 289 const createNewRecording = false;290 this.startCapturing(createNewRecording);291 }292 293 programmaticCaptureStopped()294 {295 // Called from WebInspector.TimelineObserver.296 297 // FIXME: This is purely to avoid a noisy assert. Previously298 // it was impossible to stop without stopping from the UI.299 console.assert(!this._isCapturing);300 this._isCapturing = true;301 302 this.stopCapturing();303 279 } 304 280 … … 510 486 case TimelineAgent.EventType.ConsoleProfile: 511 487 var profileData = recordPayload.data.profile; 512 // COMPATIBILITY (iOS 9): With the Sampling Profiler, profiles no longer include legacy profile data. 513 console.assert(profileData || TimelineAgent.setInstruments); 488 console.assert(profileData); 514 489 return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.title, profileData); 515 490 … … 858 833 return WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated; 859 834 } 860 }861 862 scriptProfilerProgrammaticCaptureStarted()863 {864 // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection865 console.assert(WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript);866 console.assert(!this._isCapturing);867 868 this.programmaticCaptureStarted();869 }870 871 scriptProfilerProgrammaticCaptureStopped()872 {873 // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection874 console.assert(WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript);875 console.assert(this._isCapturing);876 877 this.programmaticCaptureStopped();878 835 } 879 836 -
trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js
r202152 r202196 57 57 ScriptProfilerAgent.stopTracking(); 58 58 } 59 59 60 }; -
trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
r202152 r202196 128 128 } 129 129 130 stop( programmatic)130 stop() 131 131 { 132 132 console.assert(this._capturing, "Attempted to stop an already stopped session."); … … 135 135 this._capturing = false; 136 136 137 if (!programmatic) { 138 for (let instrument of this._instruments) 139 instrument.stopInstrumentation(); 140 } 137 for (let instrument of this._instruments) 138 instrument.stopInstrumentation(); 141 139 } 142 140 … … 308 306 { 309 307 return this._discontinuities.filter((item) => item.startTime < endTime && item.endTime > startTime); 310 }311 312 addScriptInstrumentForProgrammaticCapture()313 {314 for (let instrument of this._instruments) {315 if (instrument instanceof WebInspector.ScriptInstrument)316 return;317 }318 319 this.addInstrument(new WebInspector.ScriptInstrument);320 321 let instrumentTypes = this._instruments.map((instrument) => instrument.timelineRecordType);322 WebInspector.timelineManager.enabledTimelineTypes = instrumentTypes;323 308 } 324 309 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js
r202152 r202196 42 42 WebInspector.timelineManager.scriptProfilerTrackingCompleted(samples); 43 43 } 44 45 programmaticCaptureStarted()46 {47 WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStarted();48 }49 50 programmaticCaptureStopped()51 {52 WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStopped();53 }54 44 }; -
trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js
r202152 r202196 47 47 WebInspector.timelineManager.autoCaptureStarted(); 48 48 } 49 50 programmaticCaptureStarted()51 {52 WebInspector.timelineManager.programmaticCaptureStarted();53 }54 55 programmaticCaptureStopped()56 {57 WebInspector.timelineManager.programmaticCaptureStopped();58 }59 49 };
Note:
See TracChangeset
for help on using the changeset viewer.