Skip to content

Commit

Permalink
Inspector: remove unused and unnecessary “enabled” flag for ReplayAgent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian J. Burg committed Dec 24, 2013
1 parent 559ad71 commit 191450e
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 89 deletions.
29 changes: 0 additions & 29 deletions Source/WebCore/inspector/InspectorReplayAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,35 +280,6 @@ void InspectorReplayAgent::stop()
stopPlayback(&dummy, true);
}

void InspectorReplayAgent::isEnabled(ErrorString*, bool* result)
{
*result = m_stateMachine.enabled();
}

void InspectorReplayAgent::enable(ErrorString*)
{
if (m_stateMachine.enabled())
return;

m_stateMachine.advanceTo(ReplayAgentStateMachine::RecordingUnloaded);
m_instrumentingAgents->setInspectorReplayAgent(this);

if (m_frontendDispatcher)
m_frontendDispatcher->replayEnabled();
}

void InspectorReplayAgent::disable(ErrorString*)
{
if (m_stateMachine.disabled())
return;

m_stateMachine.advanceTo(ReplayAgentStateMachine::Disabled);
m_instrumentingAgents->setInspectorReplayAgent(0);

if (m_frontendDispatcher)
m_frontendDispatcher->replayDisabled();
}

void InspectorReplayAgent::startCapture(ErrorString*)
{
m_stateMachine.advanceTo(ReplayAgentStateMachine::WaitingForCapture);
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/inspector/InspectorReplayAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,8 @@ class InspectorReplayAgent : public InspectorBaseAgent, public InspectorReplayBa

// Figures out current state and stops everything.
void stop();
bool enabled() const;

// Calls from the frontend.
void enable(ErrorString*);
void disable(ErrorString*);
void isEnabled(ErrorString*, bool*);
void startCapture(ErrorString*);
void stopCapture(ErrorString*, bool*);
void replayUpToMarkIndex(ErrorString*, int, bool);
Expand Down
18 changes: 0 additions & 18 deletions Source/WebCore/inspector/protocol/Replay.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@
}
],
"commands": [
{
"name": "enable"
},
{
"name": "disable"
},
{
"name": "isEnabled",
"returns": [
{ "name": "state", "type": "boolean" }
]
},
{
"name": "startCapture",
"description": "Starts capture of a program execution."
Expand Down Expand Up @@ -143,12 +131,6 @@
],

"events": [
{
"name": "replayEnabled"
},
{
"name": "replayDisabled"
},
{
"name": "captureStarted",
"description": "Fired when capture has started."
Expand Down
22 changes: 1 addition & 21 deletions Source/WebCore/replay/ReplayAgentStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
namespace WebCore {

namespace ReplayAgentStateNames {
static const char* Disabled = "Disabled";
static const char* RecordingUnloaded = "RecordingUnloaded";
static const char* RecordingLoaded = "RecordingLoaded";
static const char* WaitingForCapture = "WaitingForCapture";
Expand All @@ -51,9 +50,6 @@ static const char* ReplayPaused = "ReplayPaused";
const char* ReplayAgentStateMachine::stateNameFor(ReplayAgentStateMachine::State state)
{
switch (state) {
case ReplayAgentStateMachine::Disabled:
return ReplayAgentStateNames::Disabled;

case ReplayAgentStateMachine::RecordingUnloaded:
return ReplayAgentStateNames::RecordingUnloaded;

Expand All @@ -80,18 +76,8 @@ const char* ReplayAgentStateMachine::stateNameFor(ReplayAgentStateMachine::State
}

ReplayAgentStateMachine::ReplayAgentStateMachine()
: m_state(Disabled)
{
}

bool ReplayAgentStateMachine::disabled() const
: m_state(RecordingUnloaded)
{
return inState(Disabled);
}

bool ReplayAgentStateMachine::enabled() const
{
return !inState(Disabled);
}

bool ReplayAgentStateMachine::canCapture() const
Expand Down Expand Up @@ -122,12 +108,6 @@ bool ReplayAgentStateMachine::replaying() const
void ReplayAgentStateMachine::advanceTo(State newState)
{
switch (newState) {
case Disabled:
if (inState(RecordingLoaded) || inState(RecordingUnloaded))
goto commit;

break;

case RecordingUnloaded: // Can always get to this state; not idempotent.
if (!inState(RecordingUnloaded))
goto commit;
Expand Down
3 changes: 0 additions & 3 deletions Source/WebCore/replay/ReplayAgentStateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class ReplayAgentStateMachine {
ReplayAgentStateMachine();

enum State {
Disabled,
RecordingUnloaded,
RecordingLoaded,
WaitingForCapture,
Expand All @@ -52,8 +51,6 @@ class ReplayAgentStateMachine {
ReplayPaused
};

bool disabled() const;
bool enabled() const;
bool canCapture() const;
bool canReplay() const;
bool replayPaused() const;
Expand Down
4 changes: 0 additions & 4 deletions Source/WebInspectorUI/UserInterface/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ WebInspector.loaded = function()
// Enable the Console Agent after creating the singleton managers.
ConsoleAgent.enable();

// For now unconditionally enable replay.
if (ReplayAgent.enable)
ReplayAgent.enable();

// Enable the RuntimeAgent to receive notification of execution contexts.
if (RuntimeAgent.enable)
RuntimeAgent.enable();
Expand Down
10 changes: 0 additions & 10 deletions Source/WebInspectorUI/UserInterface/ReplayObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ WebInspector.ReplayObserver.prototype = {

// Events defined by the "Replay" domain (see WebCore/inspector/Inspector.json).

replayEnabled: function()
{
// Not handled yet.
},

replayDisabled: function()
{
// Not handled yet.
},

captureStarted: function()
{
WebInspector.replayManager.captureStarted();
Expand Down

0 comments on commit 191450e

Please sign in to comment.