| Index: Source/core/fileapi/FileReader.cpp
|
| diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp
|
| index ae7ba388a963c9dd6a840e35fe056cbb238cc421..36361c26914f2c8b0ec7203419fd548a6c00028d 100644
|
| --- a/Source/core/fileapi/FileReader.cpp
|
| +++ b/Source/core/fileapi/FileReader.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "core/events/ProgressEvent.h"
|
| #include "core/fileapi/File.h"
|
| #include "core/frame/LocalFrame.h"
|
| +#include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/workers/WorkerClients.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "platform/Logging.h"
|
| @@ -118,6 +119,7 @@ public:
|
| if (!controller)
|
| return;
|
|
|
| + reader->m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(context, "FileReader");
|
| controller->pushReader(reader);
|
| }
|
|
|
| @@ -132,6 +134,8 @@ public:
|
|
|
| static void finishReader(ExecutionContext* context, FileReader* reader, FinishReaderType nextStep)
|
| {
|
| + InspectorInstrumentation::traceAsyncOperationCompleted(context, reader->m_asyncOperationId);
|
| +
|
| ThrottlingController* controller = from(context);
|
| if (!controller)
|
| return;
|
| @@ -222,6 +226,7 @@ FileReader::FileReader(ExecutionContext* context)
|
| , m_loadingState(LoadingStateNone)
|
| , m_readType(FileReaderLoader::ReadAsBinaryString)
|
| , m_lastProgressNotificationTimeMS(0)
|
| + , m_asyncOperationId(0)
|
| {
|
| ScriptWrappable::init(this);
|
| }
|
| @@ -460,8 +465,10 @@ void FileReader::didFail(FileError::ErrorCode errorCode)
|
|
|
| void FileReader::fireEvent(const AtomicString& type)
|
| {
|
| + InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(executionContext(), m_asyncOperationId);
|
| if (!m_loader) {
|
| dispatchEvent(ProgressEvent::create(type, false, 0, 0));
|
| + InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
|
| return;
|
| }
|
|
|
| @@ -469,6 +476,8 @@ 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);
|
| }
|
|
|
| PassRefPtr<ArrayBuffer> FileReader::arrayBufferResult() const
|
|
|