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

Unified Diff: Source/modules/indexeddb/WebIDBCallbacksImpl.cpp

Issue 439713009: DevTools: Implement async stacks for IndexedDB. (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
« no previous file with comments | « Source/modules/indexeddb/WebIDBCallbacksImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
diff --git a/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
index 478e9b8844862efff8c373d1044b357ff60afa0d..18eb8973fd40e8f7c87021ea7c610665b3845e9e 100644
--- a/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
+++ b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
@@ -30,6 +30,7 @@
#include "modules/indexeddb/WebIDBCallbacksImpl.h"
#include "core/dom/DOMError.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "modules/indexeddb/IDBMetadata.h"
#include "modules/indexeddb/IDBRequest.h"
#include "platform/SharedBuffer.h"
@@ -62,10 +63,12 @@ PassOwnPtr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create(IDBRequest* request)
WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request)
: m_request(request)
{
+ m_asyncOperationId = InspectorInstrumentation::traceAsyncOperationStarting(m_request->executionContext(), "IndexedDB");
cmumford 2014/08/07 15:11:24 Elsewhere (like in FileSystemCallbacks.cpp) a chec
aandrey 2014/08/07 15:35:40 Not necessary, the NULL check is done at https://c
}
WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
{
+ InspectorInstrumentation::traceAsyncOperationCompleted(m_request->executionContext(), m_asyncOperationId);
cmumford 2014/08/07 15:11:24 Same NULL ptr check question as constructor.
}
static PassOwnPtr<Vector<WebBlobInfo> > ConvertBlobInfo(const WebVector<WebBlobInfo>& webBlobInfo)
@@ -78,7 +81,9 @@ static PassOwnPtr<Vector<WebBlobInfo> > ConvertBlobInfo(const WebVector<WebBlobI
void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onError(error);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebVector<blink::WebString>& webStringList)
@@ -86,57 +91,79 @@ void WebIDBCallbacksImpl::onSuccess(const WebVector<blink::WebString>& webString
Vector<String> stringList;
for (size_t i = 0; i < webStringList.size(); ++i)
stringList.append(webStringList[i]);
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(stringList);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(adoptPtr(cursor), key, primaryKey, value, ConvertBlobInfo(webBlobInfo));
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, const WebIDBMetadata& metadata)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(adoptPtr(backend), metadata);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(key);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(value, ConvertBlobInfo(webBlobInfo));
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(value, ConvertBlobInfo(webBlobInfo), key, keyPath);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(long long value)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(value);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess()
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess();
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value, const WebVector<WebBlobInfo>& webBlobInfo)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onSuccess(key, primaryKey, value, ConvertBlobInfo(webBlobInfo));
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onBlocked(long long oldVersion)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onBlocked(oldVersion);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, blink::WebString dataLossMessage)
{
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), metadata, static_cast<blink::WebIDBDataLoss>(dataLoss), dataLossMessage);
+ InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
} // namespace blink
« no previous file with comments | « Source/modules/indexeddb/WebIDBCallbacksImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698