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

Side by Side Diff: Source/core/dom/shadow/ElementShadow.h

Issue 59113007: Utilize PassRefPtr and C++ refs in more places in ShadowRoot code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 17 matching lines...) Expand all
28 #define ElementShadow_h 28 #define ElementShadow_h
29 29
30 #include "core/dom/shadow/InsertionPoint.h" 30 #include "core/dom/shadow/InsertionPoint.h"
31 #include "core/dom/shadow/SelectRuleFeatureSet.h" 31 #include "core/dom/shadow/SelectRuleFeatureSet.h"
32 #include "core/dom/shadow/ShadowRoot.h" 32 #include "core/dom/shadow/ShadowRoot.h"
33 #include "wtf/DoublyLinkedList.h" 33 #include "wtf/DoublyLinkedList.h"
34 #include "wtf/Forward.h" 34 #include "wtf/Forward.h"
35 #include "wtf/HashMap.h" 35 #include "wtf/HashMap.h"
36 #include "wtf/Noncopyable.h" 36 #include "wtf/Noncopyable.h"
37 #include "wtf/PassOwnPtr.h" 37 #include "wtf/PassOwnPtr.h"
38 #include "wtf/PassRefPtr.h"
38 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
39 40
40 namespace WebCore { 41 namespace WebCore {
41 42
42 class ElementShadow { 43 class ElementShadow {
43 WTF_MAKE_NONCOPYABLE(ElementShadow); WTF_MAKE_FAST_ALLOCATED; 44 WTF_MAKE_NONCOPYABLE(ElementShadow); WTF_MAKE_FAST_ALLOCATED;
44 public: 45 public:
45 static PassOwnPtr<ElementShadow> create(); 46 static PassOwnPtr<ElementShadow> create();
46 ~ElementShadow(); 47 ~ElementShadow();
47 48
48 Element* host() const; 49 Element* host() const;
49 ShadowRoot* youngestShadowRoot() const { return m_shadowRoots.head(); } 50 ShadowRoot* youngestShadowRoot() const { return m_shadowRoots.head(); }
50 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); } 51 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); }
51 ElementShadow* containingShadow() const; 52 ElementShadow* containingShadow() const;
52 53
53 ShadowRoot* addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType); 54 PassRefPtr<ShadowRoot> addShadowRoot(Element& shadowHost, ShadowRoot::Shadow RootType);
eseidel 2013/11/06 01:11:17 add methods generally take a PassRefPtr<>, not ret
adamk 2013/11/06 02:01:39 It creates a shadow root and adds it to the shadow
54 55
55 bool applyAuthorStyles() const { return m_applyAuthorStyles; } 56 bool applyAuthorStyles() const { return m_applyAuthorStyles; }
56 bool didAffectApplyAuthorStyles(); 57 bool didAffectApplyAuthorStyles();
57 bool containsActiveStyles() const; 58 bool containsActiveStyles() const;
58 59
59 void attach(const Node::AttachContext&); 60 void attach(const Node::AttachContext&);
60 void detach(const Node::AttachContext&); 61 void detach(const Node::AttachContext&);
61 62
62 void removeAllEventListeners(); 63 void removeAllEventListeners();
63 64
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 inline void ElementShadow::distributeIfNeeded() 124 inline void ElementShadow::distributeIfNeeded()
124 { 125 {
125 if (m_needsDistributionRecalc) 126 if (m_needsDistributionRecalc)
126 distribute(); 127 distribute();
127 m_needsDistributionRecalc = false; 128 m_needsDistributionRecalc = false;
128 } 129 }
129 130
130 } // namespace 131 } // namespace
131 132
132 #endif 133 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698