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

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp

Issue 2890023003: [IndexedDB] Adding async tracing for renderer calls. (Closed)
Patch Set: fixed tests Created 3 years, 7 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/IDBCursor.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
index 17fe589df16baa595f0da11e8cead4ec82590a71..49d8da4bb6e9004d7318e01328fcd73b66c54868 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
@@ -102,8 +102,7 @@ v8::Local<v8::Object> IDBCursor::AssociateWithWrapper(
IDBRequest* IDBCursor::update(ScriptState* script_state,
const ScriptValue& value,
ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::update");
-
+ IDB_TRACE("IDBCursor::updateCall");
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
transaction_->InactiveErrorMessage());
@@ -138,7 +137,9 @@ IDBRequest* IDBCursor::update(ScriptState* script_state,
}
void IDBCursor::advance(unsigned count, ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::advance");
+ IDB_TRACE("IDBCursor::advanceCall");
+ auto metrics = WTF::MakeUnique<IDBRequest::ScopedMetricsTracker>(
+ nullptr, "IDBCursor::advance", this);
if (!count) {
exception_state.ThrowTypeError(
"A count argument with value 0 (zero) was supplied, must be greater "
@@ -162,6 +163,7 @@ void IDBCursor::advance(unsigned count, ExceptionState& exception_state) {
}
request_->SetPendingCursor(this);
+ request_->AssignNewMetrics(std::move(metrics));
got_value_ = false;
backend_->Advance(count, request_->CreateWebCallbacks().release());
}
@@ -169,7 +171,9 @@ void IDBCursor::advance(unsigned count, ExceptionState& exception_state) {
void IDBCursor::continueFunction(ScriptState* script_state,
const ScriptValue& key_value,
ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::continue");
+ IDB_TRACE("IDBCursor::continueCall");
+ auto metrics = WTF::MakeUnique<IDBRequest::ScopedMetricsTracker>(
+ nullptr, "IDBCursor::continue", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
@@ -198,6 +202,7 @@ void IDBCursor::continueFunction(ScriptState* script_state,
IDBDatabase::kNotValidKeyErrorMessage);
return;
}
+ request_->AssignNewMetrics(std::move(metrics));
Continue(key, nullptr, exception_state);
}
@@ -205,7 +210,9 @@ void IDBCursor::continuePrimaryKey(ScriptState* script_state,
const ScriptValue& key_value,
const ScriptValue& primary_key_value,
ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::continuePrimaryKey");
+ IDB_TRACE("IDBCursor::continuePrimaryKeyCall");
+ auto metrics = WTF::MakeUnique<IDBRequest::ScopedMetricsTracker>(
+ nullptr, "IDBCursor::continuePrimaryKey", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
@@ -258,6 +265,7 @@ void IDBCursor::continuePrimaryKey(ScriptState* script_state,
return;
}
+ request_->AssignNewMetrics(std::move(metrics));
Continue(key, primary_key, exception_state);
}
@@ -307,7 +315,9 @@ void IDBCursor::Continue(IDBKey* key,
IDBRequest* IDBCursor::deleteFunction(ScriptState* script_state,
ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::delete");
+ IDB_TRACE("IDBCursor::deleteCall");
+ auto metrics = WTF::MakeUnique<IDBRequest::ScopedMetricsTracker>(
+ nullptr, "IDBCursor::delete", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
transaction_->InactiveErrorMessage());
@@ -343,8 +353,9 @@ IDBRequest* IDBCursor::deleteFunction(ScriptState* script_state,
IDBKeyRange* key_range = IDBKeyRange::only(primary_key_, exception_state);
DCHECK(!exception_state.HadException());
- IDBRequest* request = IDBRequest::Create(script_state, IDBAny::Create(this),
- transaction_.Get());
+ IDBRequest* request =
+ IDBRequest::Create(script_state, IDBAny::Create(this), transaction_.Get(),
+ std::move(metrics));
transaction_->BackendDB()->DeleteRange(
transaction_->Id(), EffectiveObjectStore()->Id(), key_range,
request->CreateWebCallbacks().release());

Powered by Google App Engine
This is Rietveld 408576698