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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentStyleSheetCollector.h

Issue 2572473006: Revert of Collect active stylesheets and and apply asynchronously. (Closed)
Patch Set: Created 4 years 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 10 matching lines...) Expand all
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #ifndef DocumentStyleSheetCollector_h 27 #ifndef DocumentStyleSheetCollector_h
28 #define DocumentStyleSheetCollector_h 28 #define DocumentStyleSheetCollector_h
29 29
30 #include "bindings/core/v8/TraceWrapperMember.h" 30 #include "bindings/core/v8/TraceWrapperMember.h"
31 #include "core/css/ActiveStyleSheets.h"
32 #include "platform/heap/Handle.h" 31 #include "platform/heap/Handle.h"
33 #include "wtf/HashSet.h" 32 #include "wtf/HashSet.h"
34 #include "wtf/Vector.h" 33 #include "wtf/Vector.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
37 class CSSStyleSheet;
38 class Document; 38 class Document;
39 class StyleSheet; 39 class StyleSheet;
40 class StyleSheetCollection; 40 class StyleSheetCollection;
41 41
42 class DocumentStyleSheetCollector { 42 class DocumentStyleSheetCollector {
43 // This class contains references to two on-heap collections, therefore 43 // This class contains references to two on-heap collections, therefore
44 // it's unhealthy to have it anywhere but on the stack, where stack 44 // it's unhealthy to have it anywhere but on the stack, where stack
45 // scanning will keep them alive. 45 // scanning will keep them alive.
46 STACK_ALLOCATED(); 46 STACK_ALLOCATED();
47 47
48 public: 48 public:
49 friend class ImportedDocumentStyleSheetCollector; 49 friend class ImportedDocumentStyleSheetCollector;
50 50
51 DocumentStyleSheetCollector(StyleSheetCollection*, 51 DocumentStyleSheetCollector(StyleSheetCollection*,
52 HeapVector<Member<StyleSheet>>*, 52 HeapVector<Member<StyleSheet>>*,
53 HeapHashSet<Member<Document>>*); 53 HeapHashSet<Member<Document>>*);
54 ~DocumentStyleSheetCollector(); 54 ~DocumentStyleSheetCollector();
55 55
56 void appendActiveStyleSheet(const ActiveStyleSheet&); 56 void appendActiveStyleSheets(
57 const HeapVector<TraceWrapperMember<CSSStyleSheet>>&);
58 void appendActiveStyleSheet(CSSStyleSheet*);
57 void appendSheetForList(StyleSheet*); 59 void appendSheetForList(StyleSheet*);
58 60
59 bool hasVisited(Document* document) const { 61 bool hasVisited(Document* document) const {
60 return m_visitedDocuments->contains(document); 62 return m_visitedDocuments->contains(document);
61 } 63 }
62 void willVisit(Document* document) { m_visitedDocuments->add(document); } 64 void willVisit(Document* document) { m_visitedDocuments->add(document); }
63 65
64 private: 66 private:
65 Member<StyleSheetCollection> m_collection; 67 Member<StyleSheetCollection> m_collection;
66 HeapVector<Member<StyleSheet>>* m_styleSheetsForStyleSheetList; 68 HeapVector<Member<StyleSheet>>* m_styleSheetsForStyleSheetList;
(...skipping 12 matching lines...) Expand all
79 class ImportedDocumentStyleSheetCollector final 81 class ImportedDocumentStyleSheetCollector final
80 : public DocumentStyleSheetCollector { 82 : public DocumentStyleSheetCollector {
81 public: 83 public:
82 ImportedDocumentStyleSheetCollector(DocumentStyleSheetCollector&, 84 ImportedDocumentStyleSheetCollector(DocumentStyleSheetCollector&,
83 HeapVector<Member<StyleSheet>>&); 85 HeapVector<Member<StyleSheet>>&);
84 }; 86 };
85 87
86 } // namespace blink 88 } // namespace blink
87 89
88 #endif // DocumentStyleSheetCollector_h 90 #endif // DocumentStyleSheetCollector_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698