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

Side by Side Diff: third_party/WebKit/Source/core/instrumentation/CoreProbes.h

Issue 2772613002: [instrumentation] Rename InspectorInstrumentation into CoreProbes (Closed)
Patch Set: sinkFor -> toCoreProbesSink Created 3 years, 8 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
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
11 * copyright notice, this list of conditions and the following disclaimer 11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the 12 * in the documentation and/or other materials provided with the
13 * distribution. 13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its 14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from 15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission. 16 * this software without specific prior written permission.
17 * 17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef InspectorInstrumentation_h 31 #ifndef CoreProbes_h
32 #define InspectorInstrumentation_h 32 #define CoreProbes_h
33 33
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/Node.h" 36 #include "core/dom/Node.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/page/ChromeClient.h" 38 #include "core/page/ChromeClient.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 class InspectorInstrumentationAgents; 42 class CoreProbesSink;
43 class Resource; 43 class Resource;
44 class ThreadDebugger; 44 class ThreadDebugger;
45 class WorkerGlobalScope; 45 class WorkerGlobalScope;
46 46
47 namespace probe { 47 namespace probe {
48 48
49 class CORE_EXPORT ProbeBase { 49 class CORE_EXPORT ProbeBase {
50 STACK_ALLOCATED() 50 STACK_ALLOCATED()
51 51
52 public: 52 public:
(...skipping 16 matching lines...) Expand all
69 bool enabled = true); 69 bool enabled = true);
70 ~AsyncTask(); 70 ~AsyncTask();
71 71
72 private: 72 private:
73 ThreadDebugger* m_debugger; 73 ThreadDebugger* m_debugger;
74 void* m_task; 74 void* m_task;
75 bool m_recurring; 75 bool m_recurring;
76 }; 76 };
77 77
78 // Called from generated instrumentation code. 78 // Called from generated instrumentation code.
79 CORE_EXPORT InspectorInstrumentationAgents* instrumentingAgentsFor( 79 CORE_EXPORT CoreProbesSink* toCoreProbesSink(WorkerGlobalScope*);
80 WorkerGlobalScope*); 80 CORE_EXPORT CoreProbesSink* toCoreProbesSink(ExecutionContext*);
81 CORE_EXPORT InspectorInstrumentationAgents*
82 instrumentingAgentsForNonDocumentContext(ExecutionContext*);
83 81
84 inline InspectorInstrumentationAgents* instrumentingAgentsFor( 82 inline CoreProbesSink* toCoreProbesSink(LocalFrame* frame) {
85 LocalFrame* frame) {
86 return frame ? frame->instrumentingAgents() : nullptr; 83 return frame ? frame->instrumentingAgents() : nullptr;
87 } 84 }
88 85
89 inline InspectorInstrumentationAgents* instrumentingAgentsFor( 86 inline CoreProbesSink* toCoreProbesSink(Document& document) {
90 Document& document) {
91 LocalFrame* frame = document.frame(); 87 LocalFrame* frame = document.frame();
92 if (!frame && document.templateDocumentHost()) 88 if (!frame && document.templateDocumentHost())
93 frame = document.templateDocumentHost()->frame(); 89 frame = document.templateDocumentHost()->frame();
94 return instrumentingAgentsFor(frame); 90 return toCoreProbesSink(frame);
95 } 91 }
96 92
97 inline InspectorInstrumentationAgents* instrumentingAgentsFor( 93 inline CoreProbesSink* toCoreProbesSink(Document* document) {
98 Document* document) { 94 return document ? toCoreProbesSink(*document) : nullptr;
99 return document ? instrumentingAgentsFor(*document) : nullptr;
100 } 95 }
101 96
102 inline InspectorInstrumentationAgents* instrumentingAgentsFor( 97 inline CoreProbesSink* toCoreProbesSink(ExecutionContext* context) {
103 ExecutionContext* context) {
104 if (!context) 98 if (!context)
105 return nullptr; 99 return nullptr;
106 return context->isDocument() 100 return context->isDocument() ? toCoreProbesSink(*toDocument(context))
107 ? instrumentingAgentsFor(*toDocument(context)) 101 : toCoreProbesSink(context);
108 : instrumentingAgentsForNonDocumentContext(context);
109 } 102 }
110 103
111 inline InspectorInstrumentationAgents* instrumentingAgentsFor(Node* node) { 104 inline CoreProbesSink* toCoreProbesSink(Node* node) {
112 return node ? instrumentingAgentsFor(node->document()) : nullptr; 105 return node ? toCoreProbesSink(node->document()) : nullptr;
113 } 106 }
114 107
115 inline InspectorInstrumentationAgents* instrumentingAgentsFor( 108 inline CoreProbesSink* toCoreProbesSink(EventTarget* eventTarget) {
116 EventTarget* eventTarget) { 109 return eventTarget ? toCoreProbesSink(eventTarget->getExecutionContext()) : nu llptr;
117 return eventTarget
118 ? instrumentingAgentsFor(eventTarget->getExecutionContext())
119 : nullptr;
120 } 110 }
121 111
122 CORE_EXPORT void asyncTaskScheduled(ExecutionContext*, 112 CORE_EXPORT void asyncTaskScheduled(ExecutionContext*,
123 const String& name, 113 const String& name,
124 void*); 114 void*);
125 CORE_EXPORT void asyncTaskScheduledBreakable(ExecutionContext*, 115 CORE_EXPORT void asyncTaskScheduledBreakable(ExecutionContext*,
126 const char* name, 116 const char* name,
127 void*); 117 void*);
128 CORE_EXPORT void asyncTaskCanceled(ExecutionContext*, void*); 118 CORE_EXPORT void asyncTaskCanceled(ExecutionContext*, void*);
129 CORE_EXPORT void asyncTaskCanceledBreakable(ExecutionContext*, 119 CORE_EXPORT void asyncTaskCanceledBreakable(ExecutionContext*,
130 const char* name, 120 const char* name,
131 void*); 121 void*);
132 122
133 CORE_EXPORT void allAsyncTasksCanceled(ExecutionContext*); 123 CORE_EXPORT void allAsyncTasksCanceled(ExecutionContext*);
134 CORE_EXPORT void canceledAfterReceivedResourceResponse(LocalFrame*, 124 CORE_EXPORT void canceledAfterReceivedResourceResponse(LocalFrame*,
135 DocumentLoader*, 125 DocumentLoader*,
136 unsigned long identifier, 126 unsigned long identifier,
137 const ResourceResponse&, 127 const ResourceResponse&,
138 Resource*); 128 Resource*);
139 CORE_EXPORT void continueWithPolicyIgnore(LocalFrame*, 129 CORE_EXPORT void continueWithPolicyIgnore(LocalFrame*,
140 DocumentLoader*, 130 DocumentLoader*,
141 unsigned long identifier, 131 unsigned long identifier,
142 const ResourceResponse&, 132 const ResourceResponse&,
143 Resource*); 133 Resource*);
144 134
145 } // namespace probe 135 } // namespace probe
146 } // namespace blink 136 } // namespace blink
147 137
148 #include "core/InspectorInstrumentationInl.h" 138 #include "core/CoreProbesInl.h"
149 #include "core/InspectorOverridesInl.h" 139 #include "core/InspectorOverridesInl.h"
150 140
151 #endif // !defined(InspectorInstrumentation_h) 141 #endif // !defined(CoreProbes_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698