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

Unified Diff: Source/core/css/resolver/StyleResolverStats.h

Issue 34623009: Revamp style resolver stats (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix stats for mac, crazy StyleResolver constructor side effects Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverStats.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverStats.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698