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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp

Issue 1554903002: EventSender<T> singletons are better off on the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove no-op cancelEvent()s Created 4 years, 11 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 /* 1 /*
2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 HTMLContentSelectFilter::trace(visitor); 67 HTMLContentSelectFilter::trace(visitor);
68 } 68 }
69 69
70 private: 70 private:
71 FirstSummarySelectFilter() { } 71 FirstSummarySelectFilter() { }
72 }; 72 };
73 73
74 static DetailsEventSender& detailsToggleEventSender() 74 static DetailsEventSender& detailsToggleEventSender()
75 { 75 {
76 DEFINE_STATIC_LOCAL(DetailsEventSender, sharedToggleEventSender, (EventTypeN ames::toggle)); 76 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<DetailsEventSender>, sharedToggle EventSender, (DetailsEventSender::create(EventTypeNames::toggle)));
77 return sharedToggleEventSender; 77 return *sharedToggleEventSender;
78 } 78 }
79 79
80 PassRefPtrWillBeRawPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document& document) 80 PassRefPtrWillBeRawPtr<HTMLDetailsElement> HTMLDetailsElement::create(Document& document)
81 { 81 {
82 RefPtrWillBeRawPtr<HTMLDetailsElement> details = adoptRefWillBeNoop(new HTML DetailsElement(document)); 82 RefPtrWillBeRawPtr<HTMLDetailsElement> details = adoptRefWillBeNoop(new HTML DetailsElement(document));
83 details->ensureUserAgentShadowRoot(); 83 details->ensureUserAgentShadowRoot();
84 return details.release(); 84 return details.release();
85 } 85 }
86 86
87 HTMLDetailsElement::HTMLDetailsElement(Document& document) 87 HTMLDetailsElement::HTMLDetailsElement(Document& document)
88 : HTMLElement(detailsTag, document) 88 : HTMLElement(detailsTag, document)
89 , m_isOpen(false) 89 , m_isOpen(false)
90 { 90 {
91 UseCounter::count(document, UseCounter::DetailsElement); 91 UseCounter::count(document, UseCounter::DetailsElement);
92 } 92 }
93 93
94 HTMLDetailsElement::~HTMLDetailsElement() 94 HTMLDetailsElement::~HTMLDetailsElement()
95 { 95 {
96 #if !ENABLE(OILPAN)
96 detailsToggleEventSender().cancelEvent(this); 97 detailsToggleEventSender().cancelEvent(this);
98 #endif
97 } 99 }
98 100
99 void HTMLDetailsElement::dispatchPendingEvent(DetailsEventSender* eventSender) 101 void HTMLDetailsElement::dispatchPendingEvent(DetailsEventSender* eventSender)
100 { 102 {
101 ASSERT_UNUSED(eventSender, eventSender == &detailsToggleEventSender()); 103 ASSERT_UNUSED(eventSender, eventSender == &detailsToggleEventSender());
102 dispatchEvent(Event::create(EventTypeNames::toggle)); 104 dispatchEvent(Event::create(EventTypeNames::toggle));
103 } 105 }
104 106
105 107
106 LayoutObject* HTMLDetailsElement::createLayoutObject(const ComputedStyle&) 108 LayoutObject* HTMLDetailsElement::createLayoutObject(const ComputedStyle&)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 { 174 {
173 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom); 175 setAttribute(openAttr, m_isOpen ? nullAtom : emptyAtom);
174 } 176 }
175 177
176 bool HTMLDetailsElement::isInteractiveContent() const 178 bool HTMLDetailsElement::isInteractiveContent() const
177 { 179 {
178 return true; 180 return true;
179 } 181 }
180 182
181 } 183 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLDetailsElement.h ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698