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

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

Issue 321173002: DevTools: notify backend agents about profiler started/stopped events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed 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
« no previous file with comments | « no previous file | Source/core/inspector/InspectorBaseAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 virtual ~InspectorAgent(); 49 virtual ~InspectorAgent();
50 50
51 virtual void init() { } 51 virtual void init() { }
52 virtual void setFrontend(InspectorFrontend*) { } 52 virtual void setFrontend(InspectorFrontend*) { }
53 virtual void clearFrontend() { } 53 virtual void clearFrontend() { }
54 virtual void restore() { } 54 virtual void restore() { }
55 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; 55 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0;
56 virtual void discardAgent() { } 56 virtual void discardAgent() { }
57 virtual void didCommitLoadForMainFrame() { } 57 virtual void didCommitLoadForMainFrame() { }
58 virtual void flushPendingFrontendMessages() { } 58 virtual void flushPendingFrontendMessages() { }
59 virtual void profilerStarted() { }
60 virtual void profilerStopped() { }
61
59 62
60 String name() { return m_name; } 63 String name() { return m_name; }
61 void appended(InstrumentingAgents*, InspectorState*); 64 void appended(InstrumentingAgents*, InspectorState*);
62 65
63 protected: 66 protected:
64 InstrumentingAgents* m_instrumentingAgents; 67 InstrumentingAgents* m_instrumentingAgents;
65 InspectorState* m_state; 68 InspectorState* m_state;
66 69
67 private: 70 private:
68 String m_name; 71 String m_name;
69 }; 72 };
70 73
71 class InspectorAgentRegistry { 74 class InspectorAgentRegistry {
72 public: 75 public:
73 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); 76 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*);
74 void append(PassOwnPtr<InspectorAgent>); 77 void append(PassOwnPtr<InspectorAgent>);
75 78
76 void setFrontend(InspectorFrontend*); 79 void setFrontend(InspectorFrontend*);
77 void clearFrontend(); 80 void clearFrontend();
78 void restore(); 81 void restore();
79 void registerInDispatcher(InspectorBackendDispatcher*); 82 void registerInDispatcher(InspectorBackendDispatcher*);
80 void discardAgents(); 83 void discardAgents();
81 void flushPendingFrontendMessages(); 84 void flushPendingFrontendMessages();
85 void profilerStarted();
86 void profilerStopped();
82 87
83 private: 88 private:
84 InstrumentingAgents* m_instrumentingAgents; 89 InstrumentingAgents* m_instrumentingAgents;
85 InspectorCompositeState* m_inspectorState; 90 InspectorCompositeState* m_inspectorState;
86 Vector<OwnPtr<InspectorAgent> > m_agents; 91 Vector<OwnPtr<InspectorAgent> > m_agents;
87 }; 92 };
88 93
89 template<typename T> 94 template<typename T>
90 class InspectorBaseAgent : public InspectorAgent { 95 class InspectorBaseAgent : public InspectorAgent {
91 public: 96 public:
92 virtual ~InspectorBaseAgent() { } 97 virtual ~InspectorBaseAgent() { }
93 98
94 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL 99 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL
95 { 100 {
96 dispatcher->registerAgent(static_cast<T*>(this)); 101 dispatcher->registerAgent(static_cast<T*>(this));
97 } 102 }
98 103
99 protected: 104 protected:
100 InspectorBaseAgent(const String& name) : InspectorAgent(name) 105 InspectorBaseAgent(const String& name) : InspectorAgent(name)
101 { 106 {
102 } 107 }
103 }; 108 };
104 109
105 } // namespace WebCore 110 } // namespace WebCore
106 111
107 #endif // !defined(InspectorBaseAgent_h) 112 #endif // !defined(InspectorBaseAgent_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorBaseAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698