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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2101143005: 0 -> nullptr for UseCounter pointer in CSSParserContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 FrontendOperationScope() { ++s_frontendOperationCounter; } 95 FrontendOperationScope() { ++s_frontendOperationCounter; }
96 ~FrontendOperationScope() { --s_frontendOperationCounter; } 96 ~FrontendOperationScope() { --s_frontendOperationCounter; }
97 }; 97 };
98 98
99 using namespace blink; 99 using namespace blink;
100 100
101 String createShorthandValue(Document* document, const String& shorthand, const S tring& oldText, const String& longhand, const String& newValue) 101 String createShorthandValue(Document* document, const String& shorthand, const S tring& oldText, const String& longhand, const String& newValue)
102 { 102 {
103 StyleSheetContents* styleSheetContents = StyleSheetContents::create(strictCS SParserContext()); 103 StyleSheetContents* styleSheetContents = StyleSheetContents::create(strictCS SParserContext());
104 String text = " div { " + shorthand + ": " + oldText + "; }"; 104 String text = " div { " + shorthand + ": " + oldText + "; }";
105 CSSParser::parseSheet(CSSParserContext(*document, 0), styleSheetContents, te xt); 105 CSSParser::parseSheet(CSSParserContext(*document, nullptr), styleSheetConten ts, text);
106 106
107 CSSStyleSheet* styleSheet = CSSStyleSheet::create(styleSheetContents); 107 CSSStyleSheet* styleSheet = CSSStyleSheet::create(styleSheetContents);
108 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0)); 108 CSSStyleRule* rule = toCSSStyleRule(styleSheet->item(0));
109 CSSStyleDeclaration* style = rule->style(); 109 CSSStyleDeclaration* style = rule->style();
110 TrackExceptionState exceptionState; 110 TrackExceptionState exceptionState;
111 style->setProperty(longhand, newValue, style->getPropertyPriority(longhand), exceptionState); 111 style->setProperty(longhand, newValue, style->getPropertyPriority(longhand), exceptionState);
112 return style->getPropertyValue(shorthand); 112 return style->getPropertyValue(shorthand);
113 } 113 }
114 114
115 HeapVector<Member<CSSStyleRule>> filterDuplicateRules(CSSRuleList* ruleList) 115 HeapVector<Member<CSSStyleRule>> filterDuplicateRules(CSSRuleList* ruleList)
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 visitor->trace(m_cssStyleSheetToInspectorStyleSheet); 2072 visitor->trace(m_cssStyleSheetToInspectorStyleSheet);
2073 visitor->trace(m_documentToCSSStyleSheets); 2073 visitor->trace(m_documentToCSSStyleSheets);
2074 visitor->trace(m_invalidatedDocuments); 2074 visitor->trace(m_invalidatedDocuments);
2075 visitor->trace(m_nodeToInspectorStyleSheet); 2075 visitor->trace(m_nodeToInspectorStyleSheet);
2076 visitor->trace(m_documentToViaInspectorStyleSheet); 2076 visitor->trace(m_documentToViaInspectorStyleSheet);
2077 visitor->trace(m_inspectorUserAgentStyleSheet); 2077 visitor->trace(m_inspectorUserAgentStyleSheet);
2078 InspectorBaseAgent::trace(visitor); 2078 InspectorBaseAgent::trace(visitor);
2079 } 2079 }
2080 2080
2081 } // namespace blink 2081 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698