Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1289)

Unified Diff: Source/core/inspector/InspectorCSSAgent.cpp

Issue 208893007: DevTools: InspectorHistory actions become refcounted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/DOMEditor.cpp ('k') | Source/core/inspector/InspectorHistory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index 69aa4364f9ac238456ecb0d9888b54f6db2bf304..95d556a31bf8d46fa3dc0ec2782d336ee902a3c5 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -200,7 +200,7 @@ public:
return String::format("SetStyleSheetText %s", m_styleSheet->id().utf8().data());
}
- virtual void merge(PassOwnPtr<Action> action) OVERRIDE
+ virtual void merge(PassRefPtr<Action> action) OVERRIDE
{
ASSERT(action->mergeId() == mergeId());
@@ -256,7 +256,7 @@ public:
return String::format("SetPropertyText %s:%u:%s", m_styleSheet->id().utf8().data(), m_propertyIndex, m_overwrite ? "true" : "false");
}
- virtual void merge(PassOwnPtr<Action> action) OVERRIDE
+ virtual void merge(PassRefPtr<Action> action) OVERRIDE
{
ASSERT(action->mergeId() == mergeId());
@@ -832,7 +832,7 @@ void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String
}
TrackExceptionState exceptionState;
- m_domAgent->history()->perform(adoptPtr(new SetStyleSheetTextAction(inspectorStyleSheet, text)), exceptionState);
+ m_domAgent->history()->perform(adoptRef(new SetStyleSheetTextAction(inspectorStyleSheet, text)), exceptionState);
*errorString = InspectorDOMAgent::toErrorString(exceptionState);
}
@@ -846,7 +846,7 @@ void InspectorCSSAgent::setPropertyText(ErrorString* errorString, const RefPtr<J
return;
TrackExceptionState exceptionState;
- bool success = m_domAgent->history()->perform(adoptPtr(new SetPropertyTextAction(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite)), exceptionState);
+ bool success = m_domAgent->history()->perform(adoptRef(new SetPropertyTextAction(inspectorStyleSheet, compoundId, propertyIndex, text, overwrite)), exceptionState);
if (success)
result = inspectorStyleSheet->buildObjectForStyle(inspectorStyleSheet->styleForId(compoundId));
*errorString = InspectorDOMAgent::toErrorString(exceptionState);
@@ -862,7 +862,7 @@ void InspectorCSSAgent::setRuleSelector(ErrorString* errorString, const RefPtr<J
return;
TrackExceptionState exceptionState;
- bool success = m_domAgent->history()->perform(adoptPtr(new SetRuleSelectorAction(inspectorStyleSheet, compoundId, selector)), exceptionState);
+ bool success = m_domAgent->history()->perform(adoptRef(new SetRuleSelectorAction(inspectorStyleSheet, compoundId, selector)), exceptionState);
if (success) {
CSSStyleRule* rule = inspectorStyleSheet->ruleForId(compoundId);
@@ -903,15 +903,14 @@ void InspectorCSSAgent::addRule(ErrorString* errorString, const String& styleShe
return;
TrackExceptionState exceptionState;
- OwnPtr<AddRuleAction> action = adoptPtr(new AddRuleAction(inspectorStyleSheet, selector));
- AddRuleAction* rawAction = action.get();
- bool success = m_domAgent->history()->perform(action.release(), exceptionState);
+ RefPtr<AddRuleAction> action = adoptRef(new AddRuleAction(inspectorStyleSheet, selector));
+ bool success = m_domAgent->history()->perform(action, exceptionState);
if (!success) {
*errorString = InspectorDOMAgent::toErrorString(exceptionState);
return;
}
- InspectorCSSId ruleId = rawAction->newRuleId();
+ InspectorCSSId ruleId = action->newRuleId();
CSSStyleRule* rule = inspectorStyleSheet->ruleForId(ruleId);
result = inspectorStyleSheet->buildObjectForRule(rule, buildMediaListChain(rule));
}
« no previous file with comments | « Source/core/inspector/DOMEditor.cpp ('k') | Source/core/inspector/InspectorHistory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698