Page Speed Optimization Libraries
1.13.35.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 |
Static Public Member Functions | |
static bool | FindResourceDomain (const GoogleUrl &base_url, const UrlNamer *url_namer, const RewriteOptions *rewrite_options, GoogleUrl *resource, GoogleString *domain, MessageHandler *handler) |
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:
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.
|
static |
Based on the UrlNamer and DomainLawyer, find the domain associated with a request, removing any proxy prefix that may have been added by the UrlNamer. The meaning of "associated" is defined by the UrlNamer implementation. *resource is also adjusted to the version that will be written out to the page.
|
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 |
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.
GoogleString net_instaweb::UrlPartnership::ResolvedBase | ( | ) | const |
Computes the resolved base common to all URLs. This will always have a trailing slash.