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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleRuleNamespace.h

Issue 2459843002: Copy m_namespaceRules when copying StyleSheetContents to avoid crashing. (Closed)
Patch Set: Rename test, move comment Created 4 years, 1 month 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef StyleRuleNamespace_h 5 #ifndef StyleRuleNamespace_h
6 #define StyleRuleNamespace_h 6 #define StyleRuleNamespace_h
7 7
8 #include "core/css/StyleRule.h" 8 #include "core/css/StyleRule.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 // This class is never actually stored anywhere currently, but only used for 12 // This class is never actually stored anywhere currently, but only used for
13 // the parser to pass to a stylesheet 13 // the parser to pass to a stylesheet
14 class StyleRuleNamespace final : public StyleRuleBase { 14 class StyleRuleNamespace final : public StyleRuleBase {
15 public: 15 public:
16 static StyleRuleNamespace* create(AtomicString prefix, AtomicString uri) { 16 static StyleRuleNamespace* create(AtomicString prefix, AtomicString uri) {
17 return new StyleRuleNamespace(prefix, uri); 17 return new StyleRuleNamespace(prefix, uri);
18 } 18 }
19 19
20 StyleRuleNamespace* copy() const {
21 return new StyleRuleNamespace(m_prefix, m_uri);
22 }
23
20 AtomicString prefix() const { return m_prefix; } 24 AtomicString prefix() const { return m_prefix; }
21 AtomicString uri() const { return m_uri; } 25 AtomicString uri() const { return m_uri; }
22 26
23 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { 27 DEFINE_INLINE_TRACE_AFTER_DISPATCH() {
24 StyleRuleBase::traceAfterDispatch(visitor); 28 StyleRuleBase::traceAfterDispatch(visitor);
25 } 29 }
26 30
27 private: 31 private:
28 StyleRuleNamespace(AtomicString prefix, AtomicString uri) 32 StyleRuleNamespace(AtomicString prefix, AtomicString uri)
29 : StyleRuleBase(Namespace), m_prefix(prefix), m_uri(uri) {} 33 : StyleRuleBase(Namespace), m_prefix(prefix), m_uri(uri) {}
30 34
31 AtomicString m_prefix; 35 AtomicString m_prefix;
32 AtomicString m_uri; 36 AtomicString m_uri;
33 }; 37 };
34 38
35 DEFINE_STYLE_RULE_TYPE_CASTS(Namespace); 39 DEFINE_STYLE_RULE_TYPE_CASTS(Namespace);
36 40
37 } // namespace blink 41 } // namespace blink
38 42
39 #endif // StyleRuleNamespace_h 43 #endif // StyleRuleNamespace_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleRule.cpp ('k') | third_party/WebKit/Source/core/css/StyleSheetContents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698