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

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

Issue 327203002: Revert of DevTools: notify backend agents about profiler started/stopped events (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
« 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
62 59
63 String name() { return m_name; } 60 String name() { return m_name; }
64 void appended(InstrumentingAgents*, InspectorState*); 61 void appended(InstrumentingAgents*, InspectorState*);
65 62
66 protected: 63 protected:
67 InstrumentingAgents* m_instrumentingAgents; 64 InstrumentingAgents* m_instrumentingAgents;
68 InspectorState* m_state; 65 InspectorState* m_state;
69 66
70 private: 67 private:
71 String m_name; 68 String m_name;
72 }; 69 };
73 70
74 class InspectorAgentRegistry { 71 class InspectorAgentRegistry {
75 public: 72 public:
76 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); 73 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*);
77 void append(PassOwnPtr<InspectorAgent>); 74 void append(PassOwnPtr<InspectorAgent>);
78 75
79 void setFrontend(InspectorFrontend*); 76 void setFrontend(InspectorFrontend*);
80 void clearFrontend(); 77 void clearFrontend();
81 void restore(); 78 void restore();
82 void registerInDispatcher(InspectorBackendDispatcher*); 79 void registerInDispatcher(InspectorBackendDispatcher*);
83 void discardAgents(); 80 void discardAgents();
84 void flushPendingFrontendMessages(); 81 void flushPendingFrontendMessages();
85 void profilerStarted();
86 void profilerStopped();
87 82
88 private: 83 private:
89 InstrumentingAgents* m_instrumentingAgents; 84 InstrumentingAgents* m_instrumentingAgents;
90 InspectorCompositeState* m_inspectorState; 85 InspectorCompositeState* m_inspectorState;
91 Vector<OwnPtr<InspectorAgent> > m_agents; 86 Vector<OwnPtr<InspectorAgent> > m_agents;
92 }; 87 };
93 88
94 template<typename T> 89 template<typename T>
95 class InspectorBaseAgent : public InspectorAgent { 90 class InspectorBaseAgent : public InspectorAgent {
96 public: 91 public:
97 virtual ~InspectorBaseAgent() { } 92 virtual ~InspectorBaseAgent() { }
98 93
99 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL 94 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL
100 { 95 {
101 dispatcher->registerAgent(static_cast<T*>(this)); 96 dispatcher->registerAgent(static_cast<T*>(this));
102 } 97 }
103 98
104 protected: 99 protected:
105 InspectorBaseAgent(const String& name) : InspectorAgent(name) 100 InspectorBaseAgent(const String& name) : InspectorAgent(name)
106 { 101 {
107 } 102 }
108 }; 103 };
109 104
110 } // namespace WebCore 105 } // namespace WebCore
111 106
112 #endif // !defined(InspectorBaseAgent_h) 107 #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