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

Unified Diff: Source/core/inspector/InspectorProfilerAgent.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/InspectorProfilerAgent.h
diff --git a/Source/core/inspector/InspectorProfilerAgent.h b/Source/core/inspector/InspectorProfilerAgent.h
index 98f48ba688ad55dd80c5abdd5ac4e5bc3f9cd846..1edba00edebb48887d23dec3e8bb8b740031017f 100644
--- a/Source/core/inspector/InspectorProfilerAgent.h
+++ b/Source/core/inspector/InspectorProfilerAgent.h
@@ -44,6 +44,7 @@ namespace WebCore {
class InjectedScriptManager;
class InspectorArray;
class InspectorConsoleAgent;
+class InspectorConsoleController;
class InspectorFrontend;
class InspectorObject;
class InspectorState;
@@ -55,10 +56,10 @@ class WorkerContext;
typedef String ErrorString;
-class InspectorProfilerAgent : public InspectorBaseAgent<InspectorProfilerAgent>, public InspectorBackendDispatcher::ProfilerCommandHandler {
+class InspectorProfilerAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::ProfilerCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorProfilerAgent); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorConsoleAgent*, InspectorCompositeState*, InjectedScriptManager*);
+ static PassRefPtr<InspectorProfilerAgent> create(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorConsoleAgent>, InjectedScriptManager*);
virtual ~InspectorProfilerAgent();
void addProfile(PassRefPtr<ScriptProfile> prpProfile, PassRefPtr<ScriptCallStack>);
@@ -89,7 +90,7 @@ public:
void didProcessTask();
private:
- InspectorProfilerAgent(InstrumentingAgents*, InspectorConsoleAgent*, InspectorCompositeState*, InjectedScriptManager*);
+ InspectorProfilerAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<InspectorConsoleAgent>, InjectedScriptManager*);
void addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL);
@@ -98,7 +99,7 @@ private:
PassRefPtr<TypeBuilder::Profiler::ProfileHeader> createProfileHeader(const ScriptProfile&);
- InspectorConsoleAgent* m_consoleAgent;
+ RefPtr<InspectorConsoleAgent> m_consoleAgent;
InjectedScriptManager* m_injectedScriptManager;
InspectorFrontend::Profiler* m_frontend;
bool m_recordingCPUProfile;
@@ -112,6 +113,18 @@ private:
double m_previousTaskEndTime;
};
+class InspectorProfilerController: public InspectorBaseController<InspectorProfilerController, InspectorProfilerAgent> {
+public:
+
+ static PassOwnPtr<InspectorProfilerController> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, InspectorConsoleController* consoleController, InjectedScriptManager* injectedScriptManager)
+ {
+ return adoptPtr(new InspectorProfilerController(instrumentingAgents, compositeState, consoleController, injectedScriptManager));
+ }
+
+protected:
+ InspectorProfilerController(InstrumentingAgents*, InspectorCompositeState*, InspectorConsoleController*, InjectedScriptManager*);
+};
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698