<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174322] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174322">174322</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-10-04 14:55:58 -0700 (Sat, 04 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/174319">r174319</a>.
Causes assertions in fast/profiler tests. Needs nontrivial
investigation, will take offline.
Reverted changeset:
"Web Inspector: timelines should not count time elapsed while
paused in the debugger"
https://bugs.webkit.org/show_bug.cgi?id=136351
http://trac.webkit.org/changeset/174319</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSProfilerPrivatecpp">trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerLegacyProfilercpp">trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerLegacyProfilerh">trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileGeneratorcpp">trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileGeneratorh">trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFWTFvcxprojWTFvcxproj">trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj</a></li>
<li><a href="#trunkSourceWTFWTFvcxprojWTFvcxprojfilters">trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters</a></li>
<li><a href="#trunkSourceWTFWTFxcodeprojprojectpbxproj">trunk/Source/WTF/WTF.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWTFwtfCMakeListstxt">trunk/Source/WTF/wtf/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgenth">trunk/Source/WebCore/inspector/InspectorPageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgenth">trunk/Source/WebCore/inspector/InspectorResourceAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactorycpp">trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfStopwatchh">trunk/Source/WTF/wtf/Stopwatch.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSProfilerPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">
</span><span class="cx"> void JSStartProfiling(JSContextRef ctx, JSStringRef title)
</span><span class="cx"> {
</span><del>- LegacyProfiler::profiler()->startProfiling(toJS(ctx), title->string(), Stopwatch::create());
</del><ins>+ LegacyProfiler::profiler()->startProfiling(toJS(ctx), title->string());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSEndProfiling(JSContextRef ctx, JSStringRef title)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling out r174319.
+
+ Causes assertions in fast/profiler tests. Needs nontrivial
+ investigation, will take offline.
+
+ Reverted changeset:
+
+ "Web Inspector: timelines should not count time elapsed while
+ paused in the debugger"
+ https://bugs.webkit.org/show_bug.cgi?id=136351
+ http://trac.webkit.org/changeset/174319
+
+2014-10-04 Brian J. Burg <burg@cs.washington.edu>
+
</ins><span class="cx"> Web Inspector: timelines should not count time elapsed while paused in the debugger
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=136351
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include "JSJavaScriptCallFrame.h"
</span><span class="cx"> #include "JSLock.h"
</span><span class="cx"> #include "JavaScriptCallFrame.h"
</span><ins>+#include "LegacyProfiler.h"
</ins><span class="cx"> #include "ScriptValue.h"
</span><span class="cx"> #include "SourceProvider.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="lines">@@ -306,12 +307,14 @@
</span><span class="cx"> void ScriptDebugServer::handlePause(Debugger::ReasonForPause, JSGlobalObject* vmEntryGlobalObject)
</span><span class="cx"> {
</span><span class="cx"> dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause);
</span><ins>+ LegacyProfiler::profiler()->didPause(currentDebuggerCallFrame());
</ins><span class="cx"> didPause(vmEntryGlobalObject);
</span><span class="cx">
</span><span class="cx"> m_doneProcessingDebuggerEvents = false;
</span><span class="cx"> runEventLoopWhilePaused();
</span><span class="cx">
</span><span class="cx"> didContinue(vmEntryGlobalObject);
</span><ins>+ LegacyProfiler::profiler()->didContinue(currentDebuggerCallFrame());
</ins><span class="cx"> dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerLegacyProfilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include "CallFrame.h"
</span><span class="cx"> #include "CodeBlock.h"
</span><span class="cx"> #include "CommonIdentifiers.h"
</span><ins>+#include "DebuggerCallFrame.h"
</ins><span class="cx"> #include "InternalFunction.h"
</span><span class="cx"> #include "JSFunction.h"
</span><span class="cx"> #include "JSGlobalObject.h"
</span><span class="lines">@@ -49,16 +50,16 @@
</span><span class="cx">
</span><span class="cx"> static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
</span><span class="cx">
</span><del>-LegacyProfiler* LegacyProfiler::s_sharedLegacyProfiler = nullptr;
</del><ins>+LegacyProfiler* LegacyProfiler::s_sharedLegacyProfiler = 0;
</ins><span class="cx">
</span><span class="cx"> LegacyProfiler* LegacyProfiler::profiler()
</span><span class="cx"> {
</span><span class="cx"> if (!s_sharedLegacyProfiler)
</span><span class="cx"> s_sharedLegacyProfiler = new LegacyProfiler();
</span><span class="cx"> return s_sharedLegacyProfiler;
</span><del>-}
</del><ins>+}
</ins><span class="cx">
</span><del>-void LegacyProfiler::startProfiling(ExecState* exec, const String& title, PassRefPtr<Stopwatch> stopwatch)
</del><ins>+void LegacyProfiler::startProfiling(ExecState* exec, const String& title)
</ins><span class="cx"> {
</span><span class="cx"> if (!exec)
</span><span class="cx"> return;
</span><span class="lines">@@ -74,14 +75,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> exec->vm().setEnabledProfiler(this);
</span><del>- RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(exec, title, ++ProfilesUID, stopwatch);
</del><ins>+ RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(exec, title, ++ProfilesUID);
</ins><span class="cx"> m_currentProfiles.append(profileGenerator);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Profile> LegacyProfiler::stopProfiling(ExecState* exec, const String& title)
</span><span class="cx"> {
</span><span class="cx"> if (!exec)
</span><del>- return nullptr;
</del><ins>+ return 0;
</ins><span class="cx">
</span><span class="cx"> JSGlobalObject* origin = exec->lexicalGlobalObject();
</span><span class="cx"> for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
</span><span class="lines">@@ -93,12 +94,12 @@
</span><span class="cx"> m_currentProfiles.remove(i);
</span><span class="cx"> if (!m_currentProfiles.size())
</span><span class="cx"> exec->vm().setEnabledProfiler(nullptr);
</span><del>-
</del><ins>+
</ins><span class="cx"> return returnProfile;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return nullptr;
</del><ins>+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void LegacyProfiler::stopProfiling(JSGlobalObject* origin)
</span><span class="lines">@@ -183,6 +184,28 @@
</span><span class="cx"> callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::exceptionUnwind, std::placeholders::_1, handlerCallFrame, callIdentifier), m_currentProfiles, handlerCallFrame->lexicalGlobalObject()->profileGroup());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void LegacyProfiler::didPause(PassRefPtr<DebuggerCallFrame> prpCallFrame)
+{
+ if (m_currentProfiles.isEmpty())
+ return;
+
+ RefPtr<DebuggerCallFrame> callFrame = prpCallFrame;
+ CallIdentifier callIdentifier = createCallIdentifier(callFrame->exec(), JSValue(), StringImpl::empty(), 0, 0);
+
+ callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::didPause, std::placeholders::_1, callFrame, callIdentifier), m_currentProfiles, callFrame->vmEntryGlobalObject()->profileGroup());
+}
+
+void LegacyProfiler::didContinue(PassRefPtr<DebuggerCallFrame> prpCallFrame)
+{
+ if (m_currentProfiles.isEmpty())
+ return;
+
+ RefPtr<DebuggerCallFrame> callFrame = prpCallFrame;
+ CallIdentifier callIdentifier = createCallIdentifier(callFrame->exec(), JSValue(), StringImpl::empty(), 0, 0);
+
+ callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::didContinue, std::placeholders::_1, callFrame, callIdentifier), m_currentProfiles, callFrame->vmEntryGlobalObject()->profileGroup());
+}
+
</ins><span class="cx"> CallIdentifier LegacyProfiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
</span><span class="cx"> {
</span><span class="cx"> if (!functionValue)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerLegacyProfilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -32,12 +32,13 @@
</span><span class="cx"> #include "Profile.h"
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><del>-#include <wtf/Stopwatch.h>
</del><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><ins>+class DebuggerCallFrame;
</ins><span class="cx"> class ExecState;
</span><ins>+class VM;
</ins><span class="cx"> class JSGlobalObject;
</span><span class="cx"> class JSObject;
</span><span class="cx"> class JSValue;
</span><span class="lines">@@ -47,10 +48,10 @@
</span><span class="cx"> class LegacyProfiler {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- JS_EXPORT_PRIVATE static LegacyProfiler* profiler();
</del><ins>+ JS_EXPORT_PRIVATE static LegacyProfiler* profiler();
</ins><span class="cx"> static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
</span><span class="cx">
</span><del>- JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title, PassRefPtr<Stopwatch>);
</del><ins>+ JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title);
</ins><span class="cx"> JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
</span><span class="cx"> void stopProfiling(JSGlobalObject*);
</span><span class="cx">
</span><span class="lines">@@ -65,6 +66,9 @@
</span><span class="cx">
</span><span class="cx"> void exceptionUnwind(ExecState* handlerCallFrame);
</span><span class="cx">
</span><ins>+ void didPause(PassRefPtr<DebuggerCallFrame>);
+ void didContinue(PassRefPtr<DebuggerCallFrame>);
+
</ins><span class="cx"> const Vector<RefPtr<ProfileGenerator>>& currentProfiles() { return m_currentProfiles; };
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "CallFrame.h"
</span><span class="cx"> #include "CodeBlock.h"
</span><ins>+#include "Debugger.h"
</ins><span class="cx"> #include "JSGlobalObject.h"
</span><span class="cx"> #include "JSStringRef.h"
</span><span class="cx"> #include "JSFunction.h"
</span><span class="lines">@@ -39,18 +40,21 @@
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="cx">
</span><del>-PassRefPtr<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
</del><ins>+PassRefPtr<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ProfileGenerator(exec, title, uid, stopwatch));
</del><ins>+ return adoptRef(new ProfileGenerator(exec, title, uid));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
</del><ins>+ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid)
</ins><span class="cx"> : m_origin(exec ? exec->lexicalGlobalObject() : nullptr)
</span><span class="cx"> , m_profileGroup(exec ? exec->lexicalGlobalObject()->profileGroup() : 0)
</span><del>- , m_stopwatch(stopwatch)
</del><ins>+ , m_debuggerPausedTimestamp(NAN)
</ins><span class="cx"> , m_foundConsoleStartParent(false)
</span><span class="cx"> , m_suspended(false)
</span><span class="cx"> {
</span><ins>+ if (Debugger* debugger = exec->lexicalGlobalObject()->debugger())
+ m_debuggerPausedTimestamp = debugger->isPaused() ? currentTime() : NAN;
+
</ins><span class="cx"> m_profile = Profile::create(title, uid);
</span><span class="cx"> m_currentNode = m_rootNode = m_profile->rootNode();
</span><span class="cx"> if (exec)
</span><span class="lines">@@ -114,8 +118,13 @@
</span><span class="cx"> ASSERT_ARG(node, node);
</span><span class="cx">
</span><span class="cx"> if (isnan(startTime))
</span><del>- startTime = m_stopwatch->elapsedTime();
</del><ins>+ startTime = currentTime();
</ins><span class="cx">
</span><ins>+ // If the debugger is paused when beginning, then don't set the start time. It
+ // will be fixed up when the debugger unpauses or the call entry ends.
+ if (!isnan(m_debuggerPausedTimestamp))
+ startTime = NAN;
+
</ins><span class="cx"> node->appendCall(ProfileNode::Call(startTime));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -124,8 +133,22 @@
</span><span class="cx"> ASSERT_ARG(node, node);
</span><span class="cx">
</span><span class="cx"> ProfileNode::Call& last = node->lastCall();
</span><ins>+
+ // If the debugger is paused, ignore the interval that ends now.
+ if (!isnan(m_debuggerPausedTimestamp) && !isnan(last.elapsedTime()))
+ return;
+
+ // If paused and no time was accrued then the debugger was never unpaused. The call will
+ // have no time accrued and appear to have started when the debugger was paused.
+ if (!isnan(m_debuggerPausedTimestamp)) {
+ last.setStartTime(m_debuggerPausedTimestamp);
+ last.setElapsedTime(0.0);
+ return;
+ }
+
+ // Otherwise, add the interval ending now to elapsed time.
</ins><span class="cx"> double previousElapsedTime = isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
</span><del>- double newlyElapsedTime = m_stopwatch->elapsedTime() - last.startTime();
</del><ins>+ double newlyElapsedTime = currentTime() - last.startTime();
</ins><span class="cx"> last.setElapsedTime(previousElapsedTime + newlyElapsedTime);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -200,6 +223,33 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void ProfileGenerator::didPause(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&)
+{
+ ASSERT(isnan(m_debuggerPausedTimestamp));
+
+ m_debuggerPausedTimestamp = currentTime();
+
+ for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent()) {
+ ProfileNode::Call& last = node->lastCall();
+ ASSERT(!isnan(last.startTime()));
+
+ double previousElapsedTime = isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
+ double additionalElapsedTime = m_debuggerPausedTimestamp - last.startTime();
+ last.setStartTime(NAN);
+ last.setElapsedTime(previousElapsedTime + additionalElapsedTime);
+ }
+}
+
+void ProfileGenerator::didContinue(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&)
+{
+ ASSERT(!isnan(m_debuggerPausedTimestamp));
+
+ for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent())
+ node->lastCall().setStartTime(m_debuggerPausedTimestamp);
+
+ m_debuggerPausedTimestamp = NAN;
+}
+
</ins><span class="cx"> void ProfileGenerator::stopProfiling()
</span><span class="cx"> {
</span><span class="cx"> for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><del>-#include <wtf/Stopwatch.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -43,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> class ProfileGenerator : public RefCounted<ProfileGenerator> {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
</del><ins>+ static PassRefPtr<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid);
</ins><span class="cx">
</span><span class="cx"> // Members
</span><span class="cx"> const WTF::String& title() const;
</span><span class="lines">@@ -55,12 +54,15 @@
</span><span class="cx"> void didExecute(ExecState* callerCallFrame, const CallIdentifier&);
</span><span class="cx"> void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&);
</span><span class="cx">
</span><ins>+ void didPause(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&);
+ void didContinue(PassRefPtr<DebuggerCallFrame>, const CallIdentifier&);
+
</ins><span class="cx"> void setIsSuspended(bool suspended) { ASSERT(m_suspended != suspended); m_suspended = suspended; }
</span><span class="cx">
</span><span class="cx"> void stopProfiling();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- ProfileGenerator(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
</del><ins>+ ProfileGenerator(ExecState*, const WTF::String& title, unsigned uid);
</ins><span class="cx"> void addParentForConsoleStart(ExecState*);
</span><span class="cx">
</span><span class="cx"> void removeProfileStart();
</span><span class="lines">@@ -72,7 +74,8 @@
</span><span class="cx"> RefPtr<Profile> m_profile;
</span><span class="cx"> JSGlobalObject* m_origin;
</span><span class="cx"> unsigned m_profileGroup;
</span><del>- RefPtr<Stopwatch> m_stopwatch;
</del><ins>+ // Timestamp is set to NAN when the debugger is not currently paused.
+ double m_debuggerPausedTimestamp;
</ins><span class="cx"> RefPtr<ProfileNode> m_rootNode;
</span><span class="cx"> RefPtr<ProfileNode> m_currentNode;
</span><span class="cx"> bool m_foundConsoleStartParent;
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/ChangeLog        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling out r174319.
+
+ Causes assertions in fast/profiler tests. Needs nontrivial
+ investigation, will take offline.
+
+ Reverted changeset:
+
+ "Web Inspector: timelines should not count time elapsed while
+ paused in the debugger"
+ https://bugs.webkit.org/show_bug.cgi?id=136351
+ http://trac.webkit.org/changeset/174319
+
+2014-10-04 Brian J. Burg <burg@cs.washington.edu>
+
</ins><span class="cx"> Web Inspector: timelines should not count time elapsed while paused in the debugger
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=136351
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFWTFvcxprojWTFvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -269,7 +269,6 @@
</span><span class="cx"> <ClInclude Include="..\wtf\StackBounds.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\StaticConstructors.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\StdLibExtras.h" />
</span><del>- <ClInclude Include="..\wtf\Stopwatch.h" />
</del><span class="cx"> <ClInclude Include="..\wtf\StringExtras.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\StringHasher.h" />
</span><span class="cx"> <ClInclude Include="..\wtf\StringPrintStream.h" />
</span></span></pre></div>
<a id="trunkSourceWTFWTFvcxprojWTFvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -609,9 +609,6 @@
</span><span class="cx"> <ClInclude Include="..\wtf\StdLibExtras.h">
</span><span class="cx"> <Filter>wtf</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\wtf\Stopwatch.h">
- <Filter>wtf</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\wtf\StringExtras.h">
</span><span class="cx"> <Filter>wtf</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -272,7 +272,6 @@
</span><span class="cx">                 A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; };
</span><span class="cx">                 A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; };
</span><span class="cx">                 B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
</span><del>-                C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; };
</del><span class="cx">                 CD5497AC15857D0300B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497AA15857D0300B5BC30 /* MediaTime.cpp */; };
</span><span class="cx">                 CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; };
</span><span class="cx">                 CE46516E19DB1FB4003ECA05 /* NSMapTableSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */; };
</span><span class="lines">@@ -565,7 +564,6 @@
</span><span class="cx">                 A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
</span><span class="cx">                 B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
</span><del>-                C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
</del><span class="cx">                 CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSMapTableSPI.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -858,7 +856,6 @@
</span><span class="cx">                                 FEDACD3C1630F83F00C69634 /* StackStats.h */,
</span><span class="cx">                                 A8A47310151A825B004123FF /* StaticConstructors.h */,
</span><span class="cx">                                 A8A47311151A825B004123FF /* StdLibExtras.h */,
</span><del>-                                C4F8A93619C65EB400B2B15D /* Stopwatch.h */,
</del><span class="cx">                                 1A6BB768162F300500DD16DB /* StreamBuffer.h */,
</span><span class="cx">                                 A8A47313151A825B004123FF /* StringExtras.h */,
</span><span class="cx">                                 A748745117A0BDAE00FA04CB /* StringHashDumpContext.h */,
</span><span class="lines">@@ -1078,7 +1075,6 @@
</span><span class="cx">                                 A8A473A3151A825B004123FF /* DecimalNumber.h in Headers */,
</span><span class="cx">                                 0F2B66A617B6B4FB00A7AE3F /* DeferrableRefCounted.h in Headers */,
</span><span class="cx">                                 A8A473A5151A825B004123FF /* Deque.h in Headers */,
</span><del>-                                C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */,
</del><span class="cx">                                 A8A473A6151A825B004123FF /* DisallowCType.h in Headers */,
</span><span class="cx">                                 A8A473AF151A825B004123FF /* diy-fp.h in Headers */,
</span><span class="cx">                                 A8A473B1151A825B004123FF /* double-conversion.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CMakeLists.txt (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CMakeLists.txt        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/wtf/CMakeLists.txt        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -92,7 +92,6 @@
</span><span class="cx"> StackStats.h
</span><span class="cx"> StaticConstructors.h
</span><span class="cx"> StdLibExtras.h
</span><del>- Stopwatch.h
</del><span class="cx"> StringExtras.h
</span><span class="cx"> StringHasher.h
</span><span class="cx"> StringPrintStream.h
</span></span></pre></div>
<a id="trunkSourceWTFwtfStopwatchh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/Stopwatch.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Stopwatch.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WTF/wtf/Stopwatch.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -1,97 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 University of Washington. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Stopwatch_h
-#define Stopwatch_h
-
-#include <cmath>
-#include <wtf/CurrentTime.h>
-#include <wtf/RefCounted.h>
-
-namespace WTF {
-
-class Stopwatch : public RefCounted<Stopwatch> {
-public:
- static PassRefPtr<Stopwatch> create()
- {
- return adoptRef(new Stopwatch());
- }
-
- void reset();
- void start();
- void stop();
-
- double elapsedTime();
-
-private:
- Stopwatch()
- : m_elapsedTime(NAN)
- , m_lastStartTime(NAN)
- {
- }
-
- double m_elapsedTime;
- double m_lastStartTime;
-};
-
-inline void Stopwatch::reset()
-{
- m_elapsedTime = 0.0;
- m_lastStartTime = NAN;
-}
-
-inline void Stopwatch::start()
-{
- ASSERT(!isnan(m_elapsedTime) && isnan(m_lastStartTime));
-
- m_lastStartTime = monotonicallyIncreasingTime();
-}
-
-inline void Stopwatch::stop()
-{
- ASSERT(!isnan(m_elapsedTime) && !isnan(m_lastStartTime));
-
- m_elapsedTime += monotonicallyIncreasingTime() - m_lastStartTime;
- m_lastStartTime = NAN;
-}
-
-inline double Stopwatch::elapsedTime()
-{
- bool shouldSuspend = !isnan(m_lastStartTime);
- if (shouldSuspend)
- stop();
-
- ASSERT(!isnan(m_elapsedTime) && isnan(m_lastStartTime));
- double elapsedTime = m_elapsedTime;
-
- if (shouldSuspend)
- start();
- return elapsedTime;
-}
-
-} // namespace WTF
-
-using WTF::Stopwatch;
-
-#endif // Stopwatch_h
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/ChangeLog        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling out r174319.
+
+ Causes assertions in fast/profiler tests. Needs nontrivial
+ investigation, will take offline.
+
+ Reverted changeset:
+
+ "Web Inspector: timelines should not count time elapsed while
+ paused in the debugger"
+ https://bugs.webkit.org/show_bug.cgi?id=136351
+ http://trac.webkit.org/changeset/174319
+
+2014-10-04 Brian J. Burg <burg@cs.washington.edu>
+
</ins><span class="cx"> Web Inspector: timelines should not count time elapsed while paused in the debugger
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=136351
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx"> #include "WebKitNamedFlow.h"
</span><span class="cx"> #include <inspector/InspectorValues.h>
</span><ins>+#include <wtf/CurrentTime.h>
</ins><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx"> #include "InspectorDOMAgent.h"
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><span class="cx"> #include "InspectorOverlay.h"
</span><del>-#include "InspectorTimelineAgent.h"
</del><span class="cx"> #include "InspectorWebFrontendDispatchers.h"
</span><span class="cx"> #include "InstrumentingAgents.h"
</span><span class="cx"> #include "MainFrame.h"
</span><span class="lines">@@ -74,6 +73,7 @@
</span><span class="cx"> #include <inspector/ContentSearchUtilities.h>
</span><span class="cx"> #include <inspector/IdentifiersFactory.h>
</span><span class="cx"> #include <inspector/InspectorValues.h>
</span><ins>+#include <wtf/CurrentTime.h>
</ins><span class="cx"> #include <wtf/ListHashSet.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/Base64.h>
</span><span class="lines">@@ -361,16 +361,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double InspectorPageAgent::timestamp()
-{
- // If the timeline agent is recording now, use its stopwatch. Otherwise, just report 0.0
- // since the timestamps are only used to accurately graph records on the timeline.
- if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent())
- return timelineAgent->timestamp();
-
- return 0.0;
-}
-
</del><span class="cx"> void InspectorPageAgent::enable(ErrorString&)
</span><span class="cx"> {
</span><span class="cx"> m_enabled = true;
</span><span class="lines">@@ -762,12 +752,12 @@
</span><span class="cx"> void InspectorPageAgent::domContentEventFired()
</span><span class="cx"> {
</span><span class="cx"> m_isFirstLayoutAfterOnLoad = true;
</span><del>- m_frontendDispatcher->domContentEventFired(timestamp());
</del><ins>+ m_frontendDispatcher->domContentEventFired(currentTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorPageAgent::loadEventFired()
</span><span class="cx"> {
</span><del>- m_frontendDispatcher->loadEventFired(timestamp());
</del><ins>+ m_frontendDispatcher->loadEventFired(currentTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorPageAgent::frameNavigated(DocumentLoader* loader)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -167,8 +167,6 @@
</span><span class="cx"> void updateTouchEventEmulationInPage(bool);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- double timestamp();
-
</del><span class="cx"> static bool mainResourceContent(Frame*, bool withBase64Encode, String* result);
</span><span class="cx"> static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> #include "IconController.h"
</span><span class="cx"> #include "InspectorClient.h"
</span><span class="cx"> #include "InspectorPageAgent.h"
</span><del>-#include "InspectorTimelineAgent.h"
</del><span class="cx"> #include "InspectorWebFrontendDispatchers.h"
</span><span class="cx"> #include "InstrumentingAgents.h"
</span><span class="cx"> #include "JSMainThreadExecState.h"
</span><span class="lines">@@ -70,6 +69,7 @@
</span><span class="cx"> #include <inspector/InspectorValues.h>
</span><span class="cx"> #include <inspector/ScriptCallStack.h>
</span><span class="cx"> #include <inspector/ScriptCallStackFactory.h>
</span><ins>+#include <wtf/CurrentTime.h>
</ins><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="lines">@@ -276,16 +276,6 @@
</span><span class="cx"> ASSERT(!m_instrumentingAgents->inspectorResourceAgent());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-double InspectorResourceAgent::timestamp()
-{
- // If the timeline agent is recording now, use its stopwatch. Otherwise, just report 0.0
- // since the timestamps are only used to accurately graph records on the timeline.
- if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent())
- return timelineAgent->timestamp();
-
- return 0.0;
-}
-
</del><span class="cx"> void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
</span><span class="cx"> {
</span><span class="cx"> if (request.hiddenFromInspector()) {
</span><span class="lines">@@ -330,7 +320,7 @@
</span><span class="cx"> Inspector::Protocol::Page::ResourceType resourceType = InspectorPageAgent::resourceTypeJson(type);
</span><span class="cx">
</span><span class="cx"> RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader->frame() ? loader->frame()->document() : nullptr);
</span><del>- m_frontendDispatcher->requestWillBeSent(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), loader->url().string(), buildObjectForResourceRequest(request), timestamp(), initiatorObject, buildObjectForResourceResponse(redirectResponse, loader), type != InspectorPageAgent::OtherResource ? &resourceType : nullptr);
</del><ins>+ m_frontendDispatcher->requestWillBeSent(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), loader->url().string(), buildObjectForResourceRequest(request), currentTime(), initiatorObject, buildObjectForResourceResponse(redirectResponse, loader), type != InspectorPageAgent::OtherResource ? &resourceType : nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::markResourceAsCached(unsigned long identifier)
</span><span class="lines">@@ -375,7 +365,7 @@
</span><span class="cx"> m_resourcesData->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), response);
</span><span class="cx"> m_resourcesData->setResourceType(requestId, type);
</span><span class="cx">
</span><del>- m_frontendDispatcher->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), timestamp(), InspectorPageAgent::resourceTypeJson(type), resourceResponse);
</del><ins>+ m_frontendDispatcher->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), currentTime(), InspectorPageAgent::resourceTypeJson(type), resourceResponse);
</ins><span class="cx">
</span><span class="cx"> // If we revalidated the resource and got Not modified, send content length following didReceiveResponse
</span><span class="cx"> // as there will be no calls to didReceiveData from the network stack.
</span><span class="lines">@@ -401,7 +391,7 @@
</span><span class="cx"> m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- m_frontendDispatcher->dataReceived(requestId, timestamp(), dataLength, encodedDataLength);
</del><ins>+ m_frontendDispatcher->dataReceived(requestId, currentTime(), dataLength, encodedDataLength);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didFinishLoading(unsigned long identifier, DocumentLoader* loader, double finishTime)
</span><span class="lines">@@ -421,7 +411,7 @@
</span><span class="cx"> // However, all other times passed to the Inspector are generated from the web process. Mixing
</span><span class="cx"> // times from different processes can cause the finish time to be earlier than the response
</span><span class="cx"> // received time due to inter-process communication lag.
</span><del>- finishTime = timestamp();
</del><ins>+ finishTime = currentTime();
</ins><span class="cx">
</span><span class="cx"> String sourceMappingURL;
</span><span class="cx"> NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
</span><span class="lines">@@ -447,7 +437,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool canceled = error.isCancellation();
</span><del>- m_frontendDispatcher->loadingFailed(requestId, timestamp(), error.localizedDescription(), canceled ? &canceled : nullptr);
</del><ins>+ m_frontendDispatcher->loadingFailed(requestId, currentTime(), error.localizedDescription(), canceled ? &canceled : nullptr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* loader, CachedResource* resource)
</span><span class="lines">@@ -466,7 +456,7 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader->frame() ? loader->frame()->document() : nullptr);
</span><span class="cx">
</span><del>- m_frontendDispatcher->requestServedFromMemoryCache(requestId, frameId, loaderId, loader->url().string(), timestamp(), initiatorObject, buildObjectForCachedResource(resource, loader));
</del><ins>+ m_frontendDispatcher->requestServedFromMemoryCache(requestId, frameId, loaderId, loader->url().string(), currentTime(), initiatorObject, buildObjectForCachedResource(resource, loader));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::setInitialScriptContent(unsigned long identifier, const String& sourceString)
</span><span class="lines">@@ -598,7 +588,7 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<Inspector::Protocol::Network::WebSocketRequest> requestObject = Inspector::Protocol::Network::WebSocketRequest::create()
</span><span class="cx"> .setHeaders(buildObjectForHeaders(request.httpHeaderFields()));
</span><del>- m_frontendDispatcher->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), timestamp(), requestObject);
</del><ins>+ m_frontendDispatcher->webSocketWillSendHandshakeRequest(IdentifiersFactory::requestId(identifier), currentTime(), requestObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didReceiveWebSocketHandshakeResponse(unsigned long identifier, const ResourceResponse& response)
</span><span class="lines">@@ -607,12 +597,12 @@
</span><span class="cx"> .setStatus(response.httpStatusCode())
</span><span class="cx"> .setStatusText(response.httpStatusText())
</span><span class="cx"> .setHeaders(buildObjectForHeaders(response.httpHeaderFields()));
</span><del>- m_frontendDispatcher->webSocketHandshakeResponseReceived(IdentifiersFactory::requestId(identifier), timestamp(), responseObject);
</del><ins>+ m_frontendDispatcher->webSocketHandshakeResponseReceived(IdentifiersFactory::requestId(identifier), currentTime(), responseObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didCloseWebSocket(unsigned long identifier)
</span><span class="cx"> {
</span><del>- m_frontendDispatcher->webSocketClosed(IdentifiersFactory::requestId(identifier), timestamp());
</del><ins>+ m_frontendDispatcher->webSocketClosed(IdentifiersFactory::requestId(identifier), currentTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didReceiveWebSocketFrame(unsigned long identifier, const WebSocketFrame& frame)
</span><span class="lines">@@ -621,7 +611,7 @@
</span><span class="cx"> .setOpcode(frame.opCode)
</span><span class="cx"> .setMask(frame.masked)
</span><span class="cx"> .setPayloadData(String(frame.payload, frame.payloadLength));
</span><del>- m_frontendDispatcher->webSocketFrameReceived(IdentifiersFactory::requestId(identifier), timestamp(), frameObject);
</del><ins>+ m_frontendDispatcher->webSocketFrameReceived(IdentifiersFactory::requestId(identifier), currentTime(), frameObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didSendWebSocketFrame(unsigned long identifier, const WebSocketFrame& frame)
</span><span class="lines">@@ -630,12 +620,12 @@
</span><span class="cx"> .setOpcode(frame.opCode)
</span><span class="cx"> .setMask(frame.masked)
</span><span class="cx"> .setPayloadData(String(frame.payload, frame.payloadLength));
</span><del>- m_frontendDispatcher->webSocketFrameSent(IdentifiersFactory::requestId(identifier), timestamp(), frameObject);
</del><ins>+ m_frontendDispatcher->webSocketFrameSent(IdentifiersFactory::requestId(identifier), currentTime(), frameObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::didReceiveWebSocketFrameError(unsigned long identifier, const String& errorMessage)
</span><span class="cx"> {
</span><del>- m_frontendDispatcher->webSocketFrameError(IdentifiersFactory::requestId(identifier), timestamp(), errorMessage);
</del><ins>+ m_frontendDispatcher->webSocketFrameError(IdentifiersFactory::requestId(identifier), currentTime(), errorMessage);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEB_SOCKETS)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -138,8 +138,6 @@
</span><span class="cx"> private:
</span><span class="cx"> void enable();
</span><span class="cx">
</span><del>- double timestamp();
-
</del><span class="cx"> InspectorPageAgent* m_pageAgent;
</span><span class="cx"> InspectorClient* m_client;
</span><span class="cx"> std::unique_ptr<Inspector::InspectorNetworkFrontendDispatcher> m_frontendDispatcher;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -61,6 +61,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+void TimelineTimeConverter::reset()
+{
+ m_startOffset = monotonicallyIncreasingTime() - currentTime();
+}
+
</ins><span class="cx"> InspectorTimelineAgent::~InspectorTimelineAgent()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -71,7 +76,6 @@
</span><span class="cx"> m_backendDispatcher = InspectorTimelineBackendDispatcher::create(backendDispatcher, this);
</span><span class="cx">
</span><span class="cx"> m_instrumentingAgents->setPersistentInspectorTimelineAgent(this);
</span><del>- m_stopwatch->reset();
</del><span class="cx">
</span><span class="cx"> if (m_scriptDebugServer)
</span><span class="cx"> m_scriptDebugServer->recompileAllJSFunctions();
</span><span class="lines">@@ -114,7 +118,7 @@
</span><span class="cx"> else
</span><span class="cx"> m_maxCallStackDepth = 5;
</span><span class="cx">
</span><del>- m_stopwatch->start();
</del><ins>+ m_timeConverter.reset();
</ins><span class="cx">
</span><span class="cx"> m_instrumentingAgents->setInspectorTimelineAgent(this);
</span><span class="cx">
</span><span class="lines">@@ -132,8 +136,6 @@
</span><span class="cx"> if (!m_enabled)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- m_stopwatch->stop();
-
</del><span class="cx"> m_instrumentingAgents->setInspectorTimelineAgent(nullptr);
</span><span class="cx">
</span><span class="cx"> if (m_scriptDebugServer)
</span><span class="lines">@@ -155,9 +157,9 @@
</span><span class="cx"> m_scriptDebugServer = scriptDebugServer;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline void startProfiling(JSC::ExecState* exec, const String& title, PassRefPtr<Stopwatch> stopwatch)
</del><ins>+static inline void startProfiling(JSC::ExecState* exec, const String& title)
</ins><span class="cx"> {
</span><del>- JSC::LegacyProfiler::profiler()->startProfiling(exec, title, stopwatch);
</del><ins>+ JSC::LegacyProfiler::profiler()->startProfiling(exec, title);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline PassRefPtr<JSC::Profile> stopProfiling(JSC::ExecState* exec, const String& title)
</span><span class="lines">@@ -165,9 +167,9 @@
</span><span class="cx"> return JSC::LegacyProfiler::profiler()->stopProfiling(exec, title);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline void startProfiling(Frame* frame, const String& title, PassRefPtr<Stopwatch> stopwatch)
</del><ins>+static inline void startProfiling(Frame* frame, const String& title)
</ins><span class="cx"> {
</span><del>- startProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title, stopwatch);
</del><ins>+ startProfiling(toJSDOMWindow(frame, debuggerWorld())->globalExec(), title);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline PassRefPtr<JSC::Profile> stopProfiling(Frame* frame, const String& title)
</span><span class="lines">@@ -191,7 +193,7 @@
</span><span class="cx"> if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
</span><span class="cx"> internalStart();
</span><span class="cx">
</span><del>- startProfiling(exec, title, m_stopwatch);
</del><ins>+ startProfiling(exec, title);
</ins><span class="cx">
</span><span class="cx"> m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
</span><span class="cx"> }
</span><span class="lines">@@ -230,7 +232,7 @@
</span><span class="cx"> pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame);
</span><span class="cx">
</span><span class="cx"> if (frame && !m_callStackDepth)
</span><del>- startProfiling(frame, ASCIILiteral("Timeline FunctionCall"), m_stopwatch);
</del><ins>+ startProfiling(frame, ASCIILiteral("Timeline FunctionCall"));
</ins><span class="cx">
</span><span class="cx"> ++m_callStackDepth;
</span><span class="cx"> }
</span><span class="lines">@@ -405,7 +407,7 @@
</span><span class="cx">
</span><span class="cx"> if (frame && !m_callStackDepth) {
</span><span class="cx"> ++m_callStackDepth;
</span><del>- startProfiling(frame, ASCIILiteral("Timeline EvaluateScript"), m_stopwatch);
</del><ins>+ startProfiling(frame, ASCIILiteral("Timeline EvaluateScript"));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -552,16 +554,6 @@
</span><span class="cx"> appendRecord(TimelineRecordFactory::createProbeSampleData(action, hitCount), TimelineRecordType::ProbeSample, false, frameFromExecState(exec));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorTimelineAgent::didPause(JSC::ExecState*, const Deprecated::ScriptValue&, const Deprecated::ScriptValue&)
-{
- m_stopwatch->stop();
-}
-
-void InspectorTimelineAgent::didContinue()
-{
- m_stopwatch->start();
-}
-
</del><span class="cx"> static Inspector::Protocol::Timeline::EventType toProtocol(TimelineRecordType type)
</span><span class="cx"> {
</span><span class="cx"> switch (type) {
</span><span class="lines">@@ -698,7 +690,6 @@
</span><span class="cx"> : InspectorAgentBase(ASCIILiteral("Timeline"), instrumentingAgents)
</span><span class="cx"> , m_pageAgent(pageAgent)
</span><span class="cx"> , m_scriptDebugServer(nullptr)
</span><del>- , m_stopwatch(Stopwatch::create())
</del><span class="cx"> , m_id(1)
</span><span class="cx"> , m_callStackDepth(0)
</span><span class="cx"> , m_maxCallStackDepth(5)
</span><span class="lines">@@ -757,7 +748,7 @@
</span><span class="cx">
</span><span class="cx"> double InspectorTimelineAgent::timestamp()
</span><span class="cx"> {
</span><del>- return m_stopwatch->elapsedTime();
</del><ins>+ return m_timeConverter.fromMonotonicallyIncreasingTime(monotonicallyIncreasingTime());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Page* InspectorTimelineAgent::page()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> #include "LayoutRect.h"
</span><span class="cx"> #include <inspector/InspectorValues.h>
</span><span class="cx"> #include <inspector/ScriptDebugListener.h>
</span><del>-#include <wtf/Stopwatch.h>
</del><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx">
</span><span class="lines">@@ -114,6 +113,19 @@
</span><span class="cx"> WebSocketDestroy
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+class TimelineTimeConverter {
+public:
+ TimelineTimeConverter()
+ : m_startOffset(0)
+ {
+ }
+ double fromMonotonicallyIncreasingTime(double time) const { return (time - m_startOffset) * 1000.0; }
+ void reset();
+
+private:
+ double m_startOffset;
+};
+
</ins><span class="cx"> class InspectorTimelineAgent
</span><span class="cx"> : public InspectorAgentBase
</span><span class="cx"> , public Inspector::InspectorTimelineBackendDispatcherHandler
</span><span class="lines">@@ -198,10 +210,6 @@
</span><span class="cx"> void willFireAnimationFrame(int callbackId, Frame*);
</span><span class="cx"> void didFireAnimationFrame();
</span><span class="cx">
</span><del>- // Returns the elapsed time from a monotonic stopwatch that starts with timeline recording and
- // pauses when the debugger pauses or execution is otherwise suspended.
- double timestamp();
-
</del><span class="cx"> #if ENABLE(WEB_SOCKETS)
</span><span class="cx"> void didCreateWebSocket(unsigned long identifier, const URL&, const String& protocol, Frame*);
</span><span class="cx"> void willSendWebSocketHandshakeRequest(unsigned long identifier, Frame*);
</span><span class="lines">@@ -210,11 +218,11 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- // ScriptDebugListener
</del><ins>+ // ScriptDebugListener. This is only used to create records for probe samples.
</ins><span class="cx"> virtual void didParseSource(JSC::SourceID, const Script&) override { }
</span><span class="cx"> virtual void failedToParseSource(const String&, const String&, int, int, const String&) override { }
</span><del>- virtual void didPause(JSC::ExecState*, const Deprecated::ScriptValue&, const Deprecated::ScriptValue&) override;
- virtual void didContinue() override;
</del><ins>+ virtual void didPause(JSC::ExecState*, const Deprecated::ScriptValue&, const Deprecated::ScriptValue&) override { }
+ virtual void didContinue() override { }
</ins><span class="cx">
</span><span class="cx"> virtual void breakpointActionLog(JSC::ExecState*, const String&) override { }
</span><span class="cx"> virtual void breakpointActionSound(int) override { }
</span><span class="lines">@@ -256,15 +264,17 @@
</span><span class="cx"> void clearRecordStack();
</span><span class="cx">
</span><span class="cx"> void localToPageQuad(const RenderObject&, const LayoutRect&, FloatQuad*);
</span><ins>+ const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
+ double timestamp();
</ins><span class="cx"> Page* page();
</span><span class="cx">
</span><span class="cx"> InspectorPageAgent* m_pageAgent;
</span><span class="cx"> PageScriptDebugServer* m_scriptDebugServer;
</span><ins>+ TimelineTimeConverter m_timeConverter;
</ins><span class="cx">
</span><del>- RefPtr<Stopwatch> m_stopwatch;
-
</del><span class="cx"> std::unique_ptr<Inspector::InspectorTimelineFrontendDispatcher> m_frontendDispatcher;
</span><span class="cx"> RefPtr<Inspector::InspectorTimelineBackendDispatcher> m_backendDispatcher;
</span><ins>+ double m_timestampOffset;
</ins><span class="cx">
</span><span class="cx"> Vector<TimelineRecordEntry> m_recordStack;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include <inspector/ScriptCallStack.h>
</span><span class="cx"> #include <inspector/ScriptCallStackFactory.h>
</span><span class="cx"> #include <profiler/Profile.h>
</span><ins>+#include <wtf/CurrentTime.h>
</ins><span class="cx">
</span><span class="cx"> using namespace Inspector;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-10-04 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><ins>+ Unreviewed, rolling out r174319.
+
+ Causes assertions in fast/profiler tests. Needs nontrivial
+ investigation, will take offline.
+
+ Reverted changeset:
+
+ "Web Inspector: timelines should not count time elapsed while
+ paused in the debugger"
+ https://bugs.webkit.org/show_bug.cgi?id=136351
+ http://trac.webkit.org/changeset/174319
+
+2014-10-04 Brian J. Burg <burg@cs.washington.edu>
+
</ins><span class="cx"> Web Inspector: timelines should not count time elapsed while paused in the debugger
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=136351
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersTimelineManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx"> this._activeRecording = null;
</span><span class="cx"> this._isCapturing = false;
</span><span class="cx">
</span><del>- // For legacy backends, we compute the elapsed time of records relative to this timestamp.
- this._legacyFirstRecordTimestamp = NaN;
</del><span class="cx"> this._nextRecordingIdentifier = 1;
</span><span class="cx">
</span><span class="cx"> this._boundStopCapturing = this.stopCapturing.bind(this);
</span><span class="lines">@@ -57,7 +55,6 @@
</span><span class="cx"> CapturingStopped: "timeline-manager-capturing-stopped"
</span><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.TimelineManager.StartTimeThresholdForLegacyRecordConversion = 28800000; // Date.parse("Jan 1, 1970")
</del><span class="cx"> WebInspector.TimelineManager.MaximumAutoRecordDuration = 90000; // 90 seconds
</span><span class="cx"> WebInspector.TimelineManager.MaximumAutoRecordDurationAfterLoadEvent = 10000; // 10 seconds
</span><span class="cx"> WebInspector.TimelineManager.DeadTimeRequiredToStopAutoRecordingEarly = 2000; // 2 seconds
</span><span class="lines">@@ -166,21 +163,10 @@
</span><span class="cx">
</span><span class="cx"> function processRecord(recordPayload, parentRecordPayload)
</span><span class="cx"> {
</span><del>- var startTime = recordPayload.startTime;
- var endTime = recordPayload.endTime;
</del><ins>+ // Convert the timestamps to seconds to match the resource timestamps.
+ var startTime = recordPayload.startTime / 1000;
+ var endTime = recordPayload.endTime / 1000;
</ins><span class="cx">
</span><del>- // COMPATIBILITY (iOS8): old versions use milliseconds since the epoch, rather
- // than seconds elapsed since timeline capturing started. We approximate the latter by
- // subtracting the start timestamp, as old versions did not use monotonic times.
- if (isNaN(this._legacyFirstRecordTimestamp))
- this._legacyFirstRecordTimestamp = recordPayload.startTime;
-
- // If the record's start time sems unreasonably large, treat it as a legacy timestamp.
- if (startTime > WebInspector.StartTimeThresholdForLegacyRecordConversion) {
- startTime = (startTime - this._legacyFirstRecordTimestamp) / 1000;
- endTime = isNaN(endTime) ? NaN : (startTime - this._legacyFirstRecordTimestamp) / 1000;
- }
-
</del><span class="cx"> var callFrames = this._callFramesFromPayload(recordPayload.stackTrace);
</span><span class="cx">
</span><span class="cx"> var significantCallFrame = null;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTimelineContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js (174321 => 174322)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js        2014-10-04 19:55:49 UTC (rev 174321)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js        2014-10-04 21:55:58 UTC (rev 174322)
</span><span class="lines">@@ -98,9 +98,6 @@
</span><span class="cx"> WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStarted, this._capturingStarted, this);
</span><span class="cx"> WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._capturingStopped, this);
</span><span class="cx">
</span><del>- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Paused, this._debuggerPaused, this);
- WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.Resumed, this._debuggerResumed, this);
-
</del><span class="cx"> this.showOverviewTimelineView();
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -410,22 +407,6 @@
</span><span class="cx"> this._stopUpdatingCurrentTime();
</span><span class="cx"> },
</span><span class="cx">
</span><del>- _debuggerPaused: function(event)
- {
- if (WebInspector.replayManager.sessionState === WebInspector.ReplayManager.SessionState.Replaying)
- return;
-
- this._stopUpdatingCurrentTime();
- },
-
- _debuggerResumed: function(event)
- {
- if (WebInspector.replayManager.sessionState === WebInspector.ReplayManager.SessionState.Replaying)
- return;
-
- this._startUpdatingCurrentTime();
- },
-
</del><span class="cx"> _recordingTimesUpdated: function(event)
</span><span class="cx"> {
</span><span class="cx"> if (!this._waitingToResetCurrentTime)
</span></span></pre>
</div>
</div>
</body>
</html>