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

Side by Side Diff: Source/core/css/StylePropertySet.cpp

Issue 205033007: Revert of Oilpan: Move CSSStyleDeclaration and subclasses to the heap using transistion types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/StylePropertySet.h ('k') | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * Copyright (C) 2013 Intel Corporation. All rights reserved. 5 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 533
534 CSSStyleDeclaration* MutableStylePropertySet::ensureCSSStyleDeclaration() 534 CSSStyleDeclaration* MutableStylePropertySet::ensureCSSStyleDeclaration()
535 { 535 {
536 // FIXME: get rid of this weirdness of a CSSStyleDeclaration inside of a 536 // FIXME: get rid of this weirdness of a CSSStyleDeclaration inside of a
537 // style property set. 537 // style property set.
538 if (m_cssomWrapper) { 538 if (m_cssomWrapper) {
539 ASSERT(!static_cast<CSSStyleDeclaration*>(m_cssomWrapper.get())->parentR ule()); 539 ASSERT(!static_cast<CSSStyleDeclaration*>(m_cssomWrapper.get())->parentR ule());
540 ASSERT(!m_cssomWrapper->parentElement()); 540 ASSERT(!m_cssomWrapper->parentElement());
541 return m_cssomWrapper.get(); 541 return m_cssomWrapper.get();
542 } 542 }
543 m_cssomWrapper = adoptPtrWillBeNoop(new PropertySetCSSStyleDeclaration(*this )); 543 m_cssomWrapper = adoptPtr(new PropertySetCSSStyleDeclaration(*this));
544 return m_cssomWrapper.get(); 544 return m_cssomWrapper.get();
545 } 545 }
546 546
547 int MutableStylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const 547 int MutableStylePropertySet::findPropertyIndex(CSSPropertyID propertyID) const
548 { 548 {
549 // Convert here propertyID into an uint16_t to compare it with the metadata' s m_propertyID to avoid 549 // Convert here propertyID into an uint16_t to compare it with the metadata' s m_propertyID to avoid
550 // the compiler converting it to an int multiple times in the loop. 550 // the compiler converting it to an int multiple times in the loop.
551 uint16_t id = static_cast<uint16_t>(propertyID); 551 uint16_t id = static_cast<uint16_t>(propertyID);
552 for (int n = m_propertyVector.size() - 1 ; n >= 0; --n) { 552 for (int n = m_propertyVector.size() - 1 ; n >= 0; --n) {
553 if (m_propertyVector.at(n).metadata().m_propertyID == id) { 553 if (m_propertyVector.at(n).metadata().m_propertyID == id) {
554 // Only enabled or internal properties should be part of the style. 554 // Only enabled or internal properties should be part of the style.
555 ASSERT(RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID) || isInte rnalProperty(propertyID)); 555 ASSERT(RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID) || isInte rnalProperty(propertyID));
556 return n; 556 return n;
557 } 557 }
558 } 558 }
559 559
560 return -1; 560 return -1;
561 } 561 }
562 562
563 void MutableStylePropertySet::traceAfterDispatch(Visitor* visitor) 563 void MutableStylePropertySet::traceAfterDispatch(Visitor* visitor)
564 { 564 {
565 visitor->trace(m_cssomWrapper);
566 visitor->trace(m_propertyVector); 565 visitor->trace(m_propertyVector);
567 StylePropertySet::traceAfterDispatch(visitor); 566 StylePropertySet::traceAfterDispatch(visitor);
568 } 567 }
569 568
570 unsigned StylePropertySet::averageSizeInBytes() 569 unsigned StylePropertySet::averageSizeInBytes()
571 { 570 {
572 // Please update this if the storage scheme changes so that this longer refl ects the actual size. 571 // Please update this if the storage scheme changes so that this longer refl ects the actual size.
573 return sizeForImmutableStylePropertySetWithPropertyCount(4); 572 return sizeForImmutableStylePropertySetWithPropertyCount(4);
574 } 573 }
575 574
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 result.appendLiteral(": "); 607 result.appendLiteral(": ");
609 result.append(propertyValue()->cssText()); 608 result.append(propertyValue()->cssText());
610 if (isImportant()) 609 if (isImportant())
611 result.appendLiteral(" !important"); 610 result.appendLiteral(" !important");
612 result.append(';'); 611 result.append(';');
613 return result.toString(); 612 return result.toString();
614 } 613 }
615 614
616 615
617 } // namespace WebCore 616 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySet.h ('k') | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698