Page Speed Optimization Libraries  1.12.34.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
net_instaweb::LoggingFilter Class Reference

Counts some basic statistics observed as HTML is parsed. More...

#include "logging_html_filter.h"

Inheritance diagram for net_instaweb::LoggingFilter:
net_instaweb::EmptyHtmlFilter net_instaweb::HtmlFilter

Public Types

enum  Statistic {
  MIN_STAT = 0, NUM_EXPLICIT_CLOSED = 0, NUM_IMPLICIT_CLOSED, NUM_BRIEF_CLOSED,
  NUM_CLOSED, NUM_UNCLOSED, NUM_SPURIOUS_CLOSED, NUM_TAGS,
  NUM_CDATA, NUM_COMMENTS, NUM_DIRECTIVES, NUM_DOCUMENTS,
  NUM_IE_DIRECTIVES, MAX_STAT
}
 
- Public Types inherited from net_instaweb::HtmlFilter
enum  ScriptUsage { kWillInjectScripts, kMayInjectScripts, kNeverInjectsScripts }
 Describes a filter's relationship with scripts. More...
 

Public Member Functions

virtual void StartDocument ()
 HtmlFilter methods.
 
virtual void StartElement (HtmlElement *element)
 
virtual void EndElement (HtmlElement *element)
 
virtual void Cdata (HtmlCdataNode *cdata)
 Called for CDATA blocks (e.g. <![CDATA[foobar]]>)
 
virtual void Comment (HtmlCommentNode *comment)
 Called for HTML comments that aren't IE directives (e.g. ).
 
virtual void IEDirective (HtmlIEDirectiveNode *directive)
 
virtual void Directive (HtmlDirectiveNode *directive)
 Called for HTML directives (e.g. <!doctype foobar>).
 
virtual const char * Name () const
 The name of this filter – used for logging and debugging.
 
int get (const Statistic statistic) const
 Getter for individual statistics; NO BOUNDS CHECKS.
 
void LogStatistics (StatisticsLog *statistics_log) const
 Logging, diffing, and aggregation. More...
 
void Reset ()
 
- Public Member Functions inherited from net_instaweb::EmptyHtmlFilter
virtual void EndDocument ()
 
virtual void Characters (HtmlCharactersNode *characters)
 Called for raw characters between tags.
 
virtual void Flush ()
 
virtual void DetermineEnabled (GoogleString *disabled_reason)
 
virtual bool CanModifyUrls ()
 
ScriptUsage GetScriptUsage () const override
 
- Public Member Functions inherited from net_instaweb::HtmlFilter
virtual void RenderDone ()
 
bool is_enabled () const
 
void set_is_enabled (bool is_enabled)
 

Detailed Description

Counts some basic statistics observed as HTML is parsed.

Member Enumeration Documentation

internal names of statistics. NOTE: must match string names in kStatisticNames at top of logging_html_filter.c

Member Function Documentation

virtual void net_instaweb::LoggingFilter::IEDirective ( HtmlIEDirectiveNode directive)
virtual

Called for an IE directive; typically used for CSS styling. See http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx

Todo:
TODO(mdsteele): Should we try to maintain the nested structure of the conditionals, in the same way that we maintain nesting of elements?

Reimplemented from net_instaweb::EmptyHtmlFilter.

void net_instaweb::LoggingFilter::LogStatistics ( StatisticsLog statistics_log) const

Logging, diffing, and aggregation.

Report all statistics

virtual void net_instaweb::LoggingFilter::StartElement ( HtmlElement element)
virtual

When an HTML element is encountered during parsing, each filter's StartElement method is called. The HtmlElement lives for the entire duration of the document.

Todo:
TODO(jmarantz): consider passing handles rather than pointers and reference-counting them instead to save memory on long documents.

Reimplemented from net_instaweb::EmptyHtmlFilter.


The documentation for this class was generated from the following file: