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

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

Issue 2203543002: [DevTools] Dont pass errorString to async protocol methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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
Index: third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index 3e32d9b3c5a89d21e05aca33fb08217181e72977..7b66553a3aef7a49992ca364e74909f76ba209fb 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -630,15 +630,20 @@ static IDBFactory* assertIDBFactory(ErrorString* errorString, Document* document
return idbFactory;
}
-void InspectorIndexedDBAgent::requestDatabaseNames(ErrorString* errorString, const String& securityOrigin, std::unique_ptr<RequestDatabaseNamesCallback> requestCallback)
+void InspectorIndexedDBAgent::requestDatabaseNames(const String& securityOrigin, std::unique_ptr<RequestDatabaseNamesCallback> requestCallback)
{
LocalFrame* frame = m_inspectedFrames->frameWithSecurityOrigin(securityOrigin);
- Document* document = assertDocument(errorString, frame);
- if (!document)
+ ErrorString errorString;
+ Document* document = assertDocument(&errorString, frame);
+ if (!document) {
+ requestCallback->sendFailure(errorString);
return;
- IDBFactory* idbFactory = assertIDBFactory(errorString, document);
- if (!idbFactory)
+ }
+ IDBFactory* idbFactory = assertIDBFactory(&errorString, document);
+ if (!idbFactory) {
+ requestCallback->sendFailure(errorString);
return;
+ }
ScriptState* scriptState = ScriptState::forMainWorld(frame);
if (!scriptState)
@@ -653,15 +658,20 @@ void InspectorIndexedDBAgent::requestDatabaseNames(ErrorString* errorString, con
idbRequest->addEventListener(EventTypeNames::success, GetDatabaseNamesCallback::create(std::move(requestCallback), document->getSecurityOrigin()->toRawString()), false);
}
-void InspectorIndexedDBAgent::requestDatabase(ErrorString* errorString, const String& securityOrigin, const String& databaseName, std::unique_ptr<RequestDatabaseCallback> requestCallback)
+void InspectorIndexedDBAgent::requestDatabase(const String& securityOrigin, const String& databaseName, std::unique_ptr<RequestDatabaseCallback> requestCallback)
{
LocalFrame* frame = m_inspectedFrames->frameWithSecurityOrigin(securityOrigin);
- Document* document = assertDocument(errorString, frame);
- if (!document)
+ ErrorString errorString;
+ Document* document = assertDocument(&errorString, frame);
+ if (!document) {
+ requestCallback->sendFailure(errorString);
return;
- IDBFactory* idbFactory = assertIDBFactory(errorString, document);
- if (!idbFactory)
+ }
+ IDBFactory* idbFactory = assertIDBFactory(&errorString, document);
+ if (!idbFactory) {
+ requestCallback->sendFailure(errorString);
return;
+ }
ScriptState* scriptState = ScriptState::forMainWorld(frame);
if (!scriptState)
@@ -671,7 +681,7 @@ void InspectorIndexedDBAgent::requestDatabase(ErrorString* errorString, const St
databaseLoader->start(idbFactory, document->getSecurityOrigin(), databaseName);
}
-void InspectorIndexedDBAgent::requestData(ErrorString* errorString,
+void InspectorIndexedDBAgent::requestData(
const String& securityOrigin,
const String& databaseName,
const String& objectStoreName,
@@ -682,16 +692,21 @@ void InspectorIndexedDBAgent::requestData(ErrorString* errorString,
std::unique_ptr<RequestDataCallback> requestCallback)
{
LocalFrame* frame = m_inspectedFrames->frameWithSecurityOrigin(securityOrigin);
- Document* document = assertDocument(errorString, frame);
- if (!document)
+ ErrorString errorString;
+ Document* document = assertDocument(&errorString, frame);
+ if (!document) {
+ requestCallback->sendFailure(errorString);
return;
- IDBFactory* idbFactory = assertIDBFactory(errorString, document);
- if (!idbFactory)
+ }
+ IDBFactory* idbFactory = assertIDBFactory(&errorString, document);
+ if (!idbFactory) {
+ requestCallback->sendFailure(errorString);
return;
+ }
IDBKeyRange* idbKeyRange = keyRange.isJust() ? idbKeyRangeFromKeyRange(keyRange.fromJust()) : nullptr;
if (keyRange.isJust() && !idbKeyRange) {
- *errorString = "Can not parse key range.";
+ requestCallback->sendFailure("Can not parse key range.");
return;
}
@@ -788,15 +803,20 @@ private:
std::unique_ptr<ClearObjectStoreCallback> m_requestCallback;
};
-void InspectorIndexedDBAgent::clearObjectStore(ErrorString* errorString, const String& securityOrigin, const String& databaseName, const String& objectStoreName, std::unique_ptr<ClearObjectStoreCallback> requestCallback)
+void InspectorIndexedDBAgent::clearObjectStore(const String& securityOrigin, const String& databaseName, const String& objectStoreName, std::unique_ptr<ClearObjectStoreCallback> requestCallback)
{
LocalFrame* frame = m_inspectedFrames->frameWithSecurityOrigin(securityOrigin);
- Document* document = assertDocument(errorString, frame);
- if (!document)
+ ErrorString errorString;
+ Document* document = assertDocument(&errorString, frame);
+ if (!document) {
+ requestCallback->sendFailure(errorString);
return;
- IDBFactory* idbFactory = assertIDBFactory(errorString, document);
- if (!idbFactory)
+ }
+ IDBFactory* idbFactory = assertIDBFactory(&errorString, document);
+ if (!idbFactory) {
+ requestCallback->sendFailure(errorString);
return;
+ }
ScriptState* scriptState = ScriptState::forMainWorld(frame);
if (!scriptState)

Powered by Google App Engine
This is Rietveld 408576698