This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspector: enable TimeTravel support
* Added the TimeTravel domain and wired it up * Debuggers can now detect time travel mode by looking at the available domains. PR-URL: #244 Reviewed-By: Kunal Pathak <Kunal.Pathak@microsoft.com> Reviewed-By: Sandeep Agarwal <saagarwa@microsoft.com>
- Loading branch information
Showing
15 changed files
with
199 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2015 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "src/inspector/v8-timetravel-agent-impl.h" | ||
#include "src/inspector/v8-inspector-session-impl.h" | ||
#include "src/inspector/v8-debugger-agent-impl.h" | ||
#include "src/jsrtinspector.h" | ||
|
||
namespace v8_inspector { | ||
|
||
V8TimeTravelAgentImpl::V8TimeTravelAgentImpl( | ||
V8InspectorSessionImpl* session, protocol::FrontendChannel* frontendChannel, | ||
protocol::DictionaryValue* state) | ||
: m_session(session), | ||
m_frontend(frontendChannel), | ||
m_state(state) {} | ||
|
||
V8TimeTravelAgentImpl::~V8TimeTravelAgentImpl() {} | ||
|
||
bool V8TimeTravelAgentImpl::checkEnabled(ErrorString* errorString) { | ||
if (enabled()) { | ||
return true; | ||
} | ||
|
||
*errorString = "TimeTravel agent is not enabled"; | ||
return false; | ||
} | ||
|
||
bool V8TimeTravelAgentImpl::enabled() { | ||
return jsrt::Inspector::IsReplayDebugEnabled(); | ||
} | ||
|
||
void V8TimeTravelAgentImpl::reverse(ErrorString* errorString) { | ||
if (!checkEnabled(errorString)) { | ||
return; | ||
} | ||
|
||
m_session->debuggerAgent()->reverse(errorString); | ||
} | ||
|
||
void V8TimeTravelAgentImpl::stepBack(ErrorString* errorString) { | ||
if (!checkEnabled(errorString)) { | ||
return; | ||
} | ||
|
||
m_session->debuggerAgent()->stepBack(errorString); | ||
} | ||
|
||
} // namespace v8_inspector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2015 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef V8_INSPECTOR_V8TIMETRAVELAGENTIMPL_H_ | ||
#define V8_INSPECTOR_V8TIMETRAVELAGENTIMPL_H_ | ||
|
||
#include <vector> | ||
|
||
#include "src/base/macros.h" | ||
#include "src/inspector/protocol/TimeTravel.h" | ||
#include "src/inspector/protocol/Forward.h" | ||
|
||
namespace v8_inspector { | ||
|
||
class V8Debugger; | ||
class V8InspectorImpl; | ||
class V8InspectorSessionImpl; | ||
|
||
using protocol::ErrorString; | ||
|
||
class V8TimeTravelAgentImpl : public protocol::TimeTravel::Backend { | ||
public: | ||
V8TimeTravelAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, | ||
protocol::DictionaryValue* state); | ||
~V8TimeTravelAgentImpl() override; | ||
|
||
// Part of the protocol. | ||
void reverse(ErrorString*) override; | ||
void stepBack(ErrorString*) override; | ||
|
||
bool enabled(); | ||
|
||
private: | ||
bool checkEnabled(ErrorString*); | ||
|
||
V8InspectorSessionImpl* m_session; | ||
protocol::TimeTravel::Frontend m_frontend; | ||
protocol::DictionaryValue* m_state; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(V8TimeTravelAgentImpl); | ||
}; | ||
|
||
} // namespace v8_inspector | ||
|
||
#endif // V8_INSPECTOR_V8TIMETRAVELAGENTIMPL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.