summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/InspectorState.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/inspector/InspectorState.cpp
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/inspector/InspectorState.cpp')
-rw-r--r--WebCore/inspector/InspectorState.cpp42
1 files changed, 33 insertions, 9 deletions
diff --git a/WebCore/inspector/InspectorState.cpp b/WebCore/inspector/InspectorState.cpp
index ab900e7..0865648 100644
--- a/WebCore/inspector/InspectorState.cpp
+++ b/WebCore/inspector/InspectorState.cpp
@@ -40,15 +40,16 @@ InspectorState::InspectorState(InspectorClient* client)
: m_client(client)
{
registerBoolean(monitoringXHR, false, "monitoringXHREnabled", "xhrMonitor");
- registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", (const char*)0);
- registerBoolean(searchingForNode, false, "searchingForNodeEnabled", (const char*)0);
- registerBoolean(profilerAlwaysEnabled, false, (const char*)0, "profilerEnabled");
- registerBoolean(debuggerAlwaysEnabled, false, (const char*)0, "debuggerEnabled");
- registerBoolean(inspectorStartsAttached, true, (const char*)0, "InspectorStartsAttached");
- registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, (const char*)0, "inspectorAttachedHeight");
- registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", (const char*)0);
- registerBoolean(consoleMessagesEnabled, false, "consoleMessagesEnabled", (const char*)0);
- registerBoolean(userInitiatedProfiling, false, "userInitiatedProfiling", (const char*)0);
+ registerBoolean(timelineProfilerEnabled, false, "timelineProfilerEnabled", String());
+ registerBoolean(searchingForNode, false, "searchingForNodeEnabled", String());
+ registerBoolean(profilerAlwaysEnabled, false, String(), "profilerEnabled");
+ registerBoolean(debuggerAlwaysEnabled, false, String(), "debuggerEnabled");
+ registerBoolean(inspectorStartsAttached, true, String(), "InspectorStartsAttached");
+ registerLong(inspectorAttachedHeight, InspectorController::defaultAttachedHeight, String(), "inspectorAttachedHeight");
+ registerLong(pauseOnExceptionsState, 0, "pauseOnExceptionsState", String());
+ registerBoolean(consoleMessagesEnabled, false, "consoleMessagesEnabled", String());
+ registerBoolean(userInitiatedProfiling, false, "userInitiatedProfiling", String());
+ registerObject(stickyBreakpoints, String(), String());
}
void InspectorState::restoreFromInspectorCookie(const String& json)
@@ -152,6 +153,24 @@ long InspectorState::getLong(InspectorPropertyId id)
return value;
}
+PassRefPtr<InspectorObject> InspectorState::getObject(InspectorPropertyId id)
+{
+ PropertyMap::iterator i = m_properties.find(id);
+ ASSERT(i != m_properties.end());
+ return i->second.m_value->asObject();
+}
+
+void InspectorState::setObject(InspectorPropertyId id, PassRefPtr<InspectorObject> value)
+{
+ PropertyMap::iterator i = m_properties.find(id);
+ ASSERT(i != m_properties.end());
+ Property& property = i->second;
+ property.m_value = value;
+ if (property.m_preferenceName.length())
+ m_client->storeSetting(property.m_preferenceName, value->toJSONString());
+ updateCookie();
+}
+
void InspectorState::registerBoolean(InspectorPropertyId propertyId, bool value, const String& frontendAlias, const String& preferenceName)
{
m_properties.set(propertyId, Property::create(InspectorBasicValue::create(value), frontendAlias, preferenceName));
@@ -167,6 +186,11 @@ void InspectorState::registerLong(InspectorPropertyId propertyId, long value, co
m_properties.set(propertyId, Property::create(InspectorBasicValue::create((double)value), frontendAlias, preferenceName));
}
+void InspectorState::registerObject(InspectorPropertyId propertyId, const String& frontendAlias, const String& preferenceName)
+{
+ m_properties.set(propertyId, Property::create(InspectorObject::create(), frontendAlias, preferenceName));
+}
+
InspectorState::Property InspectorState::Property::create(PassRefPtr<InspectorValue> value, const String& frontendAlias, const String& preferenceName)
{
Property property;