OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "modules/storage/DOMWindowStorageController.h" | 5 #include "modules/storage/DOMWindowStorageController.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
9 #include "core/frame/LocalDOMWindow.h" | |
10 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
11 #include "modules/storage/DOMWindowStorage.h" | 10 #include "modules/storage/DOMWindowStorage.h" |
12 | 11 |
13 namespace blink { | 12 namespace blink { |
14 | 13 |
15 DOMWindowStorageController::DOMWindowStorageController(Document& document) | 14 DOMWindowStorageController::DOMWindowStorageController(Document& document) |
16 : DOMWindowLifecycleObserver(document.domWindow()) | 15 : m_document(document) |
17 , m_document(document) | |
18 { | 16 { |
| 17 document.domWindow()->registerEventListenerObserver(this); |
19 } | 18 } |
20 | 19 |
21 DEFINE_TRACE(DOMWindowStorageController) | 20 DEFINE_TRACE(DOMWindowStorageController) |
22 { | 21 { |
23 visitor->trace(m_document); | 22 visitor->trace(m_document); |
24 Supplement<Document>::trace(visitor); | 23 Supplement<Document>::trace(visitor); |
25 DOMWindowLifecycleObserver::trace(visitor); | |
26 } | 24 } |
27 | 25 |
28 // static | 26 // static |
29 const char* DOMWindowStorageController::supplementName() | 27 const char* DOMWindowStorageController::supplementName() |
30 { | 28 { |
31 return "DOMWindowStorageController"; | 29 return "DOMWindowStorageController"; |
32 } | 30 } |
33 | 31 |
34 // static | 32 // static |
35 DOMWindowStorageController& DOMWindowStorageController::from(Document& document) | 33 DOMWindowStorageController& DOMWindowStorageController::from(Document& document) |
(...skipping 12 matching lines...) Expand all Loading... |
48 // Creating these blink::Storage objects informs the system that we'd li
ke to receive | 46 // Creating these blink::Storage objects informs the system that we'd li
ke to receive |
49 // notifications about storage events that might be triggered in other p
rocesses. Rather | 47 // notifications about storage events that might be triggered in other p
rocesses. Rather |
50 // than subscribe to these notifications explicitly, we subscribe to the
m implicitly to | 48 // than subscribe to these notifications explicitly, we subscribe to the
m implicitly to |
51 // simplify the work done by the system. | 49 // simplify the work done by the system. |
52 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION); | 50 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION); |
53 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION); | 51 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION); |
54 } | 52 } |
55 } | 53 } |
56 | 54 |
57 } // namespace blink | 55 } // namespace blink |
OLD | NEW |