| 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/page/Page.h" | 9 #include "core/page/Page.h" |
| 10 #include "modules/storage/DOMWindowStorage.h" | 10 #include "modules/storage/DOMWindowStorage.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 DOMWindowStorageController::DOMWindowStorageController(Document& document) | 14 DOMWindowStorageController::DOMWindowStorageController(Document& document) |
| 15 : m_document(document) { | 15 : Supplement<Document>(document) { |
| 16 document.domWindow()->registerEventListenerObserver(this); | 16 document.domWindow()->registerEventListenerObserver(this); |
| 17 } | 17 } |
| 18 | 18 |
| 19 DEFINE_TRACE(DOMWindowStorageController) { | 19 DEFINE_TRACE(DOMWindowStorageController) { |
| 20 visitor->trace(m_document); | |
| 21 Supplement<Document>::trace(visitor); | 20 Supplement<Document>::trace(visitor); |
| 22 } | 21 } |
| 23 | 22 |
| 24 // static | 23 // static |
| 25 const char* DOMWindowStorageController::supplementName() { | 24 const char* DOMWindowStorageController::supplementName() { |
| 26 return "DOMWindowStorageController"; | 25 return "DOMWindowStorageController"; |
| 27 } | 26 } |
| 28 | 27 |
| 29 // static | 28 // static |
| 30 DOMWindowStorageController& DOMWindowStorageController::from( | 29 DOMWindowStorageController& DOMWindowStorageController::from( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 46 // Creating these blink::Storage objects informs the system that we'd like | 45 // Creating these blink::Storage objects informs the system that we'd like |
| 47 // to receive notifications about storage events that might be triggered in | 46 // to receive notifications about storage events that might be triggered in |
| 48 // other processes. Rather than subscribe to these notifications explicitly, | 47 // other processes. Rather than subscribe to these notifications explicitly, |
| 49 // we subscribe to them implicitly to simplify the work done by the system. | 48 // we subscribe to them implicitly to simplify the work done by the system. |
| 50 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION); | 49 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION); |
| 51 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION); | 50 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION); |
| 52 } | 51 } |
| 53 } | 52 } |
| 54 | 53 |
| 55 } // namespace blink | 54 } // namespace blink |
| OLD | NEW |