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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.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/XMLHttpRequestUpload.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp
index 07cd81789715933efa73ec2a98f90d500280bd1d..42456f2abc09259bbd8a06a79a53d70d51f5bfeb 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestUpload.cpp
@@ -27,6 +27,7 @@
#include "core/EventTypeNames.h"
#include "core/events/ProgressEvent.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "wtf/Assertions.h"
#include "wtf/text/AtomicString.h"
@@ -53,12 +54,14 @@ void XMLHttpRequestUpload::dispatchProgressEvent(unsigned long long bytesSent, u
{
m_lastBytesSent = bytesSent;
m_lastTotalBytesToBeSent = totalBytesToBeSent;
+ InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), m_xmlHttpRequest, m_xmlHttpRequest->isAsync());
dispatchEvent(ProgressEvent::create(EventTypeNames::progress, true, bytesSent, totalBytesToBeSent));
}
void XMLHttpRequestUpload::dispatchEventAndLoadEnd(const AtomicString& type, bool lengthComputable, unsigned long long bytesSent, unsigned long long total)
{
ASSERT(type == EventTypeNames::load || type == EventTypeNames::abort || type == EventTypeNames::error || type == EventTypeNames::timeout);
+ InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), m_xmlHttpRequest, m_xmlHttpRequest->isAsync());
dispatchEvent(ProgressEvent::create(type, lengthComputable, bytesSent, total));
dispatchEvent(ProgressEvent::create(EventTypeNames::loadend, lengthComputable, bytesSent, total));
}
@@ -66,6 +69,7 @@ void XMLHttpRequestUpload::dispatchEventAndLoadEnd(const AtomicString& type, boo
void XMLHttpRequestUpload::handleRequestError(const AtomicString& type)
{
bool lengthComputable = m_lastTotalBytesToBeSent > 0 && m_lastBytesSent <= m_lastTotalBytesToBeSent;
+ InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), m_xmlHttpRequest, m_xmlHttpRequest->isAsync());
dispatchEvent(ProgressEvent::create(EventTypeNames::progress, lengthComputable, m_lastBytesSent, m_lastTotalBytesToBeSent));
dispatchEventAndLoadEnd(type, lengthComputable, m_lastBytesSent, m_lastTotalBytesToBeSent);
}

Powered by Google App Engine
This is Rietveld 408576698