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

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

Issue 898593002: DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed assertion Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "platform/network/FormData.h" 47 #include "platform/network/FormData.h"
48 #include "platform/network/WebSocketHandshakeRequest.h" 48 #include "platform/network/WebSocketHandshakeRequest.h"
49 #include "platform/network/WebSocketHandshakeResponse.h" 49 #include "platform/network/WebSocketHandshakeResponse.h"
50 #include "wtf/RefPtr.h" 50 #include "wtf/RefPtr.h"
51 51
52 namespace blink { 52 namespace blink {
53 53
54 class Document; 54 class Document;
55 class EventTarget; 55 class EventTarget;
56 class ExecutionContext; 56 class ExecutionContext;
57 class FrameHost;
58 class InspectorTimelineAgent; 57 class InspectorTimelineAgent;
59 class InstrumentingAgents; 58 class InstrumentingAgents;
60 class ThreadableLoaderClient; 59 class ThreadableLoaderClient;
61 class WorkerGlobalScope; 60 class WorkerGlobalScope;
62 class WorkerInspectorProxy; 61 class WorkerInspectorProxy;
63 62
64 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value; 63 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value;
65 64
66 class InspectorInstrumentationCookie { 65 class InspectorInstrumentationCookie {
67 STACK_ALLOCATED(); 66 STACK_ALLOCATED();
(...skipping 26 matching lines...) Expand all
94 inline void frontendCreated() { atomicIncrement(&FrontendCounter::s_frontendCoun ter); } 93 inline void frontendCreated() { atomicIncrement(&FrontendCounter::s_frontendCoun ter); }
95 inline void frontendDeleted() { atomicDecrement(&FrontendCounter::s_frontendCoun ter); } 94 inline void frontendDeleted() { atomicDecrement(&FrontendCounter::s_frontendCoun ter); }
96 inline bool hasFrontends() { return FrontendCounter::s_frontendCounter; } 95 inline bool hasFrontends() { return FrontendCounter::s_frontendCounter; }
97 96
98 void registerInstrumentingAgents(InstrumentingAgents*); 97 void registerInstrumentingAgents(InstrumentingAgents*);
99 void unregisterInstrumentingAgents(InstrumentingAgents*); 98 void unregisterInstrumentingAgents(InstrumentingAgents*);
100 99
101 InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCook ie&); 100 InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCook ie&);
102 101
103 // Called from generated instrumentation code. 102 // Called from generated instrumentation code.
104 InstrumentingAgents* instrumentingAgentsFor(Page*);
105 InstrumentingAgents* instrumentingAgentsFor(LocalFrame*); 103 InstrumentingAgents* instrumentingAgentsFor(LocalFrame*);
106 InstrumentingAgents* instrumentingAgentsFor(EventTarget*); 104 InstrumentingAgents* instrumentingAgentsFor(EventTarget*);
107 InstrumentingAgents* instrumentingAgentsFor(ExecutionContext*); 105 InstrumentingAgents* instrumentingAgentsFor(ExecutionContext*);
108 InstrumentingAgents* instrumentingAgentsFor(Document&); 106 InstrumentingAgents* instrumentingAgentsFor(Document&);
109 InstrumentingAgents* instrumentingAgentsFor(Document*); 107 InstrumentingAgents* instrumentingAgentsFor(Document*);
110 InstrumentingAgents* instrumentingAgentsFor(RenderObject*); 108 InstrumentingAgents* instrumentingAgentsFor(RenderObject*);
111 InstrumentingAgents* instrumentingAgentsFor(Node*); 109 InstrumentingAgents* instrumentingAgentsFor(Node*);
112 InstrumentingAgents* instrumentingAgentsFor(WorkerGlobalScope*); 110 InstrumentingAgents* instrumentingAgentsFor(WorkerGlobalScope*);
113 InstrumentingAgents* instrumentingAgentsFor(FrameHost*);
114 111
115 // Helper for the one above. 112 // Helper for the one above.
116 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*) ; 113 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*) ;
117 114
118 } // namespace InspectorInstrumentation 115 } // namespace InspectorInstrumentation
119 116
120 namespace InstrumentationEvents { 117 namespace InstrumentationEvents {
121 extern const char PaintSetup[]; 118 extern const char PaintSetup[];
122 extern const char Paint[]; 119 extern const char Paint[];
123 extern const char Layer[]; 120 extern const char Layer[];
(...skipping 14 matching lines...) Expand all
138 135
139 namespace InspectorInstrumentation { 136 namespace InspectorInstrumentation {
140 137
141 inline InstrumentingAgents* instrumentingAgentsFor(ExecutionContext* context) 138 inline InstrumentingAgents* instrumentingAgentsFor(ExecutionContext* context)
142 { 139 {
143 if (!context) 140 if (!context)
144 return 0; 141 return 0;
145 return context->isDocument() ? instrumentingAgentsFor(*toDocument(context)) : instrumentingAgentsForNonDocumentContext(context); 142 return context->isDocument() ? instrumentingAgentsFor(*toDocument(context)) : instrumentingAgentsForNonDocumentContext(context);
146 } 143 }
147 144
148 inline InstrumentingAgents* instrumentingAgentsFor(LocalFrame* frame)
149 {
150 return frame ? instrumentingAgentsFor(frame->page()) : 0;
151 }
152
153 inline InstrumentingAgents* instrumentingAgentsFor(Document& document) 145 inline InstrumentingAgents* instrumentingAgentsFor(Document& document)
154 { 146 {
155 Page* page = document.page(); 147 LocalFrame* frame = document.frame();
156 if (!page && document.templateDocumentHost()) 148 if (!frame && document.templateDocumentHost())
157 page = document.templateDocumentHost()->page(); 149 frame = document.templateDocumentHost()->frame();
158 return instrumentingAgentsFor(page); 150 return instrumentingAgentsFor(frame);
159 } 151 }
160 152
161 inline InstrumentingAgents* instrumentingAgentsFor(Document* document) 153 inline InstrumentingAgents* instrumentingAgentsFor(Document* document)
162 { 154 {
163 return document ? instrumentingAgentsFor(*document) : 0; 155 return document ? instrumentingAgentsFor(*document) : 0;
164 } 156 }
165 157
166 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleSheet* styleSheet) 158 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleSheet* styleSheet)
167 { 159 {
168 return styleSheet ? instrumentingAgentsFor(styleSheet->ownerDocument()) : 0; 160 return styleSheet ? instrumentingAgentsFor(styleSheet->ownerDocument()) : 0;
169 } 161 }
170 162
171 inline InstrumentingAgents* instrumentingAgentsFor(Node* node) 163 inline InstrumentingAgents* instrumentingAgentsFor(Node* node)
172 { 164 {
173 return node ? instrumentingAgentsFor(node->document()) : 0; 165 return node ? instrumentingAgentsFor(node->document()) : 0;
174 } 166 }
175 167
176 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleDeclaration* declarat ion) 168 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleDeclaration* declarat ion)
177 { 169 {
178 return declaration ? instrumentingAgentsFor(declaration->parentStyleSheet()) : 0; 170 return declaration ? instrumentingAgentsFor(declaration->parentStyleSheet()) : 0;
179 } 171 }
180 172
181 } // namespace InspectorInstrumentation 173 } // namespace InspectorInstrumentation
182 174
183 InstrumentingAgents* instrumentationForPage(Page*);
184
185 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*); 175 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*);
186 176
187 } // namespace blink 177 } // namespace blink
188 178
189 #include "core/InspectorInstrumentationInl.h" 179 #include "core/InspectorInstrumentationInl.h"
190 180
191 #include "core/inspector/InspectorInstrumentationCustomInl.h" 181 #include "core/inspector/InspectorInstrumentationCustomInl.h"
192 182
193 #include "core/InspectorOverridesInl.h" 183 #include "core/InspectorOverridesInl.h"
194 184
195 #endif // !defined(InspectorInstrumentation_h) 185 #endif // !defined(InspectorInstrumentation_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInspectorAgent.cpp ('k') | Source/core/inspector/InspectorInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698