Index: Source/core/css/resolver/StyleResolverStats.h |
diff --git a/Source/core/html/ime/Composition.h b/Source/core/css/resolver/StyleResolverStats.h |
similarity index 59% |
copy from Source/core/html/ime/Composition.h |
copy to Source/core/css/resolver/StyleResolverStats.h |
index 43054668f0d17b4911e7af24a0db6f0606a7e868..084c02d588bd699e7c7b9fb3ec4e0d167c7800f9 100644 |
--- a/Source/core/html/ime/Composition.h |
+++ b/Source/core/css/resolver/StyleResolverStats.h |
@@ -28,36 +28,50 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef Composition_h |
-#define Composition_h |
+#ifndef StyleResolverStats_h |
+#define StyleResolverStats_h |
-#include "bindings/v8/ScriptWrappable.h" |
#include "wtf/PassOwnPtr.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-class InputMethodContext; |
- |
-class Composition : public ScriptWrappable { |
+class StyleResolverStats { |
public: |
- static PassOwnPtr<Composition> create(InputMethodContext*); |
- ~Composition(); |
+ static PassOwnPtr<StyleResolverStats> create() |
+ { |
+ return adoptPtr(new StyleResolverStats); |
+ } |
- void ref(); |
- void deref(); |
+ void reset(); |
+ String report() const; |
- String text() const; |
- int selectionStart() const; |
- int selectionEnd() const; |
- const Vector<unsigned>& getSegments() const; |
+ unsigned sharedStyleLookups; |
+ unsigned sharedStyleCandidates; |
+ unsigned sharedStyleFound; |
+ unsigned sharedStyleMissed; |
+ unsigned sharedStyleRejectedByUncommonAttributeRules; |
+ unsigned sharedStyleRejectedBySiblingRules; |
+ unsigned sharedStyleRejectedByParent; |
+ unsigned matchedPropertyApply; |
+ unsigned matchedPropertyCacheHit; |
+ unsigned matchedPropertyCacheInheritedHit; |
+ unsigned matchedPropertyCacheAdded; |
-private: |
- explicit Composition(InputMethodContext*); |
+ // We keep a separate flag for this since crawling the entire document to print |
+ // the number of missed candidates is very slow. |
+ bool printMissedCandidateCount; |
- InputMethodContext* m_inputMethodContext; |
+private: |
+ StyleResolverStats() |
+ : printMissedCandidateCount(false) |
+ { |
+ reset(); |
+ } |
}; |
+#define INCREMENT_STYLE_STATS_COUNTER(resolver, counter) ((resolver).stats() && ++(resolver).stats()-> counter && (resolver).statsTotals()-> counter ++); |
+ |
} // namespace WebCore |
-#endif // Composition_h |
+#endif // StyleResolverStats_h |