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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return; 115 return;
116 } 116 }
117 if (state == ParseHeight && i > start) { 117 if (state == ParseHeight && i > start) {
118 int height = charactersToInt(value + start, i - start); 118 int height = charactersToInt(value + start, i - start);
119 iconSizes.append(IntSize(width, height)); 119 iconSizes.append(IntSize(width, height));
120 } 120 }
121 } 121 }
122 122
123 static LinkEventSender& linkLoadEventSender() 123 static LinkEventSender& linkLoadEventSender()
124 { 124 {
125 DEFINE_STATIC_LOCAL(LinkEventSender, sharedLoadEventSender, (EventTypeNames: :load)); 125 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<LinkEventSender>, sharedLoadEvent Sender, (LinkEventSender::create(EventTypeNames::load)));
126 return sharedLoadEventSender; 126 return *sharedLoadEventSender;
127 } 127 }
128 128
129 void HTMLLinkElement::parseSizesAttribute(const AtomicString& value, Vector<IntS ize>& iconSizes) 129 void HTMLLinkElement::parseSizesAttribute(const AtomicString& value, Vector<IntS ize>& iconSizes)
130 { 130 {
131 ASSERT(iconSizes.isEmpty()); 131 ASSERT(iconSizes.isEmpty());
132 if (value.isEmpty()) 132 if (value.isEmpty())
133 return; 133 return;
134 if (value.is8Bit()) 134 if (value.is8Bit())
135 parseSizes(value.characters8(), value.length(), iconSizes); 135 parseSizes(value.characters8(), value.length(), iconSizes);
136 else 136 else
(...skipping 15 matching lines...) Expand all
152 return adoptRefWillBeNoop(new HTMLLinkElement(document, createdByParser)); 152 return adoptRefWillBeNoop(new HTMLLinkElement(document, createdByParser));
153 } 153 }
154 154
155 HTMLLinkElement::~HTMLLinkElement() 155 HTMLLinkElement::~HTMLLinkElement()
156 { 156 {
157 #if !ENABLE(OILPAN) 157 #if !ENABLE(OILPAN)
158 m_sizes->setObserver(nullptr); 158 m_sizes->setObserver(nullptr);
159 m_link.clear(); 159 m_link.clear();
160 if (inDocument()) 160 if (inDocument())
161 document().styleEngine().removeStyleSheetCandidateNode(this); 161 document().styleEngine().removeStyleSheetCandidateNode(this);
162 linkLoadEventSender().cancelEvent(this);
162 #endif 163 #endif
163 linkLoadEventSender().cancelEvent(this);
164 } 164 }
165 165
166 void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& oldValue, const AtomicString& value) 166 void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& oldValue, const AtomicString& value)
167 { 167 {
168 if (name == relAttr) { 168 if (name == relAttr) {
169 m_relAttribute = LinkRelAttribute(value); 169 m_relAttribute = LinkRelAttribute(value);
170 m_relList->setRelValues(value); 170 m_relList->setRelValues(value);
171 process(); 171 process();
172 } else if (name == hrefAttr) { 172 } else if (name == hrefAttr) {
173 // Log href attribute before logging resource fetching in process(). 173 // Log href attribute before logging resource fetching in process().
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 removePendingSheet(); 766 removePendingSheet();
767 } 767 }
768 768
769 DEFINE_TRACE(LinkStyle) 769 DEFINE_TRACE(LinkStyle)
770 { 770 {
771 visitor->trace(m_sheet); 771 visitor->trace(m_sheet);
772 LinkResource::trace(visitor); 772 LinkResource::trace(visitor);
773 } 773 }
774 774
775 } // namespace blink 775 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLLinkElement.h ('k') | third_party/WebKit/Source/core/html/HTMLSourceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698