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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleRule.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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 StyleRuleCondition::StyleRuleCondition( 346 StyleRuleCondition::StyleRuleCondition(
347 RuleType type, 347 RuleType type,
348 const String& condition_text, 348 const String& condition_text,
349 HeapVector<Member<StyleRuleBase>>& adopt_rules) 349 HeapVector<Member<StyleRuleBase>>& adopt_rules)
350 : StyleRuleGroup(type, adopt_rules), condition_text_(condition_text) {} 350 : StyleRuleGroup(type, adopt_rules), condition_text_(condition_text) {}
351 351
352 StyleRuleCondition::StyleRuleCondition(const StyleRuleCondition& condition_rule) 352 StyleRuleCondition::StyleRuleCondition(const StyleRuleCondition& condition_rule)
353 : StyleRuleGroup(condition_rule), 353 : StyleRuleGroup(condition_rule),
354 condition_text_(condition_rule.condition_text_) {} 354 condition_text_(condition_rule.condition_text_) {}
355 355
356 StyleRuleMedia::StyleRuleMedia(MediaQuerySet* media, 356 StyleRuleMedia::StyleRuleMedia(RefPtr<MediaQuerySet> media,
357 HeapVector<Member<StyleRuleBase>>& adopt_rules) 357 HeapVector<Member<StyleRuleBase>>& adopt_rules)
358 : StyleRuleCondition(kMedia, adopt_rules), media_queries_(media) {} 358 : StyleRuleCondition(kMedia, adopt_rules), media_queries_(media) {}
359 359
360 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& media_rule) 360 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& media_rule)
361 : StyleRuleCondition(media_rule) { 361 : StyleRuleCondition(media_rule) {
362 if (media_rule.media_queries_) 362 if (media_rule.media_queries_)
363 media_queries_ = media_rule.media_queries_->Copy(); 363 media_queries_ = media_rule.media_queries_->Copy();
364 } 364 }
365 365
366 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleMedia) {
367 visitor->Trace(media_queries_);
368 StyleRuleCondition::TraceAfterDispatch(visitor);
369 }
370
371 StyleRuleSupports::StyleRuleSupports( 366 StyleRuleSupports::StyleRuleSupports(
372 const String& condition_text, 367 const String& condition_text,
373 bool condition_is_supported, 368 bool condition_is_supported,
374 HeapVector<Member<StyleRuleBase>>& adopt_rules) 369 HeapVector<Member<StyleRuleBase>>& adopt_rules)
375 : StyleRuleCondition(kSupports, condition_text, adopt_rules), 370 : StyleRuleCondition(kSupports, condition_text, adopt_rules),
376 condition_is_supported_(condition_is_supported) {} 371 condition_is_supported_(condition_is_supported) {}
377 372
373 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleMedia) {
374 StyleRuleCondition::TraceAfterDispatch(visitor);
375 }
376
378 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& supports_rule) 377 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& supports_rule)
379 : StyleRuleCondition(supports_rule), 378 : StyleRuleCondition(supports_rule),
380 condition_is_supported_(supports_rule.condition_is_supported_) {} 379 condition_is_supported_(supports_rule.condition_is_supported_) {}
381 380
382 StyleRuleViewport::StyleRuleViewport(StylePropertySet* properties) 381 StyleRuleViewport::StyleRuleViewport(StylePropertySet* properties)
383 : StyleRuleBase(kViewport), properties_(properties) {} 382 : StyleRuleBase(kViewport), properties_(properties) {}
384 383
385 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& viewport_rule) 384 StyleRuleViewport::StyleRuleViewport(const StyleRuleViewport& viewport_rule)
386 : StyleRuleBase(viewport_rule), 385 : StyleRuleBase(viewport_rule),
387 properties_(viewport_rule.properties_->MutableCopy()) {} 386 properties_(viewport_rule.properties_->MutableCopy()) {}
388 387
389 StyleRuleViewport::~StyleRuleViewport() {} 388 StyleRuleViewport::~StyleRuleViewport() {}
390 389
391 MutableStylePropertySet& StyleRuleViewport::MutableProperties() { 390 MutableStylePropertySet& StyleRuleViewport::MutableProperties() {
392 if (!properties_->IsMutable()) 391 if (!properties_->IsMutable())
393 properties_ = properties_->MutableCopy(); 392 properties_ = properties_->MutableCopy();
394 return *ToMutableStylePropertySet(properties_); 393 return *ToMutableStylePropertySet(properties_);
395 } 394 }
396 395
397 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) { 396 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) {
398 visitor->Trace(properties_); 397 visitor->Trace(properties_);
399 StyleRuleBase::TraceAfterDispatch(visitor); 398 StyleRuleBase::TraceAfterDispatch(visitor);
400 } 399 }
401 400
402 } // namespace blink 401 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698