diff options
Diffstat (limited to 'Source/WebCore/inspector/InspectorDOMStorageAgent.h')
-rw-r--r-- | Source/WebCore/inspector/InspectorDOMStorageAgent.h | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.h b/Source/WebCore/inspector/InspectorDOMStorageAgent.h index 5ad2b7e11..7a96bf5e3 100644 --- a/Source/WebCore/inspector/InspectorDOMStorageAgent.h +++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.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,58 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorDOMStorageAgent_h -#define InspectorDOMStorageAgent_h +#pragma once #include "InspectorWebAgentBase.h" -#include "InspectorWebBackendDispatchers.h" #include "StorageArea.h" -#include <wtf/HashMap.h> -#include <wtf/PassOwnPtr.h> +#include <inspector/InspectorBackendDispatchers.h> #include <wtf/text/WTFString.h> namespace Inspector { -class InspectorArray; -class InspectorDOMStorageFrontendDispatcher; +class DOMStorageFrontendDispatcher; } namespace WebCore { class Frame; class InspectorPageAgent; -class InstrumentingAgents; class Page; class SecurityOrigin; class Storage; typedef String ErrorString; -class InspectorDOMStorageAgent : public InspectorAgentBase, public Inspector::InspectorDOMStorageBackendDispatcherHandler { +class InspectorDOMStorageAgent final : public InspectorAgentBase, public Inspector::DOMStorageBackendDispatcherHandler { + WTF_MAKE_FAST_ALLOCATED; public: - InspectorDOMStorageAgent(InstrumentingAgents*, InspectorPageAgent*); - ~InspectorDOMStorageAgent(); + InspectorDOMStorageAgent(WebAgentContext&, InspectorPageAgent*); + virtual ~InspectorDOMStorageAgent(); - 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; // Called from the front-end. - virtual void enable(ErrorString*) override; - virtual void disable(ErrorString*) override; - virtual void getDOMStorageItems(ErrorString*, const RefPtr<Inspector::InspectorObject>& storageId, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Array<String>>>& items) override; - virtual void setDOMStorageItem(ErrorString*, const RefPtr<Inspector::InspectorObject>& storageId, const String& key, const String& value) override; - virtual void removeDOMStorageItem(ErrorString*, const RefPtr<Inspector::InspectorObject>& storageId, const String& key) override; + void enable(ErrorString&) override; + void disable(ErrorString&) override; + void getDOMStorageItems(ErrorString&, const Inspector::InspectorObject& storageId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Array<String>>>& items) override; + void setDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key, const String& value) override; + void removeDOMStorageItem(ErrorString&, const Inspector::InspectorObject& storageId, const String& key) override; // Called from the injected script. String storageId(Storage*); - PassRefPtr<Inspector::TypeBuilder::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage); + RefPtr<Inspector::Protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage); - // Called from InspectorInstrumentation - void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*); + // InspectorInstrumentation + void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*); private: - PassRefPtr<StorageArea> findStorageArea(ErrorString*, const RefPtr<Inspector::InspectorObject>&, Frame*&); + RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&); - InspectorPageAgent* m_pageAgent; - std::unique_ptr<Inspector::InspectorDOMStorageFrontendDispatcher> m_frontendDispatcher; - RefPtr<Inspector::InspectorDOMStorageBackendDispatcher> m_backendDispatcher; - bool m_enabled; + std::unique_ptr<Inspector::DOMStorageFrontendDispatcher> m_frontendDispatcher; + RefPtr<Inspector::DOMStorageBackendDispatcher> m_backendDispatcher; + InspectorPageAgent* m_pageAgent { nullptr }; + + bool m_enabled { false }; }; } // namespace WebCore - -#endif // !defined(InspectorDOMStorageAgent_h) |