Page Speed Optimization Libraries
1.13.35.1
|
#include "process_context.h"
Public Member Functions | |
const pagespeed::js::JsTokenizerPatterns * | js_tokenizer_patterns () const |
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 mem_clean_up.cc, although this class can be instantiated statically if that's the best mechanism in the environment.
|
inline |
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.