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

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

Issue 2598463004: Replace DOMWindowProperty in DOMWindow's supplements with ContextClient (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « third_party/WebKit/Source/modules/storage/DOMWindowStorage.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "core/frame/Settings.h" 11 #include "core/frame/Settings.h"
12 #include "core/page/Page.h" 12 #include "core/page/Page.h"
13 #include "modules/storage/Storage.h" 13 #include "modules/storage/Storage.h"
14 #include "modules/storage/StorageNamespace.h" 14 #include "modules/storage/StorageNamespace.h"
15 #include "modules/storage/StorageNamespaceController.h" 15 #include "modules/storage/StorageNamespaceController.h"
16 #include "wtf/PassRefPtr.h" 16 #include "wtf/PassRefPtr.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 DOMWindowStorage::DOMWindowStorage(LocalDOMWindow& window) 20 DOMWindowStorage::DOMWindowStorage(LocalDOMWindow& window)
21 : DOMWindowProperty(window.frame()), m_window(&window) {} 21 : ContextClient(window.frame()), m_window(&window) {}
22 22
23 DEFINE_TRACE(DOMWindowStorage) { 23 DEFINE_TRACE(DOMWindowStorage) {
24 visitor->trace(m_window); 24 visitor->trace(m_window);
25 visitor->trace(m_sessionStorage); 25 visitor->trace(m_sessionStorage);
26 visitor->trace(m_localStorage); 26 visitor->trace(m_localStorage);
27 Supplement<LocalDOMWindow>::trace(visitor); 27 Supplement<LocalDOMWindow>::trace(visitor);
28 DOMWindowProperty::trace(visitor); 28 ContextClient::trace(visitor);
29 } 29 }
30 30
31 // static 31 // static
32 const char* DOMWindowStorage::supplementName() { 32 const char* DOMWindowStorage::supplementName() {
33 return "DOMWindowStorage"; 33 return "DOMWindowStorage";
34 } 34 }
35 35
36 // static 36 // static
37 DOMWindowStorage& DOMWindowStorage::from(LocalDOMWindow& window) { 37 DOMWindowStorage& DOMWindowStorage::from(LocalDOMWindow& window) {
38 DOMWindowStorage* supplement = static_cast<DOMWindowStorage*>( 38 DOMWindowStorage* supplement = static_cast<DOMWindowStorage*>(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/storage/DOMWindowStorage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698