Page Speed Optimization Libraries
1.9.32.2
|
#include "mobilize_label_filter.h"
Public Types | |
enum | LabelingMode { kDoNotLabel = 0, kUseTagNames = 1, kUseClassifier = 2, kUseTagNamesAndClassifier = 3 } |
Public Member Functions | |
MobilizeLabelFilter (RewriteDriver *driver) | |
virtual const char * | Name () const |
virtual void | StartDocumentImpl () |
virtual void | StartElementImpl (HtmlElement *element) |
virtual void | EndElementImpl (HtmlElement *element) |
virtual void | Characters (HtmlCharactersNode *characters) |
virtual void | EndDocument () |
void | set_labeling_mode (LabelingMode m) |
LabelingMode | labeling_mode () const |
![]() | |
CommonFilter (RewriteDriver *driver) | |
const GoogleUrl & | base_url () const |
Getters. More... | |
const GoogleUrl & | decoded_base_url () const |
RewriteDriver * | driver () const |
HtmlElement * | noscript_element () const |
void | InsertNodeAtBodyEnd (HtmlNode *data) |
virtual void | StartDocument () |
Note: Don't overload these methods, overload the implementers instead! | |
virtual void | StartElement (HtmlElement *element) |
virtual void | EndElement (HtmlElement *element) |
ResourcePtr | CreateInputResource (StringPiece input_url, bool *is_authorized) |
ResourcePtr | CreateInputResourceOrInsertDebugComment (StringPiece input_url, HtmlElement *element) |
void | ResolveUrl (StringPiece input_url, GoogleUrl *out_url) |
bool | BaseUrlIsValid () const |
bool | DebugMode () const |
bool | CanAddPagespeedOnloadToImage (const HtmlElement &) |
virtual void | LogFilterModifiedContent () |
virtual RewriteDriver::InlineAuthorizationPolicy | AllowUnauthorizedDomain () const |
virtual bool | IntendedForInlining () const |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
![]() | |
static bool | ExtractMetaTagDetails (const HtmlElement &element, const ResponseHeaders *headers, GoogleString *content, GoogleString *mime_type, GoogleString *charset) |
Static Public Attributes | |
static const char | kPagesLabeled [] |
Monitoring variable names. More... | |
static const char | kPagesRoleAdded [] |
static const char | kNavigationalRoles [] |
static const char | kHeaderRoles [] |
static const char | kContentRoles [] |
static const char | kMarginalRoles [] |
static const char | kDivsUnlabeled [] |
static const char | kAmbiguousRoleLabels [] |
![]() | |
static const char | kCreateResourceFailedDebugMsg [] |
Debug message to be inserted when resource creation fails. | |
Additional Inherited Members | |
![]() | |
ServerContext * | server_context () const |
const RewriteOptions * | rewrite_options () |
virtual const char * | LoggingId () |
Classify DOM elements by adding importance= attributes so that the MoblizeRewriteFilter can rewrite them to be mobile-friendly. The classes are: Navigational: things like nav and menu bars, mostly in the header Header: Page title, title image, logo associated with page, etc. Content: The content we think the user wants to see. Marginal: Other stuff on the page that typically resides in the margins, header, or footer. Initially we just attempt Navigational and Header classification.
TODO(jmaessen): do the rest of the classification. We do this bottom-up, since we want to process children in a streaming fashion before their parent's close tag. We take the presence of html5 tags as authoritative (though in practice this might not be the case), but we've assumed that they're authoritative in training our classifiers.
TODO(jmaessen): use actual classifier output.
|
virtual |
If a subclass overloads this function and wishes to use InsertNodeAtBodyEnd(), it needs to make an upcall to this implementation for InsertNodeAtBodyEnd() to work correctly.
Reimplemented from net_instaweb::CommonFilter.
|
inline |
Set labeling mode to use during traversal. Intended for testing and debugging.
|
virtual |
Overload these implementer methods: Intentionally left abstract so that implementers don't forget to change the name from Blah to BlahImpl.
Implements net_instaweb::CommonFilter.
|
static |
Monitoring variable names.
Pages run through labeler.