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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made InspectorBaseAgent RefCounted 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
Index: Source/core/inspector/WorkerConsoleAgent.h
diff --git a/Source/core/inspector/WorkerConsoleAgent.h b/Source/core/inspector/WorkerConsoleAgent.h
index 27ec0acfaa4cc60ee212facf9ea5124d0e16c64f..1796c575ef8498def033620c3794103112149008 100644
--- a/Source/core/inspector/WorkerConsoleAgent.h
+++ b/Source/core/inspector/WorkerConsoleAgent.h
@@ -39,19 +39,35 @@ namespace WebCore {
class WorkerConsoleAgent : public InspectorConsoleAgent {
WTF_MAKE_NONCOPYABLE(WorkerConsoleAgent);
public:
- static PassOwnPtr<WorkerConsoleAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InjectedScriptManager* injectedScriptManager)
+ static PassRefPtr<WorkerConsoleAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, InjectedScriptManager* injectedScriptManager)
{
- return adoptPtr(new WorkerConsoleAgent(instrumentingAgents, state, injectedScriptManager));
+ return adoptRef(new WorkerConsoleAgent(instrumentingAgents, state, injectedScriptManager));
}
virtual ~WorkerConsoleAgent();
virtual bool isWorkerAgent() OVERRIDE { return true; }
private:
- WorkerConsoleAgent(InstrumentingAgents*, InspectorCompositeState*, InjectedScriptManager*);
+ WorkerConsoleAgent(InstrumentingAgents*, InspectorState*, InjectedScriptManager*);
virtual void addInspectedNode(ErrorString*, int nodeId);
};
+class WorkerConsoleController: public InspectorConsoleController {
+public:
+
+ static PassOwnPtr<WorkerConsoleController> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager)
+ {
+ return adoptPtr(new WorkerConsoleController(instrumentingAgents, compositeState, injectedScriptManager));
+ }
+
+protected:
+ WorkerConsoleController(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InjectedScriptManager* injectedScriptManager)
+ : InspectorConsoleController(instrumentingAgents, compositeState)
+ {
+ setAgent(WorkerConsoleAgent::create(m_instrumentingAgents, m_state, injectedScriptManager));
+ }
+};
+
} // namespace WebCore
#endif // !defined(WorkerConsoleAgent_h)

Powered by Google App Engine
This is Rietveld 408576698