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

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

Issue 2890023003: [IndexedDB] Adding async tracing for renderer calls. (Closed)
Patch Set: test fix 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..a9204c3d6f1bdc60e9fbe8f1e31ea857c5ea7ad3 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");
pwnall 2017/05/25 23:04:25 The Call suffixes don't seem very informative to m
dmurph 2017/05/31 19:26:25 Done.
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
transaction_->InactiveErrorMessage());
@@ -138,7 +137,8 @@ IDBRequest* IDBCursor::update(ScriptState* script_state,
}
void IDBCursor::advance(unsigned count, ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::advance");
+ IDB_TRACE("IDBCursor::advanceCall");
+ IDBRequest::AsyncTraceState metrics("IDBCursor::advance", this);
if (!count) {
exception_state.ThrowTypeError(
"A count argument with value 0 (zero) was supplied, must be greater "
@@ -162,6 +162,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 +170,8 @@ 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");
+ IDBRequest::AsyncTraceState metrics("IDBCursor::continue", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
@@ -198,14 +200,15 @@ void IDBCursor::continueFunction(ScriptState* script_state,
IDBDatabase::kNotValidKeyErrorMessage);
return;
}
- Continue(key, nullptr, exception_state);
+ Continue(key, nullptr, exception_state, std::move(metrics));
}
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");
+ IDBRequest::AsyncTraceState metrics("IDBCursor::continuePrimaryKey", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
@@ -258,12 +261,13 @@ void IDBCursor::continuePrimaryKey(ScriptState* script_state,
return;
}
- Continue(key, primary_key, exception_state);
+ Continue(key, primary_key, exception_state, std::move(metrics));
}
void IDBCursor::Continue(IDBKey* key,
IDBKey* primary_key,
- ExceptionState& exception_state) {
+ ExceptionState& exception_state,
+ IDBRequest::AsyncTraceState metrics) {
DCHECK(transaction_->IsActive());
DCHECK(got_value_);
DCHECK(!IsDeleted());
@@ -300,6 +304,7 @@ void IDBCursor::Continue(IDBKey* key,
// means the callback will be on the original context openCursor was called
// on. Is this right?
request_->SetPendingCursor(this);
+ request_->AssignNewMetrics(std::move(metrics));
got_value_ = false;
backend_->ContinueFunction(key, primary_key,
request_->CreateWebCallbacks().release());
@@ -307,7 +312,8 @@ void IDBCursor::Continue(IDBKey* key,
IDBRequest* IDBCursor::deleteFunction(ScriptState* script_state,
ExceptionState& exception_state) {
- IDB_TRACE("IDBCursor::delete");
+ IDB_TRACE("IDBCursor::deleteCall");
+ IDBRequest::AsyncTraceState metrics("IDBCursor::delete", this);
if (!transaction_->IsActive()) {
exception_state.ThrowDOMException(kTransactionInactiveError,
transaction_->InactiveErrorMessage());
@@ -343,8 +349,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