| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/Node.h" | 31 #include "core/dom/Node.h" |
| 32 #include "core/dom/StyleEngine.h" | 32 #include "core/dom/StyleEngine.h" |
| 33 #include "core/fetch/CSSStyleSheetResource.h" | 33 #include "core/fetch/CSSStyleSheetResource.h" |
| 34 #include "core/frame/UseCounter.h" | 34 #include "core/frame/UseCounter.h" |
| 35 #include "platform/TraceEvent.h" | 35 #include "platform/TraceEvent.h" |
| 36 #include "platform/weborigin/SecurityOrigin.h" | 36 #include "platform/weborigin/SecurityOrigin.h" |
| 37 #include "wtf/Deque.h" | 37 #include "wtf/Deque.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 DEFINE_GC_INFO(StyleSheetContents); | |
| 42 | |
| 43 // Rough size estimate for the memory cache. | 41 // Rough size estimate for the memory cache. |
| 44 unsigned StyleSheetContents::estimatedSizeInBytes() const | 42 unsigned StyleSheetContents::estimatedSizeInBytes() const |
| 45 { | 43 { |
| 46 // Note that this does not take into account size of the strings hanging fro
m various objects. | 44 // Note that this does not take into account size of the strings hanging fro
m various objects. |
| 47 // The assumption is that nearly all of of them are atomic and would exist a
nyway. | 45 // The assumption is that nearly all of of them are atomic and would exist a
nyway. |
| 48 unsigned size = sizeof(*this); | 46 unsigned size = sizeof(*this); |
| 49 | 47 |
| 50 // FIXME: This ignores the children of media rules. | 48 // FIXME: This ignores the children of media rules. |
| 51 // Most rules are StyleRules. | 49 // Most rules are StyleRules. |
| 52 size += ruleCount() * StyleRule::averageSizeInBytes(); | 50 size += ruleCount() * StyleRule::averageSizeInBytes(); |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 findFontFaceRulesFromRules(childRules(), fontFaceRules); | 613 findFontFaceRulesFromRules(childRules(), fontFaceRules); |
| 616 } | 614 } |
| 617 | 615 |
| 618 void StyleSheetContents::trace(Visitor* visitor) | 616 void StyleSheetContents::trace(Visitor* visitor) |
| 619 { | 617 { |
| 620 visitor->trace(m_importRules); | 618 visitor->trace(m_importRules); |
| 621 visitor->trace(m_childRules); | 619 visitor->trace(m_childRules); |
| 622 } | 620 } |
| 623 | 621 |
| 624 } | 622 } |
| OLD | NEW |