| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef StyleResolverStats_h | 31 #ifndef StyleResolverStats_h |
| 32 #define StyleResolverStats_h | 32 #define StyleResolverStats_h |
| 33 | 33 |
| 34 #include "platform/TraceEvent.h" | 34 #include "platform/TraceEvent.h" |
| 35 #include "platform/TracedValue.h" | 35 #include "platform/TracedValue.h" |
| 36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PtrUtil.h" |
| 37 #include <memory> |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class StyleResolverStats { | 41 class StyleResolverStats { |
| 41 USING_FAST_MALLOC(StyleResolverStats); | 42 USING_FAST_MALLOC(StyleResolverStats); |
| 42 public: | 43 public: |
| 43 static PassOwnPtr<StyleResolverStats> create() | 44 static std::unique_ptr<StyleResolverStats> create() |
| 44 { | 45 { |
| 45 return adoptPtr(new StyleResolverStats); | 46 return wrapUnique(new StyleResolverStats); |
| 46 } | 47 } |
| 47 | 48 |
| 48 void reset(); | 49 void reset(); |
| 49 bool allCountersEnabled() const; | 50 bool allCountersEnabled() const; |
| 50 PassOwnPtr<TracedValue> toTracedValue() const; | 51 std::unique_ptr<TracedValue> toTracedValue() const; |
| 51 | 52 |
| 52 unsigned sharedStyleLookups; | 53 unsigned sharedStyleLookups; |
| 53 unsigned sharedStyleCandidates; | 54 unsigned sharedStyleCandidates; |
| 54 unsigned sharedStyleFound; | 55 unsigned sharedStyleFound; |
| 55 unsigned sharedStyleMissed; | 56 unsigned sharedStyleMissed; |
| 56 unsigned sharedStyleRejectedByUncommonAttributeRules; | 57 unsigned sharedStyleRejectedByUncommonAttributeRules; |
| 57 unsigned sharedStyleRejectedBySiblingRules; | 58 unsigned sharedStyleRejectedBySiblingRules; |
| 58 unsigned sharedStyleRejectedByParent; | 59 unsigned sharedStyleRejectedByParent; |
| 59 unsigned matchedPropertyApply; | 60 unsigned matchedPropertyApply; |
| 60 unsigned matchedPropertyCacheHit; | 61 unsigned matchedPropertyCacheHit; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 75 { | 76 { |
| 76 reset(); | 77 reset(); |
| 77 } | 78 } |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 #define INCREMENT_STYLE_STATS_COUNTER(styleEngine, counter, n) ((styleEngine).st
ats() && ((styleEngine).stats()-> counter += n)); | 81 #define INCREMENT_STYLE_STATS_COUNTER(styleEngine, counter, n) ((styleEngine).st
ats() && ((styleEngine).stats()-> counter += n)); |
| 81 | 82 |
| 82 } // namespace blink | 83 } // namespace blink |
| 83 | 84 |
| 84 #endif // StyleResolverStats_h | 85 #endif // StyleResolverStats_h |
| OLD | NEW |