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

Unified Diff: Source/core/inspector/InspectorCSSAgent.h

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorBaseAgent.cpp ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorCSSAgent.h
diff --git a/Source/core/inspector/InspectorCSSAgent.h b/Source/core/inspector/InspectorCSSAgent.h
index 5eafc008a6bf6e1b02ee28de69195d2122a73b5e..229b4b572d38ae24a519c7d023b8ad1b72af471b 100644
--- a/Source/core/inspector/InspectorCSSAgent.h
+++ b/Source/core/inspector/InspectorCSSAgent.h
@@ -67,7 +67,7 @@ class UpdateRegionLayoutTask;
typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToInspectorStyleSheet;
class InspectorCSSAgent
- : public InspectorBaseAgent<InspectorCSSAgent>
+ : public InspectorBaseAgent
, public InspectorDOMAgent::DOMListener
, public InspectorBackendDispatcher::CSSCommandHandler
, public InspectorStyleSheet::Listener {
@@ -100,11 +100,11 @@ public:
static CSSStyleRule* asCSSStyleRule(CSSRule*);
static bool cssErrorFilter(const CSSParserString& content, int propertyId, int errorType);
- static PassOwnPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAgent)
+ static PassRefPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, PassRefPtr<InspectorDOMAgent> domAgent, PassRefPtr<InspectorPageAgent> pageAgent)
{
- return adoptPtr(new InspectorCSSAgent(instrumentingAgents, state, domAgent, pageAgent));
+ return adoptRef(new InspectorCSSAgent(instrumentingAgents, state, domAgent, pageAgent));
}
- ~InspectorCSSAgent();
+ virtual ~InspectorCSSAgent();
bool forcePseudoState(Element*, CSSSelector::PseudoType);
virtual void setFrontend(InspectorFrontend*);
@@ -159,7 +159,7 @@ private:
class SetRuleSelectorAction;
class AddRuleAction;
- InspectorCSSAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorDOMAgent*, InspectorPageAgent*);
+ InspectorCSSAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorDOMAgent>, PassRefPtr<InspectorPageAgent>);
typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleSheet;
typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' inline styles
@@ -197,8 +197,8 @@ private:
void resetPseudoStates();
InspectorFrontend::CSS* m_frontend;
- InspectorDOMAgent* m_domAgent;
- InspectorPageAgent* m_pageAgent;
+ RefPtr<InspectorDOMAgent> m_domAgent;
+ RefPtr<InspectorPageAgent> m_pageAgent;
IdToInspectorStyleSheet m_idToInspectorStyleSheet;
CSSStyleSheetToInspectorStyleSheet m_cssStyleSheetToInspectorStyleSheet;
@@ -216,6 +216,17 @@ private:
friend class StyleSheetBinder;
};
+class InspectorCSSFactory : public InspectorBaseFactory<InspectorCSSFactory, InspectorCSSAgent> {
+public:
+
+ static PassOwnPtr<InspectorCSSFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorDOMFactory* domFactory, InspectorPageFactory* pageFactory)
+ {
+ return adoptPtr(new InspectorCSSFactory(instrumentingAgents, compositeState, domFactory, pageFactory));
+ }
+
+protected:
+ InspectorCSSFactory(InstrumentingAgents*, InspectorCompositeState*, InspectorDOMFactory*, InspectorPageFactory*);
+};
} // namespace WebCore
« 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