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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLStyleElement.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, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * (C) 2007 Rob Buis (buis@kde.org) 6 * (C) 2007 Rob Buis (buis@kde.org)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 18 matching lines...) Expand all
29 #include "core/dom/shadow/ShadowRoot.h" 29 #include "core/dom/shadow/ShadowRoot.h"
30 #include "core/events/Event.h" 30 #include "core/events/Event.h"
31 #include "core/events/EventSender.h" 31 #include "core/events/EventSender.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 using namespace HTMLNames; 35 using namespace HTMLNames;
36 36
37 static StyleEventSender& styleLoadEventSender() 37 static StyleEventSender& styleLoadEventSender()
38 { 38 {
39 DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender, (EventTypeNames ::load)); 39 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<StyleEventSender>, sharedLoadEven tSender, (StyleEventSender::create(EventTypeNames::load)));
40 return sharedLoadEventSender; 40 return *sharedLoadEventSender;
41 } 41 }
42 42
43 inline HTMLStyleElement::HTMLStyleElement(Document& document, bool createdByPars er) 43 inline HTMLStyleElement::HTMLStyleElement(Document& document, bool createdByPars er)
44 : HTMLElement(styleTag, document) 44 : HTMLElement(styleTag, document)
45 , StyleElement(&document, createdByParser) 45 , StyleElement(&document, createdByParser)
46 , m_firedLoad(false) 46 , m_firedLoad(false)
47 , m_loadedSheet(false) 47 , m_loadedSheet(false)
48 { 48 {
49 } 49 }
50 50
51 HTMLStyleElement::~HTMLStyleElement() 51 HTMLStyleElement::~HTMLStyleElement()
52 { 52 {
53 #if !ENABLE(OILPAN) 53 #if !ENABLE(OILPAN)
54 StyleElement::clearDocumentData(document(), this); 54 StyleElement::clearDocumentData(document(), this);
55 #endif
56 55
57 styleLoadEventSender().cancelEvent(this); 56 styleLoadEventSender().cancelEvent(this);
57 #endif
58 } 58 }
59 59
60 PassRefPtrWillBeRawPtr<HTMLStyleElement> HTMLStyleElement::create(Document& docu ment, bool createdByParser) 60 PassRefPtrWillBeRawPtr<HTMLStyleElement> HTMLStyleElement::create(Document& docu ment, bool createdByParser)
61 { 61 {
62 return adoptRefWillBeNoop(new HTMLStyleElement(document, createdByParser)); 62 return adoptRefWillBeNoop(new HTMLStyleElement(document, createdByParser));
63 } 63 }
64 64
65 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& oldValue, const AtomicString& value) 65 void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& oldValue, const AtomicString& value)
66 { 66 {
67 if (name == titleAttr && m_sheet) { 67 if (name == titleAttr && m_sheet) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 styleSheet->setDisabled(setDisabled); 153 styleSheet->setDisabled(setDisabled);
154 } 154 }
155 155
156 DEFINE_TRACE(HTMLStyleElement) 156 DEFINE_TRACE(HTMLStyleElement)
157 { 157 {
158 StyleElement::trace(visitor); 158 StyleElement::trace(visitor);
159 HTMLElement::trace(visitor); 159 HTMLElement::trace(visitor);
160 } 160 }
161 161
162 } 162 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.h ('k') | third_party/WebKit/Source/core/loader/ImageLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698