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

Side by Side Diff: Source/core/inspector/InspectorCSSAgent.h

Issue 306053010: Tried using CrossThreadPersistent for workerDebuggerAgents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 { 90 {
91 m_contentSecurityPolicy->setOverrideAllowInlineStyle(false); 91 m_contentSecurityPolicy->setOverrideAllowInlineStyle(false);
92 } 92 }
93 93
94 private: 94 private:
95 ContentSecurityPolicy* m_contentSecurityPolicy; 95 ContentSecurityPolicy* m_contentSecurityPolicy;
96 }; 96 };
97 97
98 static CSSStyleRule* asCSSStyleRule(CSSRule*); 98 static CSSStyleRule* asCSSStyleRule(CSSRule*);
99 99
100 static PassOwnPtr<InspectorCSSAgent> create(InspectorDOMAgent* domAgent, Ins pectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent) 100 static PassOwnPtrWillBeRawPtr<InspectorCSSAgent> create(InspectorDOMAgent* d omAgent, InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent)
101 { 101 {
102 return adoptPtr(new InspectorCSSAgent(domAgent, pageAgent, resourceAgent )); 102 return adoptPtrWillBeNoop(new InspectorCSSAgent(domAgent, pageAgent, res ourceAgent));
103 } 103 }
104 virtual ~InspectorCSSAgent(); 104 virtual ~InspectorCSSAgent();
105 virtual void trace(Visitor*) OVERRIDE;
105 106
106 bool forcePseudoState(Element*, CSSSelector::PseudoType); 107 bool forcePseudoState(Element*, CSSSelector::PseudoType);
107 virtual void setFrontend(InspectorFrontend*) OVERRIDE; 108 virtual void setFrontend(InspectorFrontend*) OVERRIDE;
108 virtual void clearFrontend() OVERRIDE; 109 virtual void clearFrontend() OVERRIDE;
109 virtual void discardAgent() OVERRIDE; 110 virtual void discardAgent() OVERRIDE;
110 virtual void didCommitLoadForMainFrame() OVERRIDE; 111 virtual void didCommitLoadForMainFrame() OVERRIDE;
111 virtual void restore() OVERRIDE; 112 virtual void restore() OVERRIDE;
112 virtual void flushPendingFrontendMessages() OVERRIDE; 113 virtual void flushPendingFrontendMessages() OVERRIDE;
113 virtual void enable(ErrorString*, PassRefPtr<EnableCallback>) OVERRIDE; 114 virtual void enable(ErrorString*, PassRefPtr<EnableCallback>) OVERRIDE;
114 virtual void disable(ErrorString*) OVERRIDE; 115 virtual void disable(ErrorString*) OVERRIDE;
(...skipping 26 matching lines...) Expand all
141 private: 142 private:
142 class StyleSheetAction; 143 class StyleSheetAction;
143 class SetStyleSheetTextAction; 144 class SetStyleSheetTextAction;
144 class SetPropertyTextAction; 145 class SetPropertyTextAction;
145 class SetRuleSelectorAction; 146 class SetRuleSelectorAction;
146 class AddRuleAction; 147 class AddRuleAction;
147 class EnableResourceClient; 148 class EnableResourceClient;
148 149
149 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*); 150 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*);
150 151
151 typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleShee t; 152 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheet> > IdToInspectorStyleSheet;
152 typedef HashMap<String, RefPtr<InspectorStyleSheetForInlineStyle> > IdToInsp ectorStyleSheetForInlineStyle; 153 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheetForI nlineStyle> > IdToInspectorStyleSheetForInlineStyle;
153 typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToIns pectorStyleSheet; // bogus "stylesheets" with elements' inline styles 154 typedef WillBeHeapHashMap<Node*, RefPtrWillBeMember<InspectorStyleSheetForIn lineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' in line styles
154 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState; 155 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState;
155 156
156 void wasEnabled(PassRefPtr<EnableCallback>); 157 void wasEnabled(PassRefPtr<EnableCallback>);
157 void resetNonPersistentData(); 158 void resetNonPersistentData();
158 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element); 159 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
159 Element* elementForId(ErrorString*, int nodeId); 160 Element* elementForId(ErrorString*, int nodeId);
160 void collectAllStyleSheets(Vector<InspectorStyleSheet*>&); 161 void collectAllStyleSheets(Vector<InspectorStyleSheet*>&);
161 void collectAllDocumentStyleSheets(Document*, Vector<CSSStyleSheet*>&); 162 void collectAllDocumentStyleSheets(Document*, Vector<CSSStyleSheet*>&);
162 void collectStyleSheets(CSSStyleSheet*, Vector<CSSStyleSheet*>&); 163 void collectStyleSheets(CSSStyleSheet*, Vector<CSSStyleSheet*>&);
163 164
(...skipping 21 matching lines...) Expand all
185 virtual void didModifyDOMAttr(Element*) OVERRIDE; 186 virtual void didModifyDOMAttr(Element*) OVERRIDE;
186 187
187 // InspectorStyleSheet::Listener implementation 188 // InspectorStyleSheet::Listener implementation
188 virtual void styleSheetChanged(InspectorStyleSheetBase*) OVERRIDE; 189 virtual void styleSheetChanged(InspectorStyleSheetBase*) OVERRIDE;
189 virtual void willReparseStyleSheet() OVERRIDE; 190 virtual void willReparseStyleSheet() OVERRIDE;
190 virtual void didReparseStyleSheet() OVERRIDE; 191 virtual void didReparseStyleSheet() OVERRIDE;
191 192
192 void resetPseudoStates(); 193 void resetPseudoStates();
193 194
194 InspectorFrontend::CSS* m_frontend; 195 InspectorFrontend::CSS* m_frontend;
195 InspectorDOMAgent* m_domAgent; 196 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
196 InspectorPageAgent* m_pageAgent; 197 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
197 InspectorResourceAgent* m_resourceAgent; 198 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent;
198 199
199 IdToInspectorStyleSheet m_idToInspectorStyleSheet; 200 IdToInspectorStyleSheet m_idToInspectorStyleSheet;
200 IdToInspectorStyleSheetForInlineStyle m_idToInspectorStyleSheetForInlineStyl e; 201 IdToInspectorStyleSheetForInlineStyle m_idToInspectorStyleSheetForInlineStyl e;
201 HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > m_cssStyleSheetToInspe ctorStyleSheet; 202 WillBeHeapHashMap<CSSStyleSheet*, RefPtrWillBeMember<InspectorStyleSheet> > m_cssStyleSheetToInspectorStyleSheet;
202 typedef HashMap<Document*, OwnPtr<HashSet<CSSStyleSheet*> > > DocumentStyleS heets; 203 typedef HashMap<Document*, OwnPtr<HashSet<CSSStyleSheet*> > > DocumentStyleS heets;
203 DocumentStyleSheets m_documentToCSSStyleSheets; 204 DocumentStyleSheets m_documentToCSSStyleSheets;
204 HashSet<Document*> m_invalidatedDocuments; 205 HashSet<Document*> m_invalidatedDocuments;
205 206
206 NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet; 207 NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet;
207 HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > m_documentToViaInspe ctorStyleSheet; // "via inspector" stylesheets 208 HashMap<RefPtr<Document>, RefPtrWillBeMember<InspectorStyleSheet> > m_docume ntToViaInspectorStyleSheet; // "via inspector" stylesheets
208 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; 209 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
209 210
210 RefPtrWillBePersistent<CSSStyleSheet> m_inspectorUserAgentStyleSheet; 211 RefPtrWillBeMember<CSSStyleSheet> m_inspectorUserAgentStyleSheet;
211 212
212 int m_lastStyleSheetId; 213 int m_lastStyleSheetId;
213 int m_styleSheetsPendingMutation; 214 int m_styleSheetsPendingMutation;
214 bool m_styleDeclarationPendingMutation; 215 bool m_styleDeclarationPendingMutation;
215 bool m_creatingViaInspectorStyleSheet; 216 bool m_creatingViaInspectorStyleSheet;
216 bool m_isSettingStyleSheetText; 217 bool m_isSettingStyleSheetText;
217 218
218 friend class EnableResourceClient; 219 friend class EnableResourceClient;
219 friend class StyleSheetBinder; 220 friend class StyleSheetBinder;
220 }; 221 };
221 222
222 223
223 } // namespace WebCore 224 } // namespace WebCore
224 225
225 #endif // !defined(InspectorCSSAgent_h) 226 #endif // !defined(InspectorCSSAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorBaseAgent.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698