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

Side by Side Diff: Source/core/css/StyleResolver.h

Issue 13973026: remove memoryinstrumentation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove the rest part of MemoryInstrumentation Created 7 years, 8 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.cpp ('k') | Source/core/css/StyleResolver.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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 class WebKitCSSSVGDocumentValue; 111 class WebKitCSSSVGDocumentValue;
112 112
113 class MediaQueryResult { 113 class MediaQueryResult {
114 WTF_MAKE_NONCOPYABLE(MediaQueryResult); WTF_MAKE_FAST_ALLOCATED; 114 WTF_MAKE_NONCOPYABLE(MediaQueryResult); WTF_MAKE_FAST_ALLOCATED;
115 public: 115 public:
116 MediaQueryResult(const MediaQueryExp& expr, bool result) 116 MediaQueryResult(const MediaQueryExp& expr, bool result)
117 : m_expression(expr) 117 : m_expression(expr)
118 , m_result(result) 118 , m_result(result)
119 { 119 {
120 } 120 }
121 void reportMemoryUsage(MemoryObjectInfo*) const;
122 121
123 MediaQueryExp m_expression; 122 MediaQueryExp m_expression;
124 bool m_result; 123 bool m_result;
125 }; 124 };
126 125
127 enum StyleSharingBehavior { 126 enum StyleSharingBehavior {
128 AllowStyleSharing, 127 AllowStyleSharing,
129 DisallowStyleSharing, 128 DisallowStyleSharing,
130 }; 129 };
131 130
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 int firstUserRule; 326 int firstUserRule;
328 int lastUserRule; 327 int lastUserRule;
329 RuleRange UARuleRange() { return RuleRange(firstUARule, lastUARule); } 328 RuleRange UARuleRange() { return RuleRange(firstUARule, lastUARule); }
330 RuleRange authorRuleRange() { return RuleRange(firstAuthorRule, lastAuth orRule); } 329 RuleRange authorRuleRange() { return RuleRange(firstAuthorRule, lastAuth orRule); }
331 RuleRange userRuleRange() { return RuleRange(firstUserRule, lastUserRule ); } 330 RuleRange userRuleRange() { return RuleRange(firstUserRule, lastUserRule ); }
332 }; 331 };
333 332
334 struct MatchedProperties { 333 struct MatchedProperties {
335 MatchedProperties(); 334 MatchedProperties();
336 ~MatchedProperties(); 335 ~MatchedProperties();
337 void reportMemoryUsage(MemoryObjectInfo*) const;
338 336
339 RefPtr<StylePropertySet> properties; 337 RefPtr<StylePropertySet> properties;
340 union { 338 union {
341 struct { 339 struct {
342 unsigned linkMatchType : 2; 340 unsigned linkMatchType : 2;
343 unsigned whitelistType : 2; 341 unsigned whitelistType : 2;
344 }; 342 };
345 // Used to make sure all memory is zero-initialized since we compute the hash over the bytes of this object. 343 // Used to make sure all memory is zero-initialized since we compute the hash over the bytes of this object.
346 void* possiblyPaddedMember; 344 void* possiblyPaddedMember;
347 }; 345 };
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 530
533 CSSToStyleMap* styleMap() { return &m_styleMap; } 531 CSSToStyleMap* styleMap() { return &m_styleMap; }
534 InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWr appers; } 532 InspectorCSSOMWrappers& inspectorCSSOMWrappers() { return m_inspectorCSSOMWr appers; }
535 const FontDescription& fontDescription() { return m_state.fontDescription(); } 533 const FontDescription& fontDescription() { return m_state.fontDescription(); }
536 const FontDescription& parentFontDescription() { return m_state.parentFontDe scription(); } 534 const FontDescription& parentFontDescription() { return m_state.parentFontDe scription(); }
537 void setFontDescription(const FontDescription& fontDescription) { m_state.se tFontDescription(fontDescription); } 535 void setFontDescription(const FontDescription& fontDescription) { m_state.se tFontDescription(fontDescription); }
538 void setZoom(float f) { m_state.setZoom(f); } 536 void setZoom(float f) { m_state.setZoom(f); }
539 void setEffectiveZoom(float f) { m_state.setEffectiveZoom(f); } 537 void setEffectiveZoom(float f) { m_state.setEffectiveZoom(f); }
540 void setWritingMode(WritingMode writingMode) { m_state.setWritingMode(writin gMode); } 538 void setWritingMode(WritingMode writingMode) { m_state.setWritingMode(writin gMode); }
541 void setTextOrientation(TextOrientation textOrientation) { m_state.setTextOr ientation(textOrientation); } 539 void setTextOrientation(TextOrientation textOrientation) { m_state.setTextOr ientation(textOrientation); }
542 540
543 void reportMemoryUsage(MemoryObjectInfo*) const;
544
545 private: 541 private:
546 static RenderStyle* s_styleNotYetAvailable; 542 static RenderStyle* s_styleNotYetAvailable;
547 543
548 void cacheBorderAndBackground(); 544 void cacheBorderAndBackground();
549 545
550 private: 546 private:
551 bool canShareStyleWithControl(StyledElement*) const; 547 bool canShareStyleWithControl(StyledElement*) const;
552 548
553 void applyProperty(CSSPropertyID, CSSValue*); 549 void applyProperty(CSSPropertyID, CSSValue*);
554 550
555 #if ENABLE(SVG) 551 #if ENABLE(SVG)
556 void applySVGProperty(CSSPropertyID, CSSValue*); 552 void applySVGProperty(CSSPropertyID, CSSValue*);
557 #endif 553 #endif
558 554
559 PassRefPtr<StyleImage> loadPendingImage(StylePendingImage*); 555 PassRefPtr<StyleImage> loadPendingImage(StylePendingImage*);
560 void loadPendingImages(); 556 void loadPendingImages();
561 557
562 static unsigned computeMatchedPropertiesHash(const MatchedProperties*, unsig ned size); 558 static unsigned computeMatchedPropertiesHash(const MatchedProperties*, unsig ned size);
563 struct MatchedPropertiesCacheItem { 559 struct MatchedPropertiesCacheItem {
564 void reportMemoryUsage(MemoryObjectInfo*) const;
565 Vector<MatchedProperties> matchedProperties; 560 Vector<MatchedProperties> matchedProperties;
566 MatchRanges ranges; 561 MatchRanges ranges;
567 RefPtr<RenderStyle> renderStyle; 562 RefPtr<RenderStyle> renderStyle;
568 RefPtr<RenderStyle> parentRenderStyle; 563 RefPtr<RenderStyle> parentRenderStyle;
569 }; 564 };
570 const MatchedPropertiesCacheItem* findFromMatchedPropertiesCache(unsigned ha sh, const MatchResult&); 565 const MatchedPropertiesCacheItem* findFromMatchedPropertiesCache(unsigned ha sh, const MatchResult&);
571 void addToMatchedPropertiesCache(const RenderStyle*, const RenderStyle* pare ntStyle, unsigned hash, const MatchResult&); 566 void addToMatchedPropertiesCache(const RenderStyle*, const RenderStyle* pare ntStyle, unsigned hash, const MatchResult&);
572 567
573 // Every N additions to the matched declaration cache trigger a sweep where entries holding 568 // Every N additions to the matched declaration cache trigger a sweep where entries holding
574 // the last reference to a style declaration are garbage collected. 569 // the last reference to a style declaration are garbage collected.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 PseudoId ignoreDynamicPseudo = NOPSEUDO; 640 PseudoId ignoreDynamicPseudo = NOPSEUDO;
646 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches) 641 if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
647 return true; 642 return true;
648 } 643 }
649 return false; 644 return false;
650 } 645 }
651 646
652 } // namespace WebCore 647 } // namespace WebCore
653 648
654 #endif // StyleResolver_h 649 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySet.cpp ('k') | Source/core/css/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698