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

Unified Diff: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.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/FileSystemCallbacks.cpp
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
index 2101f38df7462f737a236f737b29456cf12ccc87..cfe3984c70b2a855f608921ec4e03956a7810383 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -35,7 +35,6 @@
#include "core/fileapi/File.h"
#include "core/fileapi/FileError.h"
#include "core/html/VoidCallback.h"
-#include "core/inspector/InspectorInstrumentation.h"
#include "modules/filesystem/DOMFilePath.h"
#include "modules/filesystem/DOMFileSystem.h"
#include "modules/filesystem/DOMFileSystemBase.h"
@@ -59,20 +58,15 @@ FileSystemCallbacksBase::FileSystemCallbacksBase(ErrorCallback* errorCallback, D
: m_errorCallback(errorCallback)
, m_fileSystem(fileSystem)
, m_executionContext(context)
- , m_asyncOperationId(0)
{
if (m_fileSystem)
m_fileSystem->addPendingCallbacks();
- if (m_executionContext)
- m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(m_executionContext.get(), "FileSystem");
}
FileSystemCallbacksBase::~FileSystemCallbacksBase()
{
if (m_fileSystem)
m_fileSystem->removePendingCallbacks();
- if (m_asyncOperationId && m_executionContext)
- InspectorInstrumentation::traceAsyncOperationCompleted(m_executionContext.get(), m_asyncOperationId);
}
void FileSystemCallbacksBase::didFail(int code)
@@ -90,26 +84,22 @@ template <typename CB, typename CBArg>
void FileSystemCallbacksBase::handleEventOrScheduleCallback(RawPtr<CB> callback, CBArg* arg)
{
ASSERT(callback);
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_executionContext.get(), m_asyncOperationId);
if (shouldScheduleCallback())
DOMFileSystem::scheduleCallback(m_executionContext.get(), callback.get(), arg);
else if (callback)
callback->handleEvent(arg);
m_executionContext.clear();
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
template <typename CB>
void FileSystemCallbacksBase::handleEventOrScheduleCallback(RawPtr<CB> callback)
{
ASSERT(callback);
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncOperationCompletedCallbackStarting(m_executionContext.get(), m_asyncOperationId);
if (shouldScheduleCallback())
DOMFileSystem::scheduleCallback(m_executionContext.get(), callback.get());
else if (callback)
callback->handleEvent();
m_executionContext.clear();
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
// EntryCallbacks -------------------------------------------------------------
@@ -167,12 +157,8 @@ void EntriesCallbacks::didReadDirectoryEntries(bool hasMore)
EntryHeapVector entries;
entries.swap(m_entries);
// FIXME: delay the callback iff shouldScheduleCallback() is true.
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_executionContext.get(), m_asyncOperationId);
if (m_successCallback)
m_successCallback->handleEvent(entries);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
- if (!hasMore)
- InspectorInstrumentation::traceAsyncOperationCompleted(m_executionContext.get(), m_asyncOperationId);
}
// FileSystemCallbacks --------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698