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

Unified Diff: third_party/WebKit/Source/core/fileapi/FileReader.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/fileapi/FileReader.cpp
diff --git a/third_party/WebKit/Source/core/fileapi/FileReader.cpp b/third_party/WebKit/Source/core/fileapi/FileReader.cpp
index 3b4554871dee346d4e92f38164d1dc2f114245c7..1caaa448eb73361d9de2a4dcfd1aa4c978914cd9 100644
--- a/third_party/WebKit/Source/core/fileapi/FileReader.cpp
+++ b/third_party/WebKit/Source/core/fileapi/FileReader.cpp
@@ -97,7 +97,7 @@ public:
if (!controller)
return;
- reader->m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(context, "FileReader");
+ InspectorInstrumentation::asyncTaskScheduled(context, "FileReader", reader, true);
controller->pushReader(reader);
}
@@ -112,13 +112,12 @@ public:
static void finishReader(ExecutionContext* context, FileReader* reader, FinishReaderType nextStep)
{
- InspectorInstrumentation::traceAsyncOperationCompleted(context, reader->m_asyncOperationId);
-
ThrottlingController* controller = from(context);
if (!controller)
return;
controller->finishReader(reader, nextStep);
+ InspectorInstrumentation::asyncTaskCanceled(context, reader);
}
DEFINE_INLINE_TRACE()
@@ -206,7 +205,6 @@ FileReader::FileReader(ExecutionContext* context)
, m_loadingState(LoadingStateNone)
, m_readType(FileReaderLoader::ReadAsBinaryString)
, m_lastProgressNotificationTimeMS(0)
- , m_asyncOperationId(0)
{
}
@@ -451,10 +449,9 @@ void FileReader::didFail(FileError::ErrorCode errorCode)
void FileReader::fireEvent(const AtomicString& type)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this);
if (!m_loader) {
dispatchEvent(ProgressEvent::create(type, false, 0, 0));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
return;
}
@@ -462,8 +459,6 @@ void FileReader::fireEvent(const AtomicString& type)
dispatchEvent(ProgressEvent::create(type, true, m_loader->bytesLoaded(), m_loader->totalBytes()));
else
dispatchEvent(ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0));
-
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
DEFINE_TRACE(FileReader)
« no previous file with comments | « third_party/WebKit/Source/core/fileapi/FileReader.h ('k') | third_party/WebKit/Source/core/frame/DOMTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698