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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1857713004: DevTools: simplify the async instrumentation harness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index b9c76dd76e404045ad5b0494f5744decc2458f72..941d8d31677606c89c7650b22b7b7bf90f042c94 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -924,6 +924,7 @@ void XMLHttpRequest::createRequest(PassRefPtr<EncodedFormData> httpBody, Excepti
request.setReportUploadProgress(true);
ASSERT(!m_loader);
+ InspectorInstrumentation::scheduleAsyncTask(&executionContext, "XMLHttpRequest", this);
m_loader = ThreadableLoader::create(executionContext, this, options, resourceLoaderOptions);
m_loader->start(request);
@@ -1070,10 +1071,12 @@ void XMLHttpRequest::dispatchProgressEvent(const AtomicString& type, long long r
unsigned long long loaded = receivedLength >= 0 ? static_cast<unsigned long long>(receivedLength) : 0;
unsigned long long total = lengthComputable ? static_cast<unsigned long long>(expectedLength) : 0;
+ Optional<InspectorInstrumentation::AsyncTask> asyncTask;
+ if (type == EventTypeNames::loadend)
+ InspectorInstrumentation::asyncTaskStarted(getExecutionContext(), this);
m_progressEventThrottle->dispatchProgressEvent(type, lengthComputable, loaded, total);
-
if (type == EventTypeNames::loadend)
- InspectorInstrumentation::didDispatchXHRLoadendEvent(getExecutionContext(), this);
+ InspectorInstrumentation::asyncTaskFinished(getExecutionContext(), this);
}
void XMLHttpRequest::dispatchProgressEventFromSnapshot(const AtomicString& type)

Powered by Google App Engine
This is Rietveld 408576698