| 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 25 matching lines...) Expand all Loading... |
| 36 #include "wtf/PtrUtil.h" | 36 #include "wtf/PtrUtil.h" |
| 37 #include <memory> | 37 #include <memory> |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class StyleResolverStats { | 41 class StyleResolverStats { |
| 42 USING_FAST_MALLOC(StyleResolverStats); | 42 USING_FAST_MALLOC(StyleResolverStats); |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 static std::unique_ptr<StyleResolverStats> create() { | 45 static std::unique_ptr<StyleResolverStats> create() { |
| 46 return wrapUnique(new StyleResolverStats); | 46 return WTF::wrapUnique(new StyleResolverStats); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void reset(); | 49 void reset(); |
| 50 bool allCountersEnabled() const; | 50 bool allCountersEnabled() const; |
| 51 std::unique_ptr<TracedValue> toTracedValue() const; | 51 std::unique_ptr<TracedValue> toTracedValue() const; |
| 52 | 52 |
| 53 unsigned sharedStyleLookups; | 53 unsigned sharedStyleLookups; |
| 54 unsigned sharedStyleCandidates; | 54 unsigned sharedStyleCandidates; |
| 55 unsigned sharedStyleFound; | 55 unsigned sharedStyleFound; |
| 56 unsigned sharedStyleMissed; | 56 unsigned sharedStyleMissed; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 private: | 75 private: |
| 76 StyleResolverStats() { reset(); } | 76 StyleResolverStats() { reset(); } |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #define INCREMENT_STYLE_STATS_COUNTER(styleEngine, counter, n) \ | 79 #define INCREMENT_STYLE_STATS_COUNTER(styleEngine, counter, n) \ |
| 80 ((styleEngine).stats() && ((styleEngine).stats()->counter += n)); | 80 ((styleEngine).stats() && ((styleEngine).stats()->counter += n)); |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| 83 | 83 |
| 84 #endif // StyleResolverStats_h | 84 #endif // StyleResolverStats_h |
| OLD | NEW |