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

Side by Side Diff: third_party/WebKit/Source/core/probe/CoreProbes.cpp

Issue 2816403002: test all
Patch Set: fix sharedworker 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) 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void AllAsyncTasksCanceled(ExecutionContext* context) { 113 void AllAsyncTasksCanceled(ExecutionContext* context) {
114 if (ThreadDebugger* debugger = ThreadDebugger::From(ToIsolate(context))) 114 if (ThreadDebugger* debugger = ThreadDebugger::From(ToIsolate(context)))
115 debugger->AllAsyncTasksCanceled(); 115 debugger->AllAsyncTasksCanceled();
116 } 116 }
117 117
118 void DidReceiveResourceResponseButCanceled(LocalFrame* frame, 118 void DidReceiveResourceResponseButCanceled(LocalFrame* frame,
119 DocumentLoader* loader, 119 DocumentLoader* loader,
120 unsigned long identifier, 120 unsigned long identifier,
121 const ResourceResponse& r, 121 const ResourceResponse& r,
122 Resource* resource) { 122 Resource* resource) {
123 didReceiveResourceResponse(frame, identifier, loader, r, resource); 123 didReceiveResourceResponse(frame->GetDocument(), identifier, loader, r,
124 resource);
124 } 125 }
125 126
126 void CanceledAfterReceivedResourceResponse(LocalFrame* frame, 127 void CanceledAfterReceivedResourceResponse(LocalFrame* frame,
127 DocumentLoader* loader, 128 DocumentLoader* loader,
128 unsigned long identifier, 129 unsigned long identifier,
129 const ResourceResponse& r, 130 const ResourceResponse& r,
130 Resource* resource) { 131 Resource* resource) {
131 DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource); 132 DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource);
132 } 133 }
133 134
134 void ContinueWithPolicyIgnore(LocalFrame* frame, 135 void ContinueWithPolicyIgnore(LocalFrame* frame,
135 DocumentLoader* loader, 136 DocumentLoader* loader,
136 unsigned long identifier, 137 unsigned long identifier,
137 const ResourceResponse& r, 138 const ResourceResponse& r,
138 Resource* resource) { 139 Resource* resource) {
139 DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource); 140 DidReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource);
140 } 141 }
141 142
142 CoreProbeSink* ToCoreProbeSink(WorkerGlobalScope* worker_global_scope) { 143 CoreProbeSink* ToCoreProbeSink(WorkerGlobalScope* worker_global_scope) {
143 if (!worker_global_scope) 144 if (!worker_global_scope)
144 return nullptr; 145 return nullptr;
146 WorkerThread* thread = worker_global_scope->GetThread();
147 // |thread| is null after WorkerGlobalScope::dispose() is called.
148 if (!thread)
149 return nullptr;
145 if (WorkerInspectorController* controller = 150 if (WorkerInspectorController* controller =
146 worker_global_scope->GetThread()->GetWorkerInspectorController()) 151 worker_global_scope->GetThread()->GetWorkerInspectorController()) {
147 return controller->InstrumentingAgents(); 152 return controller->InstrumentingAgents();
153 }
148 return nullptr; 154 return nullptr;
149 } 155 }
150 156
151 CoreProbeSink* ToCoreProbeSinkForNonDocumentContext(ExecutionContext* context) { 157 CoreProbeSink* ToCoreProbeSinkForNonDocumentContext(ExecutionContext* context) {
152 if (context->IsWorkerGlobalScope()) 158 if (context->IsWorkerGlobalScope())
153 return ToCoreProbeSink(ToWorkerGlobalScope(context)); 159 return ToCoreProbeSink(ToWorkerGlobalScope(context));
154 if (context->IsMainThreadWorkletGlobalScope()) 160 if (context->IsMainThreadWorkletGlobalScope())
155 return ToCoreProbeSink(ToMainThreadWorkletGlobalScope(context)->GetFrame()); 161 return ToCoreProbeSink(ToMainThreadWorkletGlobalScope(context)->GetFrame());
156 return nullptr; 162 return nullptr;
157 } 163 }
158 164
159 } // namespace probe 165 } // namespace probe
160 } // namespace blink 166 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698