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

Unified Diff: Source/modules/filesystem/FileWriter.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
« Source/core/fileapi/FileReader.h ('K') | « Source/modules/filesystem/FileWriter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/FileWriter.cpp
diff --git a/Source/modules/filesystem/FileWriter.cpp b/Source/modules/filesystem/FileWriter.cpp
index cbe74551227d53da6feec030aeec19ac4e1ad77b..40eedbb9cf495decaaea17dc6dc4982ec6d11004 100644
--- a/Source/modules/filesystem/FileWriter.cpp
+++ b/Source/modules/filesystem/FileWriter.cpp
@@ -35,6 +35,7 @@
#include "core/dom/ExceptionCode.h"
#include "core/events/ProgressEvent.h"
#include "core/fileapi/Blob.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "public/platform/WebFileWriter.h"
#include "public/platform/WebURL.h"
#include "wtf/CurrentTime.h"
@@ -62,6 +63,7 @@ FileWriter::FileWriter(ExecutionContext* context)
, m_numAborts(0)
, m_recursionDepth(0)
, m_lastProgressNotificationTimeMS(0)
+ , m_asyncOperationId(0)
{
ScriptWrappable::init(this);
}
@@ -253,6 +255,7 @@ void FileWriter::completeAbort()
void FileWriter::doOperation(Operation operation)
{
+ m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(executionContext(), "FileWriter", m_asyncOperationId);
switch (operation) {
case OperationWrite:
ASSERT(m_operationInProgress == OperationNone);
@@ -300,14 +303,19 @@ void FileWriter::signalCompletion(FileError::ErrorCode code)
} else
fireEvent(EventTypeNames::write);
fireEvent(EventTypeNames::writeend);
+
+ InspectorInstrumentation::traceAsyncOperationCompleted(executionContext(), m_asyncOperationId);
+ m_asyncOperationId = 0;
}
void FileWriter::fireEvent(const AtomicString& type)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(executionContext(), m_asyncOperationId);
++m_recursionDepth;
dispatchEvent(ProgressEvent::create(type, true, m_bytesWritten, m_bytesToWrite));
--m_recursionDepth;
ASSERT(m_recursionDepth >= 0);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void FileWriter::setError(FileError::ErrorCode errorCode, ExceptionState& exceptionState)
« Source/core/fileapi/FileReader.h ('K') | « Source/modules/filesystem/FileWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698