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

#include "process_context.h"

Public Member Functions

js_tokenizer_patterns () const

Detailed Description

This class encapsulates the initialization and cleanup of static and global variables across Pagespeed Automatic. The usage of this class is optional, but can help with cleaning up valgrind messages.

It is up to the user to ensure the destructor is called at an appropriate time in their flow. There is no statically constructed object declared in, although this class can be instantiated statically if that's the best mechanism in the environment.

Member Function Documentation

const pagespeed::js::JsTokenizerPatterns* net_instaweb::ProcessContext::js_tokenizer_patterns ( ) const

Returns a js_tokenizer_patterns object that was allocated by the ProcessContext constructor, once per process startup. The reason to manage this object this way, as opposed to constructing it from the factory, is to speed up tests, where factories are constructed and destroyed for every test method. JsTokenizerPatterns requires compiles multiple regular expressions on construction, and this takes a significant amount of time in debug builds.

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