2011-04-14 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 15:49:05 +0000 (15:49 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 15:49:05 +0000 (15:49 +0000)
        Unreviewed. Rollout r83849 and r83857.

        * inspector/Inspector.json:
        * inspector/InspectorDatabaseAgent.cpp:
        (WebCore::InspectorDatabaseAgent::didOpenDatabase):
        (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
        (WebCore::InspectorDatabaseAgent::setFrontend):
        (WebCore::InspectorDatabaseAgent::clearFrontend):
        (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
        (WebCore::InspectorDatabaseAgent::executeSQL):
        * inspector/InspectorDatabaseAgent.h:
        * inspector/front-end/inspector.js:

2011-04-14  Ilya Tikhonovsky  <loislo@chromium.org>

        Unreviewed. Rollout r83849 and r83857.

        * http/tests/inspector-enabled/database-open.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83861 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector-enabled/database-open.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/InspectorDatabaseAgent.cpp
Source/WebCore/inspector/InspectorDatabaseAgent.h
Source/WebCore/inspector/front-end/inspector.js

index c49161c8942a3af48f31e5ccee4a3fb72c30620a..1fe3d32661c1beb39d7f2935ede7ee4caa23f6f2 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-14  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed. Rollout r83849 and r83857.
+
+        * http/tests/inspector-enabled/database-open.html:
+
 2011-04-14  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Unreviewed, rolling out r83855.
index 83ce386fc48f5cbba9bd293aff0fee60e33ea390..60668af22e3a9129afe357c9cbc0a0a272e4d9fc 100644 (file)
@@ -18,17 +18,13 @@ function onload()
 
 function test()
 {
-    function run()
-    {
-        var databases = WebInspector.panels.resources._databases;
-        for (var i = 0; i < databases.length; ++i) {
-            InspectorTest.addResult("Name: " + databases[i].name);
-            InspectorTest.addResult("Version: " + databases[i].version);
-            InspectorTest.addResult("Domain: " + databases[i].domain);
-        }
-        InspectorTest.completeTest();
+    var databases = WebInspector.panels.resources._databases;
+    for (var i = 0; i < databases.length; ++i) {
+        InspectorTest.addResult("Name: " + databases[i].name);
+        InspectorTest.addResult("Version: " + databases[i].version);
+        InspectorTest.addResult("Domain: " + databases[i].domain);
     }
-    InspectorBackend.runAfterPendingDispatches(run);
+    InspectorTest.completeTest();
 }
 
 </script>
index 5d21589eecdc1b3483d92cb4b4526140bafb9c88..6f9a422a2b0f6ed8676e365f4c7952f1900ea1bf 100644 (file)
@@ -1,3 +1,18 @@
+2011-04-14  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Unreviewed. Rollout r83849 and r83857.
+
+        * inspector/Inspector.json:
+        * inspector/InspectorDatabaseAgent.cpp:
+        (WebCore::InspectorDatabaseAgent::didOpenDatabase):
+        (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
+        (WebCore::InspectorDatabaseAgent::setFrontend):
+        (WebCore::InspectorDatabaseAgent::clearFrontend):
+        (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
+        (WebCore::InspectorDatabaseAgent::executeSQL):
+        * inspector/InspectorDatabaseAgent.h:
+        * inspector/front-end/inspector.js:
+
 2011-04-14  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Unreviewed, rolling out r83847.
index 1fcd45ff71572716c3693ff9bb3e3ff173ac9c51..43a0393c07cfe4fc4332cd35cde6141fa93a0409 100644 (file)
         "domain": "Database",
         "types": [],
         "commands": [
-            {
-                "name": "enable",
-                "description": "Enables database tracking, database events will now be delivered to the client."
-            },
-            {
-                "name": "disable",
-                "description": "Disables database tracking, prevents database events from being sent to the client."
-            },
             {
                 "name": "getDatabaseTableNames",
                 "parameters": [
index 0ca2766ba3224ecc95a4897f0fde20465ef62547..c57e40c106d708c26592ac78bd31354898902950 100644 (file)
@@ -228,7 +228,7 @@ void InspectorDatabaseAgent::didOpenDatabase(PassRefPtr<Database> database, cons
     RefPtr<InspectorDatabaseResource> resource = InspectorDatabaseResource::create(database, domain, name, version);
     m_resources.set(resource->id(), resource);
     // Resources are only bound while visible.
-    if (m_frontendProvider && m_enabled)
+    if (m_frontendProvider)
         resource->bind(m_frontendProvider->frontend());
 }
 
@@ -239,7 +239,6 @@ void InspectorDatabaseAgent::clearResources()
 
 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentingAgents)
     : m_instrumentingAgents(instrumentingAgents)
-    , m_enabled(false)
 {
     m_instrumentingAgents->setInspectorDatabaseAgent(this);
 }
@@ -252,39 +251,19 @@ InspectorDatabaseAgent::~InspectorDatabaseAgent()
 void InspectorDatabaseAgent::setFrontend(InspectorFrontend* frontend)
 {
     m_frontendProvider = FrontendProvider::create(frontend);
-}
-
-void InspectorDatabaseAgent::clearFrontend()
-{
-    m_frontendProvider->clearFrontend();
-    m_frontendProvider.clear();
-}
-
-void InspectorDatabaseAgent::enable(ErrorString*)
-{
-    if (m_enabled)
-        return;
-    m_enabled = true;
-
     DatabaseResourcesMap::iterator databasesEnd = m_resources.end();
     for (DatabaseResourcesMap::iterator it = m_resources.begin(); it != databasesEnd; ++it)
         it->second->bind(m_frontendProvider->frontend());
 }
 
-void InspectorDatabaseAgent::disable(ErrorString*)
+void InspectorDatabaseAgent::clearFrontend()
 {
-    if (!m_enabled)
-        return;
-    m_enabled = false;
+    m_frontendProvider->clearFrontend();
+    m_frontendProvider.clear();
 }
 
-void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, int databaseId, RefPtr<InspectorArray>* names)
+void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString*, int databaseId, RefPtr<InspectorArray>* names)
 {
-    if (!m_enabled) {
-        *error = "Database agent is not enabled";
-        return;
-    }
-
     Database* database = databaseForId(databaseId);
     if (database) {
         Vector<String> tableNames = database->tableNames();
@@ -294,13 +273,8 @@ void InspectorDatabaseAgent::getDatabaseTableNames(ErrorString* error, int datab
     }
 }
 
-void InspectorDatabaseAgent::executeSQL(ErrorString* error, int databaseId, const String& query, bool* success, int* transactionId)
+void InspectorDatabaseAgent::executeSQL(ErrorString*, int databaseId, const String& query, bool* success, int* transactionId)
 {
-    if (!m_enabled) {
-        *error = "Database agent is not enabled";
-        return;
-    }
-
     Database* database = databaseForId(databaseId);
     if (!database) {
         *success = false;
index 6fce09b038df921228ab86a6a460378672f62c80..f854a6e1bf486755ee4f8062f797be9ba7ec72df 100644 (file)
@@ -59,8 +59,6 @@ public:
     void clearResources();
 
     // Called from the front-end.
-    void enable(ErrorString*);
-    void disable(ErrorString*);
     void getDatabaseTableNames(ErrorString*, int databaseId, RefPtr<InspectorArray>* names);
     void executeSQL(ErrorString*, int databaseId, const String& query, bool* success, int* transactionId);
 
@@ -78,7 +76,6 @@ private:
     typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
     DatabaseResourcesMap m_resources;
     RefPtr<FrontendProvider> m_frontendProvider;
-    bool m_enabled;
 };
 
 } // namespace WebCore
index 510f9317e068a6dcb32f33c86e8de1bde70a1e6a..3c30a20ffff6772dc056e6890853080e7355d0ad 100644 (file)
@@ -508,8 +508,6 @@ WebInspector.doLoadedDone = function()
         ConsoleAgent.setMonitoringXHREnabled(true);
     ConsoleAgent.enable(this.console.setConsoleMessageExpiredCount.bind(this.console));
 
-    DatabaseAgent.enable();
-
     WebInspector.showPanel(WebInspector.settings.lastActivePanel);
 
     function propertyNamesCallback(error, names)