| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StorageNamespaceController_h | 5 #ifndef StorageNamespaceController_h |
| 6 #define StorageNamespaceController_h | 6 #define StorageNamespaceController_h |
| 7 | 7 |
| 8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "core/page/PageSupplementable.h" |
| 9 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
| 11 #include "platform/heap/Handle.h" |
| 10 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 11 | 13 |
| 12 namespace blink { | 14 namespace blink { |
| 13 | 15 |
| 14 class InspectorDOMStorageAgent; | 16 class InspectorDOMStorageAgent; |
| 17 class Page; |
| 15 class StorageClient; | 18 class StorageClient; |
| 16 class StorageNamespace; | 19 class StorageNamespace; |
| 17 | 20 |
| 18 class StorageNamespaceController final : public NoBaseWillBeGarbageCollectedFina
lized<StorageNamespaceController>, public WillBeHeapSupplement<Page> { | 21 class StorageNamespaceController final : public NoBaseWillBeGarbageCollectedFina
lized<StorageNamespaceController>, public WillBeHeapSupplement<Page> { |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StorageNamespaceController); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StorageNamespaceController); |
| 20 public: | 23 public: |
| 21 StorageNamespace* sessionStorage(bool optionalCreate = true); | 24 StorageNamespace* sessionStorage(bool optionalCreate = true); |
| 22 StorageClient* storageClient() { return m_client; } | 25 StorageClient* storageClient() { return m_client; } |
| 23 ~StorageNamespaceController(); | 26 ~StorageNamespaceController(); |
| 24 | 27 |
| 25 static void provideStorageNamespaceTo(Page&, StorageClient*); | 28 static void provideStorageNamespaceTo(Page&, StorageClient*); |
| 26 static StorageNamespaceController* from(Page* page) { return static_cast<Sto
rageNamespaceController*>(WillBeHeapSupplement<Page>::from(page, supplementName(
))); } | 29 static StorageNamespaceController* from(Page* page) { return static_cast<Sto
rageNamespaceController*>(WillBeHeapSupplement<Page>::from(page, supplementName(
))); } |
| 27 | 30 |
| 28 DECLARE_TRACE(); | 31 DECLARE_TRACE(); |
| 29 | 32 |
| 30 InspectorDOMStorageAgent* inspectorAgent() { return m_inspectorAgent; } | 33 InspectorDOMStorageAgent* inspectorAgent() { return m_inspectorAgent; } |
| 31 void setInspectorAgent(InspectorDOMStorageAgent* agent) { m_inspectorAgent =
agent; } | 34 void setInspectorAgent(InspectorDOMStorageAgent* agent) { m_inspectorAgent =
agent; } |
| 32 private: | 35 private: |
| 33 explicit StorageNamespaceController(StorageClient*); | 36 explicit StorageNamespaceController(StorageClient*); |
| 34 static const char* supplementName(); | 37 static const char* supplementName(); |
| 35 OwnPtr<StorageNamespace> m_sessionStorage; | 38 OwnPtr<StorageNamespace> m_sessionStorage; |
| 36 StorageClient* m_client; | 39 StorageClient* m_client; |
| 37 RawPtrWillBeMember<InspectorDOMStorageAgent> m_inspectorAgent; | 40 RawPtrWillBeMember<InspectorDOMStorageAgent> m_inspectorAgent; |
| 38 }; | 41 }; |
| 39 | 42 |
| 40 } // namespace blink | 43 } // namespace blink |
| 41 | 44 |
| 42 #endif // StorageNamespaceController_h | 45 #endif // StorageNamespaceController_h |
| OLD | NEW |