Commit 26c72fb5 authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

Rename to agent_state_.ClearAllFields().

I thought it was nice to name everything Clear, but when I tried
to use it in one of the pending PRs it felt too much like action
from a distance to clear the agent state which causes the fields
to be cleared. So the more explicit name (like you suggested it)
is better. Sorry about the churn.

Change-Id: I33ab0b02a714dd93c2375ec28327a5eb58748135
Reviewed-on: https://chromium-review.googlesource.com/1159996Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580235}
parent cb49e7ad
...@@ -106,7 +106,7 @@ void InspectorAgentState::InitFrom(InspectorSessionState* session_state) { ...@@ -106,7 +106,7 @@ void InspectorAgentState::InitFrom(InspectorSessionState* session_state) {
f->InitFrom(session_state); f->InitFrom(session_state);
} }
void InspectorAgentState::Clear() { void InspectorAgentState::ClearAllFields() {
for (Field* f : fields_) for (Field* f : fields_)
f->Clear(); f->Clear();
} }
......
...@@ -270,7 +270,7 @@ class CORE_EXPORT InspectorAgentState { ...@@ -270,7 +270,7 @@ class CORE_EXPORT InspectorAgentState {
void InitFrom(InspectorSessionState* session_state); void InitFrom(InspectorSessionState* session_state);
// Clears all fields registered with this InspectorAgentState instance. // Clears all fields registered with this InspectorAgentState instance.
void Clear(); void ClearAllFields();
private: private:
const WTF::String domain_name_; const WTF::String domain_name_;
......
...@@ -236,7 +236,7 @@ TEST(InspectorSessionStateTest, MultipleAgents) { ...@@ -236,7 +236,7 @@ TEST(InspectorSessionStateTest, MultipleAgents) {
AgentWithMapFields maps_agent; AgentWithMapFields maps_agent;
maps_agent.agent_state_.InitFrom(&session_state); maps_agent.agent_state_.InitFrom(&session_state);
maps_agent.strings_.Set("foo", "bar"); maps_agent.strings_.Set("foo", "bar");
maps_agent.agent_state_.Clear(); maps_agent.agent_state_.ClearAllFields();
EXPECT_TRUE(maps_agent.doubles_.IsEmpty()); EXPECT_TRUE(maps_agent.doubles_.IsEmpty());
EXPECT_TRUE(maps_agent.strings_.IsEmpty()); EXPECT_TRUE(maps_agent.strings_.IsEmpty());
...@@ -250,7 +250,7 @@ TEST(InspectorSessionStateTest, MultipleAgents) { ...@@ -250,7 +250,7 @@ TEST(InspectorSessionStateTest, MultipleAgents) {
InspectorSessionState session_state(dev_tools_session.CloneCookie()); InspectorSessionState session_state(dev_tools_session.CloneCookie());
AgentWithSimpleFields simple_agent; AgentWithSimpleFields simple_agent;
simple_agent.agent_state_.InitFrom(&session_state); simple_agent.agent_state_.InitFrom(&session_state);
simple_agent.agent_state_.Clear(); simple_agent.agent_state_.ClearAllFields();
dev_tools_session.ApplyUpdates(session_state.TakeUpdates()); dev_tools_session.ApplyUpdates(session_state.TakeUpdates());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment