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

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

Issue 1730383003: DevTools: consistently use Maybe for optional values in the protocol generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 10 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
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 648beca2197ce07556f3684c27a4735a6a5ed3fe..371370a38bac42a55f47d3ff6958e943f64cfbe4 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -862,7 +862,7 @@ void InspectorCSSAgent::getMediaQueries(ErrorString* errorString, OwnPtr<protoco
}
}
-void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, OwnPtr<protocol::CSS::CSSStyle>* inlineStyle, OwnPtr<protocol::CSS::CSSStyle>* attributesStyle, OwnPtr<protocol::Array<protocol::CSS::RuleMatch>>* matchedCSSRules, OwnPtr<protocol::Array<protocol::CSS::PseudoElementMatches>>* pseudoIdMatches, OwnPtr<protocol::Array<protocol::CSS::InheritedStyleEntry>>* inheritedEntries, OwnPtr<protocol::Array<protocol::CSS::CSSKeyframesRule>>* cssKeyframesRules)
+void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int nodeId, Maybe<protocol::CSS::CSSStyle>* inlineStyle, Maybe<protocol::CSS::CSSStyle>* attributesStyle, Maybe<protocol::Array<protocol::CSS::RuleMatch>>* matchedCSSRules, Maybe<protocol::Array<protocol::CSS::PseudoElementMatches>>* pseudoIdMatches, Maybe<protocol::Array<protocol::CSS::InheritedStyleEntry>>* inheritedEntries, Maybe<protocol::Array<protocol::CSS::CSSKeyframesRule>>* cssKeyframesRules)
{
Element* element = elementForId(errorString, nodeId);
if (!element) {
@@ -911,7 +911,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no
RefPtrWillBeRawPtr<CSSRuleList> matchedRules = styleResolver.pseudoCSSRulesForElement(element, pseudoId, StyleResolver::AllCSSRules);
protocol::DOM::PseudoType pseudoType;
if (matchedRules && matchedRules->length() && m_domAgent->getPseudoElementType(pseudoId, &pseudoType)) {
- (*pseudoIdMatches)->addItem(protocol::CSS::PseudoElementMatches::create()
+ pseudoIdMatches->fromJust()->addItem(protocol::CSS::PseudoElementMatches::create()
.setPseudoType(pseudoType)
.setMatches(buildArrayForMatchedRuleList(matchedRules.get(), element, pseudoId)).build());
}
@@ -931,7 +931,7 @@ void InspectorCSSAgent::getMatchedStylesForNode(ErrorString* errorString, int no
entry->setInlineStyle(styleSheet->buildObjectForStyle(styleSheet->inlineStyle()));
}
- (*inheritedEntries)->addItem(entry.release());
+ inheritedEntries->fromJust()->addItem(entry.release());
parentElement = parentElement->parentOrShadowHostElement();
}
@@ -1004,7 +1004,7 @@ PassOwnPtr<protocol::Array<protocol::CSS::CSSKeyframesRule>> InspectorCSSAgent::
return cssKeyframesRules.release();
}
-void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nodeId, OwnPtr<protocol::CSS::CSSStyle>* inlineStyle, OwnPtr<protocol::CSS::CSSStyle>* attributesStyle)
+void InspectorCSSAgent::getInlineStylesForNode(ErrorString* errorString, int nodeId, Maybe<protocol::CSS::CSSStyle>* inlineStyle, Maybe<protocol::CSS::CSSStyle>* attributesStyle)
{
Element* element = elementForId(errorString, nodeId);
if (!element)
@@ -1100,7 +1100,7 @@ void InspectorCSSAgent::getStyleSheetText(ErrorString* errorString, const String
inspectorStyleSheet->getText(result);
}
-void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String& styleSheetId, const String& text, protocol::OptionalValue<String>* sourceMapURL)
+void InspectorCSSAgent::setStyleSheetText(ErrorString* errorString, const String& styleSheetId, const String& text, protocol::Maybe<String>* sourceMapURL)
{
FrontendOperationScope scope;
InspectorStyleSheetBase* inspectorStyleSheet = assertStyleSheetForId(errorString, styleSheetId);
@@ -2046,7 +2046,7 @@ void InspectorCSSAgent::setEffectivePropertyValueForNode(ErrorString* errorStrin
setLayoutEditorValue(errorString, element, style.get(), propertyId, value);
}
-void InspectorCSSAgent::getBackgroundColors(ErrorString* errorString, int nodeId, OwnPtr<protocol::Array<String>>* result)
+void InspectorCSSAgent::getBackgroundColors(ErrorString* errorString, int nodeId, Maybe<protocol::Array<String>>* result)
{
Element* element = elementForId(errorString, nodeId);
if (!element) {
@@ -2095,7 +2095,7 @@ void InspectorCSSAgent::getBackgroundColors(ErrorString* errorString, int nodeId
*result = protocol::Array<String>::create();
for (auto color : colors)
- (*result)->addItem(color.serializedAsCSSComponentValue());
+ result->fromJust()->addItem(color.serializedAsCSSComponentValue());
}
DEFINE_TRACE(InspectorCSSAgent)

Powered by Google App Engine
This is Rietveld 408576698