| OLD | NEW |
| 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 Loading... |
| 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; |
| 57 class InspectorTimelineAgent; | 58 class InspectorTimelineAgent; |
| 58 class InstrumentingAgents; | 59 class InstrumentingAgents; |
| 59 class ThreadableLoaderClient; | 60 class ThreadableLoaderClient; |
| 60 class WorkerGlobalScope; | 61 class WorkerGlobalScope; |
| 61 class WorkerInspectorProxy; | 62 class WorkerInspectorProxy; |
| 62 | 63 |
| 63 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value; | 64 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value; |
| 64 | 65 |
| 65 class InspectorInstrumentationCookie { | 66 class InspectorInstrumentationCookie { |
| 66 STACK_ALLOCATED(); | 67 STACK_ALLOCATED(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 93 inline void frontendCreated() { atomicIncrement(&FrontendCounter::s_frontendCoun
ter); } | 94 inline void frontendCreated() { atomicIncrement(&FrontendCounter::s_frontendCoun
ter); } |
| 94 inline void frontendDeleted() { atomicDecrement(&FrontendCounter::s_frontendCoun
ter); } | 95 inline void frontendDeleted() { atomicDecrement(&FrontendCounter::s_frontendCoun
ter); } |
| 95 inline bool hasFrontends() { return FrontendCounter::s_frontendCounter; } | 96 inline bool hasFrontends() { return FrontendCounter::s_frontendCounter; } |
| 96 | 97 |
| 97 void registerInstrumentingAgents(InstrumentingAgents*); | 98 void registerInstrumentingAgents(InstrumentingAgents*); |
| 98 void unregisterInstrumentingAgents(InstrumentingAgents*); | 99 void unregisterInstrumentingAgents(InstrumentingAgents*); |
| 99 | 100 |
| 100 InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCook
ie&); | 101 InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCook
ie&); |
| 101 | 102 |
| 102 // Called from generated instrumentation code. | 103 // Called from generated instrumentation code. |
| 104 InstrumentingAgents* instrumentingAgentsFor(Page*); |
| 103 InstrumentingAgents* instrumentingAgentsFor(LocalFrame*); | 105 InstrumentingAgents* instrumentingAgentsFor(LocalFrame*); |
| 104 InstrumentingAgents* instrumentingAgentsFor(EventTarget*); | 106 InstrumentingAgents* instrumentingAgentsFor(EventTarget*); |
| 105 InstrumentingAgents* instrumentingAgentsFor(ExecutionContext*); | 107 InstrumentingAgents* instrumentingAgentsFor(ExecutionContext*); |
| 106 InstrumentingAgents* instrumentingAgentsFor(Document&); | 108 InstrumentingAgents* instrumentingAgentsFor(Document&); |
| 107 InstrumentingAgents* instrumentingAgentsFor(Document*); | 109 InstrumentingAgents* instrumentingAgentsFor(Document*); |
| 108 InstrumentingAgents* instrumentingAgentsFor(RenderObject*); | 110 InstrumentingAgents* instrumentingAgentsFor(RenderObject*); |
| 109 InstrumentingAgents* instrumentingAgentsFor(Node*); | 111 InstrumentingAgents* instrumentingAgentsFor(Node*); |
| 110 InstrumentingAgents* instrumentingAgentsFor(WorkerGlobalScope*); | 112 InstrumentingAgents* instrumentingAgentsFor(WorkerGlobalScope*); |
| 113 InstrumentingAgents* instrumentingAgentsFor(FrameHost*); |
| 111 | 114 |
| 112 // Helper for the one above. | 115 // Helper for the one above. |
| 113 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*)
; | 116 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*)
; |
| 114 | 117 |
| 115 } // namespace InspectorInstrumentation | 118 } // namespace InspectorInstrumentation |
| 116 | 119 |
| 117 namespace InstrumentationEvents { | 120 namespace InstrumentationEvents { |
| 118 extern const char PaintSetup[]; | 121 extern const char PaintSetup[]; |
| 119 extern const char Paint[]; | 122 extern const char Paint[]; |
| 120 extern const char Layer[]; | 123 extern const char Layer[]; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 135 | 138 |
| 136 namespace InspectorInstrumentation { | 139 namespace InspectorInstrumentation { |
| 137 | 140 |
| 138 inline InstrumentingAgents* instrumentingAgentsFor(ExecutionContext* context) | 141 inline InstrumentingAgents* instrumentingAgentsFor(ExecutionContext* context) |
| 139 { | 142 { |
| 140 if (!context) | 143 if (!context) |
| 141 return 0; | 144 return 0; |
| 142 return context->isDocument() ? instrumentingAgentsFor(*toDocument(context))
: instrumentingAgentsForNonDocumentContext(context); | 145 return context->isDocument() ? instrumentingAgentsFor(*toDocument(context))
: instrumentingAgentsForNonDocumentContext(context); |
| 143 } | 146 } |
| 144 | 147 |
| 148 inline InstrumentingAgents* instrumentingAgentsFor(LocalFrame* frame) |
| 149 { |
| 150 return frame ? instrumentingAgentsFor(frame->page()) : 0; |
| 151 } |
| 152 |
| 145 inline InstrumentingAgents* instrumentingAgentsFor(Document& document) | 153 inline InstrumentingAgents* instrumentingAgentsFor(Document& document) |
| 146 { | 154 { |
| 147 LocalFrame* frame = document.frame(); | 155 Page* page = document.page(); |
| 148 if (!frame && document.templateDocumentHost()) | 156 if (!page && document.templateDocumentHost()) |
| 149 frame = document.templateDocumentHost()->frame(); | 157 page = document.templateDocumentHost()->page(); |
| 150 return instrumentingAgentsFor(frame); | 158 return instrumentingAgentsFor(page); |
| 151 } | 159 } |
| 152 | 160 |
| 153 inline InstrumentingAgents* instrumentingAgentsFor(Document* document) | 161 inline InstrumentingAgents* instrumentingAgentsFor(Document* document) |
| 154 { | 162 { |
| 155 return document ? instrumentingAgentsFor(*document) : 0; | 163 return document ? instrumentingAgentsFor(*document) : 0; |
| 156 } | 164 } |
| 157 | 165 |
| 158 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleSheet* styleSheet) | 166 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleSheet* styleSheet) |
| 159 { | 167 { |
| 160 return styleSheet ? instrumentingAgentsFor(styleSheet->ownerDocument()) : 0; | 168 return styleSheet ? instrumentingAgentsFor(styleSheet->ownerDocument()) : 0; |
| 161 } | 169 } |
| 162 | 170 |
| 163 inline InstrumentingAgents* instrumentingAgentsFor(Node* node) | 171 inline InstrumentingAgents* instrumentingAgentsFor(Node* node) |
| 164 { | 172 { |
| 165 return node ? instrumentingAgentsFor(node->document()) : 0; | 173 return node ? instrumentingAgentsFor(node->document()) : 0; |
| 166 } | 174 } |
| 167 | 175 |
| 168 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleDeclaration* declarat
ion) | 176 inline InstrumentingAgents* instrumentingAgentsFor(CSSStyleDeclaration* declarat
ion) |
| 169 { | 177 { |
| 170 return declaration ? instrumentingAgentsFor(declaration->parentStyleSheet())
: 0; | 178 return declaration ? instrumentingAgentsFor(declaration->parentStyleSheet())
: 0; |
| 171 } | 179 } |
| 172 | 180 |
| 173 } // namespace InspectorInstrumentation | 181 } // namespace InspectorInstrumentation |
| 174 | 182 |
| 183 InstrumentingAgents* instrumentationForPage(Page*); |
| 184 |
| 175 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*); | 185 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*); |
| 176 | 186 |
| 177 } // namespace blink | 187 } // namespace blink |
| 178 | 188 |
| 179 #include "core/InspectorInstrumentationInl.h" | 189 #include "core/InspectorInstrumentationInl.h" |
| 180 | 190 |
| 181 #include "core/inspector/InspectorInstrumentationCustomInl.h" | 191 #include "core/inspector/InspectorInstrumentationCustomInl.h" |
| 182 | 192 |
| 183 #include "core/InspectorOverridesInl.h" | 193 #include "core/InspectorOverridesInl.h" |
| 184 | 194 |
| 185 #endif // !defined(InspectorInstrumentation_h) | 195 #endif // !defined(InspectorInstrumentation_h) |
| OLD | NEW |