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

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

Issue 2837023005: Move MediaQuery classes off BlinkGC heap (Closed)
Patch Set: fix Created 3 years, 7 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) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 HTMLSourceElement::~HTMLSourceElement() {} 69 HTMLSourceElement::~HTMLSourceElement() {}
70 70
71 void HTMLSourceElement::CreateMediaQueryList(const AtomicString& media) { 71 void HTMLSourceElement::CreateMediaQueryList(const AtomicString& media) {
72 RemoveMediaQueryListListener(); 72 RemoveMediaQueryListListener();
73 if (media.IsEmpty()) { 73 if (media.IsEmpty()) {
74 media_query_list_ = nullptr; 74 media_query_list_ = nullptr;
75 return; 75 return;
76 } 76 }
77 77
78 MediaQuerySet* set = MediaQuerySet::Create(media); 78 RefPtr<MediaQuerySet> set = MediaQuerySet::Create(media);
79 media_query_list_ = MediaQueryList::Create( 79 media_query_list_ = MediaQueryList::Create(
80 &GetDocument(), &GetDocument().GetMediaQueryMatcher(), set); 80 &GetDocument(), &GetDocument().GetMediaQueryMatcher(), set);
81 AddMediaQueryListListener(); 81 AddMediaQueryListListener();
82 } 82 }
83 83
84 void HTMLSourceElement::DidMoveToNewDocument(Document& old_document) { 84 void HTMLSourceElement::DidMoveToNewDocument(Document& old_document) {
85 CreateMediaQueryList(FastGetAttribute(mediaAttr)); 85 CreateMediaQueryList(FastGetAttribute(mediaAttr));
86 HTMLElement::DidMoveToNewDocument(old_document); 86 HTMLElement::DidMoveToNewDocument(old_document);
87 } 87 }
88 88
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 toHTMLPictureElement(parent)->SourceOrMediaChanged(); 185 toHTMLPictureElement(parent)->SourceOrMediaChanged();
186 } 186 }
187 187
188 DEFINE_TRACE(HTMLSourceElement) { 188 DEFINE_TRACE(HTMLSourceElement) {
189 visitor->Trace(media_query_list_); 189 visitor->Trace(media_query_list_);
190 visitor->Trace(listener_); 190 visitor->Trace(listener_);
191 HTMLElement::Trace(visitor); 191 HTMLElement::Trace(visitor);
192 } 192 }
193 193
194 } // namespace blink 194 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/html/LinkStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698