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

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

Issue 2701753003: [WIP] off-main-thread loading
Patch Set: small fix 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->document(), 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* workerGlobalScope) { 143 CoreProbeSink* toCoreProbeSink(WorkerGlobalScope* workerGlobalScope) {
143 if (!workerGlobalScope) 144 if (!workerGlobalScope)
144 return nullptr; 145 return nullptr;
146 WorkerThread* thread = workerGlobalScope->thread();
147 // |thread| is null after WorkerGlobalScope::dispose() is called.
148 if (!thread)
149 return nullptr;
145 if (WorkerInspectorController* controller = 150 if (WorkerInspectorController* controller =
146 workerGlobalScope->thread()->workerInspectorController()) 151 workerGlobalScope->thread()->workerInspectorController()) {
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)->frame()); 161 return toCoreProbeSink(toMainThreadWorkletGlobalScope(context)->frame());
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