Page Speed Optimization Libraries
1.3.25.1
|
#include "url_partnership.h"
Public Member Functions | |
UrlPartnership (const RewriteDriver *driver) | |
bool | AddUrl (const StringPiece &resource_url, MessageHandler *handler) |
GoogleString | ResolvedBase () const |
int | num_urls () const |
Returns the number of URLs that have been successfully added. | |
GoogleString | RelativePath (int index) const |
const GoogleUrl * | FullPath (int index) const |
Returns the full resolved path. | |
void | RemoveLast () |
Removes the last URL that was added to the partnership. | |
virtual void | Reset (const GoogleUrl &original_request) |
int | NumCommonComponents () const |
Protected Member Functions | |
const RewriteOptions * | rewrite_options () const |
A URL partnership should be established in order to combine resources, such as in CSS combination, JS combination, or image spriting. This class centralizes the handling of such combinations, answering two questions: 1. Is it legal for a new URL to enter into the partnership 2. What is the greatest common prefix 3. What are the unique suffices for the elements.
bool net_instaweb::UrlPartnership::AddUrl | ( | const StringPiece & | resource_url, |
MessageHandler * | handler | ||
) |
Adds a URL to a combination. If it can be legally added, consulting the DomainLaywer, then true is returned.
int net_instaweb::UrlPartnership::NumCommonComponents | ( | ) | const [inline] |
Returns the number of common path components for all resources in this partnership.
GoogleString net_instaweb::UrlPartnership::RelativePath | ( | int | index | ) | const |
Returns the relative path of a particular URL that was added into the partnership. This requires that Resolve() be called first.
virtual void net_instaweb::UrlPartnership::Reset | ( | const GoogleUrl & | original_request | ) | [virtual] |
Establish a new URL as the original request, which is used for domain authorization and mapping of URLs as they are added to the partnership.
Computes the resolved base common to all URLs. This will always have a trailing slash.