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

Unified Diff: third_party/WebKit/Source/modules/filesystem/FileWriter.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/modules/filesystem/FileWriter.cpp
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp
index 4e26a86cb19dc80ed67128700781ae84ac81f33d..5e5606787111119e246283b21b7e4429b01093ce 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp
@@ -63,7 +63,6 @@ FileWriter::FileWriter(ExecutionContext* context)
, m_numAborts(0)
, m_recursionDepth(0)
, m_lastProgressNotificationTimeMS(0)
- , m_asyncOperationId(0)
{
}
@@ -250,7 +249,7 @@ void FileWriter::completeAbort()
void FileWriter::doOperation(Operation operation)
{
- m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(getExecutionContext(), "FileWriter", m_asyncOperationId);
+ InspectorInstrumentation::asyncTaskScheduled(getExecutionContext(), "FileWriter", this);
switch (operation) {
case OperationWrite:
ASSERT(m_operationInProgress == OperationNone);
@@ -299,18 +298,16 @@ void FileWriter::signalCompletion(FileError::ErrorCode code)
fireEvent(EventTypeNames::write);
fireEvent(EventTypeNames::writeend);
- InspectorInstrumentation::traceAsyncOperationCompleted(getExecutionContext(), m_asyncOperationId);
- m_asyncOperationId = 0;
+ InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this);
}
void FileWriter::fireEvent(const AtomicString& type)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(getExecutionContext(), this);
++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)

Powered by Google App Engine
This is Rietveld 408576698