| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/storage/DOMWindowStorage.h" | 6 #include "modules/storage/DOMWindowStorage.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/LocalDOMWindow.h" | 10 #include "core/frame/LocalDOMWindow.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return nullptr; | 136 return nullptr; |
| 137 StorageArea* storageArea = StorageNamespace::localStorageArea(document->secu
rityOrigin()); | 137 StorageArea* storageArea = StorageNamespace::localStorageArea(document->secu
rityOrigin()); |
| 138 if (!storageArea->canAccessStorage(m_window->frame())) { | 138 if (!storageArea->canAccessStorage(m_window->frame())) { |
| 139 exceptionState.throwSecurityError(accessDeniedMessage); | 139 exceptionState.throwSecurityError(accessDeniedMessage); |
| 140 return nullptr; | 140 return nullptr; |
| 141 } | 141 } |
| 142 m_localStorage = Storage::create(m_window->frame(), storageArea); | 142 m_localStorage = Storage::create(m_window->frame(), storageArea); |
| 143 return m_localStorage; | 143 return m_localStorage; |
| 144 } | 144 } |
| 145 | 145 |
| 146 Storage* DOMWindowStorage::optionalSessionStorage() const | |
| 147 { | |
| 148 return m_sessionStorage.get(); | |
| 149 } | |
| 150 | |
| 151 Storage* DOMWindowStorage::optionalLocalStorage() const | |
| 152 { | |
| 153 return m_localStorage.get(); | |
| 154 } | |
| 155 | |
| 156 } // namespace blink | 146 } // namespace blink |
| OLD | NEW |