| 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 "modules/storage/DOMWindowStorage.h" | 5 #include "modules/storage/DOMWindowStorage.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 if (m_localStorage) { | 123 if (m_localStorage) { |
| 124 if (!m_localStorage->area()->canAccessStorage(m_window->frame())) { | 124 if (!m_localStorage->area()->canAccessStorage(m_window->frame())) { |
| 125 exceptionState.throwSecurityError(accessDeniedMessage); | 125 exceptionState.throwSecurityError(accessDeniedMessage); |
| 126 return nullptr; | 126 return nullptr; |
| 127 } | 127 } |
| 128 return m_localStorage; | 128 return m_localStorage; |
| 129 } | 129 } |
| 130 // FIXME: Seems this check should be much higher? | 130 // FIXME: Seems this check should be much higher? |
| 131 FrameHost* host = document->frameHost(); | 131 FrameHost* host = document->frameHost(); |
| 132 if (!host || !host->settings().localStorageEnabled()) | 132 if (!host || !host->settings().getLocalStorageEnabled()) |
| 133 return nullptr; | 133 return nullptr; |
| 134 StorageArea* storageArea = | 134 StorageArea* storageArea = |
| 135 StorageNamespace::localStorageArea(document->getSecurityOrigin()); | 135 StorageNamespace::localStorageArea(document->getSecurityOrigin()); |
| 136 if (!storageArea->canAccessStorage(m_window->frame())) { | 136 if (!storageArea->canAccessStorage(m_window->frame())) { |
| 137 exceptionState.throwSecurityError(accessDeniedMessage); | 137 exceptionState.throwSecurityError(accessDeniedMessage); |
| 138 return nullptr; | 138 return nullptr; |
| 139 } | 139 } |
| 140 m_localStorage = Storage::create(m_window->frame(), storageArea); | 140 m_localStorage = Storage::create(m_window->frame(), storageArea); |
| 141 return m_localStorage; | 141 return m_localStorage; |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace blink | 144 } // namespace blink |
| OLD | NEW |