Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Side by Side Diff: third_party/WebKit/Source/modules/storage/DOMWindowStorage.cpp

Issue 2709263003: Removed FrameHost::settings() (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 if (m_localStorage) { 119 if (m_localStorage) {
120 if (!m_localStorage->area()->canAccessStorage(document->frame())) { 120 if (!m_localStorage->area()->canAccessStorage(document->frame())) {
121 exceptionState.throwSecurityError(accessDeniedMessage); 121 exceptionState.throwSecurityError(accessDeniedMessage);
122 return nullptr; 122 return nullptr;
123 } 123 }
124 return m_localStorage; 124 return m_localStorage;
125 } 125 }
126 // FIXME: Seems this check should be much higher? 126 // FIXME: Seems this check should be much higher?
127 FrameHost* host = document->frameHost(); 127 FrameHost* host = document->frameHost();
128 if (!host || !host->settings().getLocalStorageEnabled()) 128 if (!host || !host->page().settings().getLocalStorageEnabled())
129 return nullptr; 129 return nullptr;
130 StorageArea* storageArea = 130 StorageArea* storageArea =
131 StorageNamespace::localStorageArea(document->getSecurityOrigin()); 131 StorageNamespace::localStorageArea(document->getSecurityOrigin());
132 if (!storageArea->canAccessStorage(document->frame())) { 132 if (!storageArea->canAccessStorage(document->frame())) {
133 exceptionState.throwSecurityError(accessDeniedMessage); 133 exceptionState.throwSecurityError(accessDeniedMessage);
134 return nullptr; 134 return nullptr;
135 } 135 }
136 m_localStorage = Storage::create(document->frame(), storageArea); 136 m_localStorage = Storage::create(document->frame(), storageArea);
137 return m_localStorage; 137 return m_localStorage;
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698