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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.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/indexeddb/WebIDBCallbacksImpl.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp b/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
index a7aeccf3ae64dfdd1f5d00a89e78a2936a4cb523..b97c3024a3b822838dc5c75e989be9d7b9d37c97 100644
--- a/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
@@ -60,19 +60,18 @@ PassOwnPtr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create(IDBRequest* request)
WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request)
: m_request(request)
{
- m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(m_request->getExecutionContext(), "IndexedDB");
+ InspectorInstrumentation::asyncTaskScheduled(m_request->getExecutionContext(), "IndexedDB", this, true);
}
WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
{
- InspectorInstrumentation::traceAsyncOperationCompleted(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::asyncTaskCanceled(m_request->getExecutionContext(), this);
}
void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onError(DOMException::create(error.code(), error.message()));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList)
@@ -80,82 +79,71 @@ void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList)
Vector<String> stringList;
for (size_t i = 0; i < webStringList.size(); ++i)
stringList.append(webStringList[i]);
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(stringList);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebIDBValue& value)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(adoptPtr(cursor), key, primaryKey, IDBValue::create(value));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, const WebIDBMetadata& metadata)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(adoptPtr(backend), IDBDatabaseMetadata(metadata));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(key);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebIDBValue& value)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(IDBValue::create(value));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebVector<WebIDBValue>& values)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
Vector<RefPtr<IDBValue>> idbValues(values.size());
for (size_t i = 0; i < values.size(); ++i)
idbValues[i] = IDBValue::create(values[i]);
m_request->onSuccess(idbValues);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(long long value)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(value);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess()
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess();
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebIDBValue& value)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onSuccess(key, primaryKey, IDBValue::create(value));
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onBlocked(long long oldVersion)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onBlocked(oldVersion);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, WebString dataLossMessage)
{
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->getExecutionContext(), m_asyncOperationId);
+ InspectorInstrumentation::AsyncTask asyncTask(m_request->getExecutionContext(), this);
m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), IDBDatabaseMetadata(metadata), static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage);
- InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698