diff options
Diffstat (limited to 'Source/WebCore/inspector/InspectorDatabaseAgent.h')
-rw-r--r-- | Source/WebCore/inspector/InspectorDatabaseAgent.h | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.h b/Source/WebCore/inspector/InspectorDatabaseAgent.h index 322960757..de3c78335 100644 --- a/Source/WebCore/inspector/InspectorDatabaseAgent.h +++ b/Source/WebCore/inspector/InspectorDatabaseAgent.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -26,63 +27,52 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorDatabaseAgent_h -#define InspectorDatabaseAgent_h - -#if ENABLE(INSPECTOR) && ENABLE(SQL_DATABASE) +#pragma once #include "InspectorWebAgentBase.h" -#include "InspectorWebBackendDispatchers.h" -#include "InspectorWebFrontendDispatchers.h" +#include <inspector/InspectorBackendDispatchers.h> +#include <inspector/InspectorFrontendDispatchers.h> #include <wtf/HashMap.h> -#include <wtf/PassOwnPtr.h> #include <wtf/text/WTFString.h> -namespace Inspector { -class InspectorArray; -} - namespace WebCore { class Database; class InspectorDatabaseResource; -class InstrumentingAgents; typedef String ErrorString; -class InspectorDatabaseAgent : public InspectorAgentBase, public Inspector::InspectorDatabaseBackendDispatcherHandler { +class InspectorDatabaseAgent final : public InspectorAgentBase, public Inspector::DatabaseBackendDispatcherHandler { + WTF_MAKE_FAST_ALLOCATED; public: - explicit InspectorDatabaseAgent(InstrumentingAgents*); - ~InspectorDatabaseAgent(); + explicit InspectorDatabaseAgent(WebAgentContext&); + virtual ~InspectorDatabaseAgent(); - virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override; - virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override; + void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; void clearResources(); // Called from the front-end. - virtual void enable(ErrorString*) override; - virtual void disable(ErrorString*) override; - virtual void getDatabaseTableNames(ErrorString*, const String& databaseId, RefPtr<Inspector::TypeBuilder::Array<String>>& names) override; - virtual void executeSQL(ErrorString*, const String& databaseId, const String& query, PassRefPtr<ExecuteSQLCallback>) override; + void enable(ErrorString&) override; + void disable(ErrorString&) override; + void getDatabaseTableNames(ErrorString&, const String& databaseId, RefPtr<Inspector::Protocol::Array<String>>& names) override; + void executeSQL(ErrorString&, const String& databaseId, const String& query, Ref<ExecuteSQLCallback>&&) override; // Called from the injected script. String databaseId(Database*); - void didOpenDatabase(PassRefPtr<Database>, const String& domain, const String& name, const String& version); + void didOpenDatabase(RefPtr<Database>&&, const String& domain, const String& name, const String& version); private: Database* databaseForId(const String& databaseId); InspectorDatabaseResource* findByFileName(const String& fileName); - std::unique_ptr<Inspector::InspectorDatabaseFrontendDispatcher> m_frontendDispatcher; - RefPtr<Inspector::InspectorDatabaseBackendDispatcher> m_backendDispatcher; + std::unique_ptr<Inspector::DatabaseFrontendDispatcher> m_frontendDispatcher; + RefPtr<Inspector::DatabaseBackendDispatcher> m_backendDispatcher; + typedef HashMap<String, RefPtr<InspectorDatabaseResource>> DatabaseResourcesMap; DatabaseResourcesMap m_resources; - bool m_enabled; + bool m_enabled { false }; }; } // namespace WebCore - -#endif // ENABLE(INSPECTOR) && ENABLE(SQL_DATABASE) - -#endif // !defined(InspectorDatabaseAgent_h) |