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

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

Issue 2890023003: [IndexedDB] Adding async tracing for renderer calls. (Closed)
Patch Set: fixed blink 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/IDBIndex.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
index 17d620a93190245874a785fa93c662a853953e0d..39b2f9ab2bd9e0c8095725127ead112112fb3226 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
@@ -115,7 +115,8 @@ IDBRequest* IDBIndex::openCursor(ScriptState* script_state,
const ScriptValue& range,
const String& direction_string,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::openCursor");
+ IDB_TRACE("IDBIndex::openCursorRequestSetup");
+ IDBRequest::AsyncTraceState metrics("IDBIndex::openCursor", this);
if (IsDeleted()) {
exception_state.ThrowDOMException(kInvalidStateError,
IDBDatabase::kIndexDeletedErrorMessage);
@@ -139,14 +140,16 @@ IDBRequest* IDBIndex::openCursor(ScriptState* script_state,
return nullptr;
}
- return openCursor(script_state, key_range, direction);
+ return openCursor(script_state, key_range, direction, std::move(metrics));
}
IDBRequest* IDBIndex::openCursor(ScriptState* script_state,
IDBKeyRange* key_range,
- WebIDBCursorDirection direction) {
- IDBRequest* request = IDBRequest::Create(script_state, IDBAny::Create(this),
- transaction_.Get());
+ WebIDBCursorDirection direction,
+ IDBRequest::AsyncTraceState metrics) {
+ IDBRequest* request =
+ IDBRequest::Create(script_state, IDBAny::Create(this), transaction_.Get(),
+ std::move(metrics));
request->SetCursorDetails(IndexedDB::kCursorKeyAndValue, direction);
BackendDB()->OpenCursor(transaction_->Id(), object_store_->Id(), Id(),
key_range, direction, false, kWebIDBTaskTypeNormal,
@@ -157,7 +160,8 @@ IDBRequest* IDBIndex::openCursor(ScriptState* script_state,
IDBRequest* IDBIndex::count(ScriptState* script_state,
const ScriptValue& range,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::count");
+ IDB_TRACE("IDBIndex::countRequestSetup");
+ IDBRequest::AsyncTraceState metrics("IDBIndex::count", this);
if (IsDeleted()) {
exception_state.ThrowDOMException(kInvalidStateError,
IDBDatabase::kIndexDeletedErrorMessage);
@@ -180,8 +184,9 @@ IDBRequest* IDBIndex::count(ScriptState* script_state,
return nullptr;
}
- 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));
BackendDB()->Count(transaction_->Id(), object_store_->Id(), Id(), key_range,
request->CreateWebCallbacks().release());
return request;
@@ -191,7 +196,8 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* script_state,
const ScriptValue& range,
const String& direction_string,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::openKeyCursor");
+ IDB_TRACE("IDBIndex::openKeyCursorRequestSetup");
+ IDBRequest::AsyncTraceState metrics("IDBIndex::openKeyCursor", this);
if (IsDeleted()) {
exception_state.ThrowDOMException(kInvalidStateError,
IDBDatabase::kIndexDeletedErrorMessage);
@@ -214,8 +220,9 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* script_state,
return nullptr;
}
- 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));
request->SetCursorDetails(IndexedDB::kCursorKeyOnly, direction);
BackendDB()->OpenCursor(transaction_->Id(), object_store_->Id(), Id(),
key_range, direction, true, kWebIDBTaskTypeNormal,
@@ -226,7 +233,7 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* script_state,
IDBRequest* IDBIndex::get(ScriptState* script_state,
const ScriptValue& key,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::get");
+ IDB_TRACE("IDBIndex::getRequestSetup");
return GetInternal(script_state, key, exception_state, false);
}
@@ -241,7 +248,7 @@ IDBRequest* IDBIndex::getAll(ScriptState* script_state,
const ScriptValue& range,
unsigned long max_count,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::getAll");
+ IDB_TRACE("IDBIndex::getAllRequestSetup");
return GetAllInternal(script_state, range, max_count, exception_state, false);
}
@@ -256,7 +263,7 @@ IDBRequest* IDBIndex::getAllKeys(ScriptState* script_state,
const ScriptValue& range,
uint32_t max_count,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::getAllKeys");
+ IDB_TRACE("IDBIndex::getAllKeysRequestSetup");
return GetAllInternal(script_state, range, max_count, exception_state,
/*key_only=*/true);
}
@@ -264,7 +271,7 @@ IDBRequest* IDBIndex::getAllKeys(ScriptState* script_state,
IDBRequest* IDBIndex::getKey(ScriptState* script_state,
const ScriptValue& key,
ExceptionState& exception_state) {
- IDB_TRACE("IDBIndex::getKey");
+ IDB_TRACE("IDBIndex::getKeyRequestSetup");
return GetInternal(script_state, key, exception_state, true);
}
@@ -272,6 +279,8 @@ IDBRequest* IDBIndex::GetInternal(ScriptState* script_state,
const ScriptValue& key,
ExceptionState& exception_state,
bool key_only) {
+ IDBRequest::AsyncTraceState metrics(
+ key_only ? "IDBIndex::getKey" : "IDBIndex::get", this);
if (IsDeleted()) {
exception_state.ThrowDOMException(kInvalidStateError,
IDBDatabase::kIndexDeletedErrorMessage);
@@ -298,8 +307,9 @@ IDBRequest* IDBIndex::GetInternal(ScriptState* script_state,
return nullptr;
}
- 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));
BackendDB()->Get(transaction_->Id(), object_store_->Id(), Id(), key_range,
key_only, request->CreateWebCallbacks().release());
return request;
@@ -310,6 +320,8 @@ IDBRequest* IDBIndex::GetAllInternal(ScriptState* script_state,
unsigned long max_count,
ExceptionState& exception_state,
bool key_only) {
+ IDBRequest::AsyncTraceState metrics(
+ key_only ? "IDBIndex::getAllKeys" : "IDBIndex::getAll", this);
if (!max_count)
max_count = std::numeric_limits<uint32_t>::max();
@@ -334,8 +346,9 @@ IDBRequest* IDBIndex::GetAllInternal(ScriptState* script_state,
return nullptr;
}
- 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));
BackendDB()->GetAll(transaction_->Id(), object_store_->Id(), Id(), key_range,
max_count, key_only,
request->CreateWebCallbacks().release());
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBIndex.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698