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

Unified Diff: Source/core/css/CSSValue.h

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase Created 5 years, 5 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/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSValueList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValue.h
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
index b9d3b052e55182e2427b6a6f048856802d2d3724..8e8ec00fd043e8a2beaafbaab338c7392da5f8ae 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValue.h
@@ -397,12 +397,16 @@ inline bool compareCSSValueVector(const WillBeHeapVector<CSSValue, inlineCapacit
return static_cast<thisType*>(value.get()); \
}
-// Returns by value on purpose.
inline const CSSPrimitiveValue& toCSSPrimitiveValue(const CSSValue& value)
{
ASSERT_WITH_SECURITY_IMPLICATION(value.isPrimitiveValue());
return *reinterpret_cast<const CSSPrimitiveValue*>(&value);
}
+inline const CSSPrimitiveValue& toCSSPrimitiveValue(const NullableCSSValue& value)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(value && value->isPrimitiveValue());
+ return *reinterpret_cast<const CSSPrimitiveValue*>(&value);
+}
/*
inline CSSPrimitiveValue& toCSSPrimitiveValue(const CSSValue& value)
{
« no previous file with comments | « Source/core/css/CSSStyleDeclaration.h ('k') | Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698