| Index: webkit/port/page/inspector/InspectorController.cpp
|
| ===================================================================
|
| --- webkit/port/page/inspector/InspectorController.cpp (revision 1746)
|
| +++ webkit/port/page/inspector/InspectorController.cpp (working copy)
|
| @@ -89,10 +89,15 @@
|
| #endif
|
| #include <wtf/RefCounted.h>
|
|
|
| +// TODO(aa): Implement database inspection and remove this macro.
|
| +#define ENABLE_DATABASE_INSPECTION 0
|
| +
|
| #if ENABLE(DATABASE)
|
| #include "Database.h"
|
| +#if ENABLE_DATABASE_INSPECTION
|
| #include "JSDatabase.h"
|
| #endif
|
| +#endif
|
|
|
| #if USE(JAVASCRIPTCORE_BINDINGS)
|
| using namespace KJS;
|
| @@ -477,6 +482,7 @@
|
|
|
| #if ENABLE(DATABASE)
|
| struct InspectorDatabaseResource : public RefCounted<InspectorDatabaseResource> {
|
| +#if ENABLE_DATABASE_INSPECTION
|
| static PassRefPtr<InspectorDatabaseResource> create(Database* database, const String& domain, const String& name, const String& version)
|
| {
|
| // Apple changed the default refcount to 1: http://trac.webkit.org/changeset/30406
|
| @@ -518,6 +524,7 @@
|
| , scriptObject(0)
|
| {
|
| }
|
| +#endif
|
| };
|
| #endif
|
|
|
| @@ -908,6 +915,7 @@
|
| #endif
|
|
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| static JSValueRef databaseTableNames(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
|
| {
|
| InspectorController* controller = reinterpret_cast<InspectorController*>(JSObjectGetPrivate(thisObject));
|
| @@ -962,6 +970,7 @@
|
| return result;
|
| }
|
| #endif
|
| +#endif
|
|
|
| #if USE(JAVASCRIPTCORE_BINDINGS)
|
| static JSValueRef inspectedWindow(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef[] /*arguments[]*/, JSValueRef* /*exception*/)
|
| @@ -1447,8 +1456,10 @@
|
| { "detach", detach, kJSPropertyAttributeNone },
|
| { "search", search, kJSPropertyAttributeNone },
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| { "databaseTableNames", databaseTableNames, kJSPropertyAttributeNone },
|
| #endif
|
| +#endif
|
| { "inspectedWindow", inspectedWindow, kJSPropertyAttributeNone },
|
| { "localizedStringsURL", localizedStrings, kJSPropertyAttributeNone },
|
| { "platform", platform, kJSPropertyAttributeNone },
|
| @@ -2193,10 +2204,12 @@
|
| addScriptConsoleMessage(m_consoleMessages[i]);
|
|
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end();
|
| for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
|
| addDatabaseScriptResource((*it).get());
|
| #endif
|
| +#endif
|
| }
|
| #elif USE(V8_BINDING)
|
| void InspectorController::populateScriptObjects()
|
| @@ -2212,6 +2225,7 @@
|
| #endif
|
|
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| JSObjectRef InspectorController::addDatabaseScriptResource(InspectorDatabaseResource* resource)
|
| {
|
| ASSERT_ARG(resource, resource);
|
| @@ -2306,6 +2320,7 @@
|
| HANDLE_EXCEPTION(exception);
|
| }
|
| #endif
|
| +#endif
|
|
|
| #if USE(JAVASCRIPTCORE_BINDINGS)
|
| void InspectorController::addScriptConsoleMessage(const ConsoleMessage* message)
|
| @@ -2434,12 +2449,14 @@
|
| }
|
|
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| DatabaseResourcesSet::iterator databasesEnd = m_databaseResources.end();
|
| for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it) {
|
| InspectorDatabaseResource* resource = (*it).get();
|
| resource->setScriptObject(0, 0);
|
| }
|
| #endif
|
| +#endif
|
|
|
| #if USE(JAVASCRIPTCORE_BINDINGS)
|
| callSimpleFunction(m_scriptContext, m_scriptObject, "reset");
|
| @@ -2486,8 +2503,10 @@
|
| m_consoleMessages.clear();
|
|
|
| #if ENABLE(DATABASE)
|
| +#if ENABLE_DATABASE_INSPECTION
|
| m_databaseResources.clear();
|
| #endif
|
| +#endif
|
|
|
| if (windowVisible()) {
|
| resetScriptObjects();
|
| @@ -2729,6 +2748,7 @@
|
| #if ENABLE(DATABASE)
|
| void InspectorController::didOpenDatabase(Database* database, const String& domain, const String& name, const String& version)
|
| {
|
| +#if ENABLE_DATABASE_INSPECTION
|
| if (!enabled())
|
| return;
|
|
|
| @@ -2738,6 +2758,7 @@
|
|
|
| if (windowVisible())
|
| addDatabaseScriptResource(resource.get());
|
| +#endif
|
| }
|
| #endif
|
|
|
|
|