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

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

Issue 1317143005: [WIP] do something :-) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/StyleRule.cpp » ('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 13 matching lines...) Expand all
24 #include "core/css/StylePropertySet.h" 24 #include "core/css/StylePropertySet.h"
25 25
26 #include "core/StylePropertyShorthand.h" 26 #include "core/StylePropertyShorthand.h"
27 #include "core/css/CSSPropertyMetadata.h" 27 #include "core/css/CSSPropertyMetadata.h"
28 #include "core/css/CSSValuePool.h" 28 #include "core/css/CSSValuePool.h"
29 #include "core/css/StylePropertySerializer.h" 29 #include "core/css/StylePropertySerializer.h"
30 #include "core/css/StyleSheetContents.h" 30 #include "core/css/StyleSheetContents.h"
31 #include "core/css/parser/CSSParser.h" 31 #include "core/css/parser/CSSParser.h"
32 #include "core/frame/UseCounter.h" 32 #include "core/frame/UseCounter.h"
33 #include "platform/RuntimeEnabledFeatures.h" 33 #include "platform/RuntimeEnabledFeatures.h"
34 #include "wtf/SizeAssertions.h"
34 #include "wtf/text/StringBuilder.h" 35 #include "wtf/text/StringBuilder.h"
35 36
36 #ifndef NDEBUG 37 #ifndef NDEBUG
37 #include "wtf/text/CString.h" 38 #include "wtf/text/CString.h"
38 #include <stdio.h> 39 #include <stdio.h>
39 #endif 40 #endif
40 41
41 namespace blink { 42 namespace blink {
42 43
43 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count) 44 static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count)
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 StylePropertySet::traceAfterDispatch(visitor); 490 StylePropertySet::traceAfterDispatch(visitor);
490 } 491 }
491 492
492 unsigned StylePropertySet::averageSizeInBytes() 493 unsigned StylePropertySet::averageSizeInBytes()
493 { 494 {
494 // Please update this if the storage scheme changes so that this longer refl ects the actual size. 495 // Please update this if the storage scheme changes so that this longer refl ects the actual size.
495 return sizeForImmutableStylePropertySetWithPropertyCount(4); 496 return sizeForImmutableStylePropertySetWithPropertyCount(4);
496 } 497 }
497 498
498 // See the function above if you need to update this. 499 // See the function above if you need to update this.
499 struct SameSizeAsStylePropertySet : public RefCountedWillBeGarbageCollectedFinal ized<SameSizeAsStylePropertySet> { 500 ASSERT_SIZE(StylePropertySet, 8, 8);
500 unsigned bitfield;
501 };
502 static_assert(sizeof(StylePropertySet) == sizeof(SameSizeAsStylePropertySet), "S tylePropertySet should stay small");
503 501
504 #ifndef NDEBUG 502 #ifndef NDEBUG
505 void StylePropertySet::showStyle() 503 void StylePropertySet::showStyle()
506 { 504 {
507 fprintf(stderr, "%s\n", asText().ascii().data()); 505 fprintf(stderr, "%s\n", asText().ascii().data());
508 } 506 }
509 #endif 507 #endif
510 508
511 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( CSSParserMode cssParserMode) 509 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( CSSParserMode cssParserMode)
512 { 510 {
513 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode)); 511 return adoptRefWillBeNoop(new MutableStylePropertySet(cssParserMode));
514 } 512 }
515 513
516 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( const CSSProperty* properties, unsigned count) 514 PassRefPtrWillBeRawPtr<MutableStylePropertySet> MutableStylePropertySet::create( const CSSProperty* properties, unsigned count)
517 { 515 {
518 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count)); 516 return adoptRefWillBeNoop(new MutableStylePropertySet(properties, count));
519 } 517 }
520 518
521 } // namespace blink 519 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698