Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Todo List
File critical_css_filter.h
TODO(slamm): Consider prioritizing the rules in inline style blocks too.
Namespace net_instaweb

TODO(sligocki): Find a way to forward declare FileSystem::InputFile.

TODO(skerner): #include image_spriter.pb.h is needed to allow use of enum ImageFormat. Break this dependency and remove the include.

TODO(huibao): Move LibpngImageLibrary to pagespeed/kernel/image/. Refactor LibpngImageLibrary. This class can be split into 3 parts: reader, writer, and canvas creater. The first two parts can be merged with png_optimizer.cc and png_optimizer.h.

Member net_instaweb::AdminSite::GraphsHandler (const RewriteOptions &options, AdminSource source, const QueryParams &query_params, AsyncFetch *fetch, Statistics *stats)
TODO(xqyin): Integrate this into console page.
Member net_instaweb::ApacheFetch::set_handle_error (bool x)
TODO(jmarantz): consider allowing serf fetches in ipro when running as a reverse-proxy.
Member net_instaweb::AssociationSlot::LocationString ()
TODO(sligocki): Improve quality of this diagnostic. Also improve CssResourceSlot::LocationString() which is identical.
Member net_instaweb::AsyncFetch::IsCachedResultValid (const ResponseHeaders &headers)
TODO(nikhilmadan): Consider making this virtual so that subclass authors are forced to look at this function.
Member net_instaweb::AsyncFetch::Reset ()
TODO(jmarantz): should this also clear the response headers?
Class net_instaweb::BeaconCriticalLineInfoFinder

TODO(jud): Currently, this implementation just looks at the support value for an individual node to decide if it is below-the-fold or not. It should also combine the support values of a node's parent elements to decide if it's critical. The impact of missing this feature is that some nodes on or near the fold may not be properly considered at BTF, depending on the layout of the page. For example, consider if there is div[1] with a child node div[1]/span[a]. These nodes are close to the fold - clients with a larger screen consider just span[a] below-the-fold, while clients with smaller screens have both div[1] and span[a] below-the-fold. Both screen sizes however have span[a] as below-the-fold. The current implementation won't consider either node to be below-the-fold, since neither will receive enough support. When this

TODO is fixed though, span[a] will be considered below-the-fold, since the support value for div[1] will be added to the support value for span[a].

Class net_instaweb::CacheExtender
TODO(jmarantz): rename this class to something more generic, like RenameUrlFilter or ProxyUrlFilter.
Class net_instaweb::CacheHtmlFilter
TODO(mmohabey): Integrate with SplitFilter and send non critical JSON too.
Class net_instaweb::CacheUrlAsyncFetcher
TODO(sligocki): In order to use this for fetching resources for rewriting we'd need to integrate resource locking in this class. Do we want that?
Member net_instaweb::CountingUrlAsyncFetcher::CountingUrlAsyncFetcher (UrlAsyncFetcher *fetcher)
TODO(hujie): We should pass in the mutex at all call-sites instead of creating a new mutex here.
Member net_instaweb::CriticalImagesFinder::cohort () const
TODO(jud): Make this protected. There is a lingering public usage in critical_images_beacon_filter.cc.
Member net_instaweb::CriticalImagesFinder::IsHtmlCriticalImage (StringPiece image_url, RewriteDriver *driver)
TODO(jud): It would be simpler to modify these interfaces to take HtmlElement* instead of GoogleStrings. This would move some complexity in getting the correct URL from the caller into this function. For instance, if an image has been modified by LazyloadImages then the actual src we want to check is in the pagespeed_lazyload_src attribute, not in src.
Class net_instaweb::CriticalImagesInfo
TODO(jud): Instead of a separate CriticalImagesInfo that gets populated from the CriticalImages protobuf value, we could just store the protobuf value in RewriteDriver and eliminate CriticalImagesInfo. Revisit this when updating this class to support multiple beacon responses.
Namespace net_instaweb::css_util
TODO(nforman): remove this namespace and put everything into the StyleExtractor class.
Member net_instaweb::CssFilter::CssFilter (RewriteDriver *driver, CacheExtender *cache_extender, ImageRewriteFilter *image_rewriter, ImageCombineFilter *image_combiner)
TODO(sligocki): Temporary pattern until we figure out a better way to do this without passing all filters around everywhere.
Member net_instaweb::CssHierarchy::CheckCharsetOk (const ResourcePtr &resource, GoogleString *failure_reason)
TODO(matterbury): A potential future enhancement is to allow 'compatible' charsets, like a US-ASCII child in a UTF-8 parent, since US-ASCII is a subset of UTF-8.
Class net_instaweb::CssMinify
TODO(nikhilmadan): Move to pagespeed/kernel/css/.
Member net_instaweb::CssRewriteTestBase::kNoClearFetcher
TODO(sligocki): Why would we ever want to clear fetcher?
Member net_instaweb::CssRewriteTestBase::kNoOtherContexts
TODO(sligocki): Explain why we turn off other contexts.
Member net_instaweb::CssRewriteTestBase::kNoStatCheck
TODO(sligocki): Explain why we turn off stats check at each use-site.
Member net_instaweb::DecisionTree::Predict (std::vector< double > const &sample) const
TODO(stevensr): The ordering of measurements in the sample will become more concrete when the feature measurement logic is committed.
Class net_instaweb::DecodeRewrittenUrlsFilter
TODO(sriharis): Also do this for URLs in CSS.
Member net_instaweb::DomainLawyer::set_proxy_suffix (const GoogleString &suffix)
TODO(jmarantz): In the future we will likely want to map absolutely referenced resources to from the origin domain to .suffix.net so we can optimize them. This can be implemented by integrating the proxy_suffix into MapRewriteDomain and MapOriginDomain, as a variation on MapProxyDomain.
Member net_instaweb::DownstreamCachingDirectives::SupportsImageInlining () const
TODO(anupama): Go through all DeviceProperties/RequestProperties methods and re-evaluate which of them need to be supported here.
Member net_instaweb::DownstreamCachingDirectives::SupportsJsDefer () const
TODO(anupama): Incorporate the "allow_mobile" parameter used in DeviceProperties for supportsJsDefer().
Class net_instaweb::ExternalUrlFetcher
TODO(vchudnov): Incorporate NetcatUrlFetcher functionality into this class.
Member net_instaweb::ExternalUrlFetcher::Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
TODO(sligocki): Allow protocol version number (e.g. HTTP/1.1) and request type (e.g. GET, POST, etc.) to be specified.
Member net_instaweb::FileLoadPolicy::ShouldLoadFromFile (const GoogleUrl &url, GoogleString *filename) const
TODO(sligocki): Set up a more efficient mapper.
Class net_instaweb::FileRewriter
TODO(jmarantz): fill out enough functionality so that this will be a functional static rewriter that could optimize an HTML file passed as a command-line parameter or via stdin.
Class net_instaweb::HandleNoscriptRedirectFilter
TODO(sriharis): Set a cookie so that subsequent requests from the same client do not cause redirects.
Class net_instaweb::HTTPCache::Callback
TODO(jmarantz): consider inheriting from AsyncFetch with an implementation of Write/Flush/HeadersComplete – we'd have to make Done take true/false so this would impact callers.
Member net_instaweb::HTTPCache::Callback::http_value ()
TODO(jmarantz): specify the dataflow between http_value and response_headers.
Member net_instaweb::HTTPCache::Put (const GoogleString &key, const GoogleString &fragment, RequestHeaders::Properties req_properties, ResponseHeaders::VaryOption respect_vary_on_resources, ResponseHeaders *headers, const StringPiece &content, MessageHandler *handler)
TODO(sligocki): Remove this arg and use headers->http_options().
Class net_instaweb::HttpDumpUrlFetcher
TODO(sligocki): Can we forward declare these somehow? class FileSystem; class FileSystem::InputFile;
Member net_instaweb::HttpResponseParser::Parse (FILE *stream)
TODO(sligocki): We need a Readable abstraction (like Writer)
Class net_instaweb::ImageRewriteFilter
TODO(jmaessen): Big open question: how best to link pulled-in resources to rewritten urls, when in general those urls will be in a different domain.
Member net_instaweb::ImageUrlEncoder::SetLibWebpLevel (const RewriteOptions &options, const RequestProperties &request_properties, ResourceContext *resource_context)
TODO(poojatandon): Pass a user agent object with its webp-cabaple bits pre-analyzed (not just the string from the request headers), since checking webp level related code doesn't belong here.
Class net_instaweb::InstawebContext
TODO(sligocki): Factor out similarities between this and ProxyFetch.
Member net_instaweb::InstawebContext::response_headers ()
TODO(jmarantz): needed?
Member net_instaweb::InstawebContext::ServerContextFromServerRec (server_rec *server)
TODO(jmarantz): Is there a better place to put this? It needs to be used by both mod_instaweb.cc and instaweb_handler.cc.
Class net_instaweb::InstawebHandler
TODO(jmarantz): There are many static methods in this class. Some of them need to stay that way as they are used as C entry points. Some are helper methods, and we could adopt a policy of requiring the static methods to instantiate the class (possibly making its constructor lighter weight) and then calling them explicitly. For the time being, we'll leave these static methods with the non-compliant lower_case_names_with_underscores naming convention and fix their naming when we update whether they should be static or not.
Class net_instaweb::JavascriptCodeBlock
TODO(jmaessen): Does this architecture make sense when we have multiple scripts on a page and the ability to move code around a bunch? How do we maintain JS context in that setting?
Member net_instaweb::JavascriptRewriteConfig::use_experimental_minifier () const
TODO(sligocki): Once that minifier has been around for a while, we should deprecate this option.
Class net_instaweb::MobilizeLabelFilter

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.

Class net_instaweb::MobilizeRewriteFilter

TODO (stevensr): This script does not handle flush windows in the body.

TODO (stevensr): It would be nice to tweak the table-xform behavior via options. Also, there has been mention that removing tables across flush windows could be problematic. This should be addressed at some point.

TODO (stevensr): Enable this filter only for mobile UAs, and have a query param option to turn it on for all UAs for debugging.

TODO (stevensr): Write pcache entry if rewriting page fails. We should then probably inject some JS to auto-refresh the page so the user does not see the badly rewritten result.

TODO (stevensr): Add a separate wildcard option to allow/disallow URLs from using this filter. Of course sites can use our existing Allow and Disallow directives but that turns off all optimizations, and this one is one that might be extra finicky (e.g. don't touch my admin pages).

TODO (stevensr): Turn on css_move_to_head_filter.cc to reorder elements we inject into the head.

Member net_instaweb::ModSpdyFetcher::ModSpdyFetchController
TODO(morlovich): Implement virtual void ShutDown(), and give a good story on session fetchers and fetcher shutdowns in general.
Member net_instaweb::NewImage (const StringPiece &original_contents, const GoogleString &url, const StringPiece &file_prefix, Image::CompressionOptions *options, Timer *timer, MessageHandler *handler)
TODO(jmarantz): It would seem natural to fold the ImageOptions into the Image object itself.
Member net_instaweb::OutputResource::OutputResource (const RewriteDriver *driver, StringPiece resolved_base, StringPiece unmapped_base, StringPiece original_base, const ResourceNamer &resource_id, OutputResourceKind kind)
TODO(jmaessen): remove redundancy.
Class net_instaweb::ProxyInterface
TODO(sligocki): Rename as per style-guide.
Member net_instaweb::Resource::CacheExpirationTimeMs () const
TODO(sligocki): Look through callsites and make sure this is being interpreted correctly.
Member net_instaweb::Resource::IsSafeToRewrite (bool rewrite_uncacheable) const
TODO(jmaessen): Convert all remaining call sites to use a reason.
Member net_instaweb::Resource::loaded () const
TODO(sligocki): Do we need these or can we just use IsValidAndCacheable everywhere?
Member net_instaweb::ResourceCombiner::AddResourceNoFetch (const ResourcePtr &resource, MessageHandler *handler)
TODO(jmarantz): rename this to AddResource now that async flow is live.
Member net_instaweb::ResourceCombiner::kUrlSlack
TODO(sligocki): Set this more intelligently.
Class net_instaweb::ResourceFetch
TODO(sligocki): Rename to PagespeedResourceFetch or something else ...
Member net_instaweb::ResourceNamer::set_ext (const StringPiece &e)
TODO(jmaessen): Remove check after transitioning to undotted extensions everywhere.
Class net_instaweb::ResourceSlot
TODO(jmarantz): make this class thread-safe.
Member net_instaweb::ResourceSlot::RelativizeOrPassthrough (const RewriteOptions *options, StringPiece url, UrlRelativity url_relativity, const GoogleUrl &base_url)
TODO(sligocki): Take a GoogleUrl for url?
Member net_instaweb::ResourceSlot::SetResource (const ResourcePtr &resource)
TODO(jmarantz): Add a lock or that we or an overall protocol preventing unwanted interference between renderer's reads and worker writes.
Class net_instaweb::RewriteContext
TODO(jmarantz): add support for controlling TTL on failures.
Member net_instaweb::RewriteContext::encoder () const
TODO(jmarantz): remove the encoder from RewriteFilter.
Member net_instaweb::RewriteContext::Rewrite (int partition_index, CachedResult *partition, const OutputResourcePtr &output)=0
TODO(jmarantz): check for resource completion from a different thread (while we were waiting for resource fetches) when Rewrite gets called.
Member net_instaweb::RewriteContext::UserAgentCacheKey (const ResourceContext *context) const
TODO(morlovich): This seems to overlap with CacheKeySuffix.
Member net_instaweb::RewriteDriver::CreateOutputResourceFromResource (const StringPiece &filter_id, const UrlSegmentEncoder *encoder, const ResourceContext *data, const ResourcePtr &input_resource, OutputResourceKind kind, GoogleString *failure_reason)
TODO(jmaessen, jmarantz): Do we want to permit NULL input_resources here? jmarantz has evinced a distaste.
Member net_instaweb::RewriteDriver::critical_selector_info ()
TODO(jud): Remove when the finders reside in RewriteDriver and manage their own state.
Member net_instaweb::RewriteDriver::DecodeOutputResource (const GoogleUrl &url, RewriteFilter **filter) const
TODO(jmaessen): add url hash & check thereof.
Member net_instaweb::RewriteDriver::response_headers ()
TODO(jmarantz): Change API to require response_headers in StartParse so we can guarantee this is non-null.
Member net_instaweb::RewriteDriver::set_critical_selector_info (CriticalSelectorInfo *info)
TODO(jud): Remove when the finders reside in RewriteDriver and manage their own state.
Member net_instaweb::RewriteDriver::set_externally_managed (bool x)
TODO(jmarantz): Consider phasing this out to make tests behave more like servers.
Member net_instaweb::RewriteDriver::SetOrClearPageSpeedOptionCookies (const GoogleUrl &gurl, ResponseHeaders *response_headers)
TODO(matterbury): Get the URL from 'this' which we can't do now because it isn't set until we've decided that the content of requested URL is HTML. Returns true if any Set-Cookie headers are added, in which case ComputeCaching has been called on response_headers.
Member net_instaweb::RewriteDriver::SetWriter (Writer *writer)
TODO(jmarantz): fix this in the implementation so that the caller can install filters in any order and the writer will always be last.
Member net_instaweb::RewriteDriverFactory::hasher ()
TODO(sligocki): Remove hasher() and force people to make a NewHasher when they need one.
Member net_instaweb::RewriteOptions::cache_invalidation_timestamp () const
TODO(jmarantz): rename to cache_invalidation_timestamp_ms().
Member net_instaweb::RewriteOptions::css_outline_min_bytes () const
TODO(jmarantz): consider setting flags in the set_ methods so that first's explicit settings can override default values from second.
Member net_instaweb::RewriteOptions::DisallowTroublesomeResources ()
TODO(sligocki): Rename to allow for more general initialization.
Member net_instaweb::RewriteOptions::kCacheFlushFilename []
TODO(matterbury): move these to system_rewrite_options.cc?
Member net_instaweb::RewriteOptions::OptionTemplateBase< T >::DoNotUseForSignatureComputation ()
TODO(jmarantz): consider an alternate structure where the Property<T>* can be easily located programmatically rather than going through a dummy Option object.
Member net_instaweb::RewriteOptions::OptionTemplateBase< T >::set_global_default (const T &val)
TODO(jmarantz): consider an alternate structure where the Property<T>* can be easily located programmatically rather than going through a dummy Option object.
Class net_instaweb::RewriteOptions::Properties
TODO(jmarantz): Add static properties – currently there are none.
Member net_instaweb::RewriteOptions::set_default_x_header_value (const StringPiece &x_header_value)
TODO(jmarantz): Remove this method and make another one that operate directly on the Property.
Member net_instaweb::RewriteOptions::SetDefaultRewriteLevel (RewriteLevel level)
TODO(jmarantz): Get rid of this method. The semantics it requires are costly to implement and don't add much value.
Member net_instaweb::RewriteStats::page_load_count ()
TODO(sligocki): Rename to something more clear.
Member net_instaweb::RewriteTestBase::MakeTestFactory ()
TODO(jmarantz): This is currently only used in ServeResourceFromNewContext, but should be used for factory_ and other_factory_. This would requuire a refactor, because those are created at construction; too early for subclass overrides to take effect. To deal with that, an alternate constructor is provided above so that the proper sort of factories can be passed in.
Member net_instaweb::RewriteTestBase::rewrite_driver ()
TODO(jmarantz): These abstractions are not satisfactory long-term where we want to have driver-lifetime in tests be reflective of how servers work. But for now we use these accessors.
Class net_instaweb::SerfUrlAsyncFetcher
TODO(sligocki): Serf does not seem to act appropriately in IPv6 environments, fix and test this. Specifically: (1) It does not attempt to fall-back to IPv4 if IPv6 connection fails; (2) It may not correctly signal failure, which causes the incoming connection to hang.
Member net_instaweb::SerfUrlAsyncFetcher::Poll (int64 max_wait_ms)
TODO(morlovich): Make private once non-thread mode concept removed.
Class net_instaweb::ServerContext
TODO(piatek): This file was renamed from resource_manager.h – there are some associated fixes outstanding –
  1. abc of includes and class declarations.
  2. Rename variables, data members, parameters, etc.
  3. Rename methods.
Member net_instaweb::ServerContext::hasher () const
TODO(jmarantz): check thread safety in Apache.
Member net_instaweb::ServerContext::MergeNonCachingResponseHeaders (const ResourcePtr &input, const OutputResourcePtr &output)
TODO(jmarantz): avoid setting caching_dirty bit in ResponseHeaders when the header is not caching-related.
Member net_instaweb::ServerContext::ReleaseRewriteDriver (RewriteDriver *rewrite_driver)
TODO(jmarantz): this cannot recycle RewriteDrivers with custom rewrite options, which is a potential performance issue for Apache installations that set custom options in .htaccess files, where essentially every RewriteDriver will be a custom driver. To resolve this we need to make a comparator for RewriteOptions so that we can determine option-equivalence and, potentially, keep free-lists for each unique option-set.
Member net_instaweb::ServerContext::ShutDownDrivers ()
TODO(jmarantz): Change New*RewriteDriver() calls to return NULL when run after shutdown. This requires changing call-sites to null-check their drivers and gracefully fail.
Member net_instaweb::spriter::ImageLibraryInterface::FilePath
TODO(skerner): Chromium's base lib has a class FilePath that handles paths in a cross-platform way. Use it.
Class net_instaweb::StaticAssetManager

TODO(ksimbili): Refactor out the common base class to serve the static files of type css, images or html etc.

TODO(xqyin): Refactor out StaticAssetManager to have shared infrastructure used by both RewriteStaticAssetManager and SystemStaticAssetManager. Now the JS files in system/ are done directly in AdminSite.

Class net_instaweb::StringAsyncFetch
TODO(jmarantz): move StringAsyncFetch into its own file.
Member net_instaweb::SystemRewriteDriverFactory::SetupMessageHandlers ()
TODO(jefftk): create SystemMessageHandler and get rid of these hooks.
Member net_instaweb::SystemServerContext::AddHtmlRewriteTimeUs (int64 rewrite_time_us)
TODO(sligocki): Remove in favor of RewriteStats::rewrite_latency_histogram.
Member net_instaweb::SystemServerContext::FlushCacheIfNecessary ()
TODO(jmarantz): allow a URL-based mechanism to flush cache, even if we implement it by simply writing the cache.flush file so other servers can see it. Note that using shared-memory is not a great plan because we need the cache-invalidation to persist across server restart.
Member net_instaweb::UrlAsyncFetcher::Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)=0

TODO(sligocki): GoogleString -> GoogleUrl or at least StringPiece.

TODO(sligocki): Include the URL in the fetch, like the request headers.

Class net_instaweb::UrlLeftTrimFilter
TODO(jmaessen): Do we care to introduce ../ in order to relativize more urls? For example, if base URL is http://www.example.com/foo/bar/index.html we could convert: http://www.example.com/foo/other.html -> ../other.html rather than -> /foo/other.html.