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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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/frame/LocalDOMWindow.h" 9 #include "core/frame/LocalDOMWindow.h"
10 #include "core/page/Page.h" 10 #include "core/page/Page.h"
11 #include "modules/storage/DOMWindowStorage.h" 11 #include "modules/storage/DOMWindowStorage.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 DOMWindowStorageController::DOMWindowStorageController(Document& document) 15 DOMWindowStorageController::DOMWindowStorageController(Document& document)
16 : DOMWindowLifecycleObserver(document.domWindow()) 16 : DOMWindowLifecycleObserver(document.domWindow())
17 , m_document(document) 17 , m_document(document)
18 { 18 {
19 } 19 }
20 20
21 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowStorageController);
22
23 DEFINE_TRACE(DOMWindowStorageController) 21 DEFINE_TRACE(DOMWindowStorageController)
24 { 22 {
25 visitor->trace(m_document); 23 visitor->trace(m_document);
26 WillBeHeapSupplement<Document>::trace(visitor); 24 HeapSupplement<Document>::trace(visitor);
27 DOMWindowLifecycleObserver::trace(visitor); 25 DOMWindowLifecycleObserver::trace(visitor);
28 } 26 }
29 27
30 // static 28 // static
31 const char* DOMWindowStorageController::supplementName() 29 const char* DOMWindowStorageController::supplementName()
32 { 30 {
33 return "DOMWindowStorageController"; 31 return "DOMWindowStorageController";
34 } 32 }
35 33
36 // static 34 // static
37 DOMWindowStorageController& DOMWindowStorageController::from(Document& document) 35 DOMWindowStorageController& DOMWindowStorageController::from(Document& document)
38 { 36 {
39 DOMWindowStorageController* controller = static_cast<DOMWindowStorageControl ler*>(WillBeHeapSupplement<Document>::from(document, supplementName())); 37 DOMWindowStorageController* controller = static_cast<DOMWindowStorageControl ler*>(HeapSupplement<Document>::from(document, supplementName()));
40 if (!controller) { 38 if (!controller) {
41 controller = new DOMWindowStorageController(document); 39 controller = new DOMWindowStorageController(document);
42 WillBeHeapSupplement<Document>::provideTo(document, supplementName(), ad optPtrWillBeNoop(controller)); 40 HeapSupplement<Document>::provideTo(document, supplementName(), (control ler));
43 } 41 }
44 return *controller; 42 return *controller;
45 } 43 }
46 44
47 void DOMWindowStorageController::didAddEventListener(LocalDOMWindow* window, con st AtomicString& eventType) 45 void DOMWindowStorageController::didAddEventListener(LocalDOMWindow* window, con st AtomicString& eventType)
48 { 46 {
49 if (eventType == EventTypeNames::storage) { 47 if (eventType == EventTypeNames::storage) {
50 // Creating these blink::Storage objects informs the system that we'd li ke to receive 48 // Creating these blink::Storage objects informs the system that we'd li ke to receive
51 // notifications about storage events that might be triggered in other p rocesses. Rather 49 // notifications about storage events that might be triggered in other p rocesses. Rather
52 // than subscribe to these notifications explicitly, we subscribe to the m implicitly to 50 // than subscribe to these notifications explicitly, we subscribe to the m implicitly to
53 // simplify the work done by the system. 51 // simplify the work done by the system.
54 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION); 52 DOMWindowStorage::from(*window).localStorage(IGNORE_EXCEPTION);
55 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION); 53 DOMWindowStorage::from(*window).sessionStorage(IGNORE_EXCEPTION);
56 } 54 }
57 } 55 }
58 56
59 } // namespace blink 57 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698