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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp

Issue 2468273002: [DevTools] migrate Database, IndexedDB and CacheStorage to new style (Closed)
Patch Set: addressed comments & rebased Created 4 years, 1 month 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/webdatabase/InspectorDatabaseAgent.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
index 77ea214f91d4f7ec3dbae20636d9a50148fcc6e0..25562a811369bc8df29664d89b68cc64d5082c1d 100644
--- a/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/InspectorDatabaseAgent.cpp
@@ -265,9 +265,9 @@ InspectorDatabaseAgent::InspectorDatabaseAgent(Page* page)
InspectorDatabaseAgent::~InspectorDatabaseAgent() {}
-void InspectorDatabaseAgent::enable(ErrorString*) {
+Response InspectorDatabaseAgent::enable() {
if (m_enabled)
- return;
+ return Response::OK();
m_enabled = true;
m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled);
if (DatabaseClient* client = DatabaseClient::fromPage(m_page))
@@ -275,34 +275,32 @@ void InspectorDatabaseAgent::enable(ErrorString*) {
DatabaseTracker::tracker().forEachOpenDatabaseInPage(
m_page, WTF::bind(&InspectorDatabaseAgent::registerDatabaseOnCreation,
wrapPersistent(this)));
+ return Response::OK();
}
-void InspectorDatabaseAgent::disable(ErrorString*) {
+Response InspectorDatabaseAgent::disable() {
if (!m_enabled)
- return;
+ return Response::OK();
m_enabled = false;
m_state->setBoolean(DatabaseAgentState::databaseAgentEnabled, m_enabled);
if (DatabaseClient* client = DatabaseClient::fromPage(m_page))
client->setInspectorAgent(nullptr);
m_resources.clear();
+ return Response::OK();
}
void InspectorDatabaseAgent::restore() {
if (m_state->booleanProperty(DatabaseAgentState::databaseAgentEnabled,
false)) {
- ErrorString error;
- enable(&error);
+ enable();
}
}
-void InspectorDatabaseAgent::getDatabaseTableNames(
- ErrorString* error,
+Response InspectorDatabaseAgent::getDatabaseTableNames(
const String& databaseId,
std::unique_ptr<protocol::Array<String>>* names) {
- if (!m_enabled) {
- *error = "Database agent is not enabled";
- return;
- }
+ if (!m_enabled)
+ return Response::Error("Database agent is not enabled");
*names = protocol::Array<String>::create();
@@ -313,6 +311,7 @@ void InspectorDatabaseAgent::getDatabaseTableNames(
for (unsigned i = 0; i < length; ++i)
(*names)->addItem(tableNames[i]);
}
+ return Response::OK();
}
void InspectorDatabaseAgent::executeSQL(
@@ -323,13 +322,14 @@ void InspectorDatabaseAgent::executeSQL(
std::move(prpRequestCallback);
if (!m_enabled) {
- requestCallback->sendFailure("Database agent is not enabled");
+ requestCallback->sendFailure(
+ Response::Error("Database agent is not enabled"));
return;
}
blink::Database* database = databaseForId(databaseId);
if (!database) {
- requestCallback->sendFailure("Database not found");
+ requestCallback->sendFailure(Response::Error("Database not found"));
return;
}

Powered by Google App Engine
This is Rietveld 408576698