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

Unified Diff: Source/core/fileapi/FileReader.cpp

Issue 440913002: DevTools: Async call stacks for FileSystem API part 2. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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: 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

Powered by Google App Engine
This is Rietveld 408576698