Page Speed Optimization Libraries 220.127.116.11
|AsyncFetch (const RequestContextPtr &request_ctx)|
|void||Done (bool success)|
|virtual bool||Write (const StringPiece &content, MessageHandler *handler)|
|virtual bool||Flush (MessageHandler *handler)|
|virtual bool||IsCachedResultValid (const ResponseHeaders &headers)|
|RequestHeaders *||request_headers ()|
|void||set_request_headers (RequestHeaders *headers)|
|void||SetRequestHeadersTakingOwnership (RequestHeaders *headers)|
|Same as above, but takes ownership. |
|const RequestHeaders *||request_headers () const|
|ResponseHeaders *||response_headers ()|
|See doc for request_headers and set_request_headers. |
|void||set_response_headers (ResponseHeaders *headers)|
|ResponseHeaders *||extra_response_headers ()|
|void||set_extra_response_headers (ResponseHeaders *headers)|
|virtual bool||IsBackgroundFetch () const|
|virtual void||Reset ()|
|bool||headers_complete () const|
|bool||content_length_known () const|
|int64||content_length () const|
|void||set_content_length (int64 x)|
|virtual const RequestContextPtr &||request_context ()|
|virtual AbstractLogRecord *||log_record ()|
|Public Member Functions inherited from net_instaweb::Writer|
|virtual bool||Dump (Writer *writer, MessageHandler *message_handler)|
|static bool||IsGoogleCacheVia (StringPiece via_value)|
|static const int||kContentLengthUnknown = -1|
|virtual bool||HandleWrite (const StringPiece &sp, MessageHandler *handler)=0|
|virtual bool||HandleFlush (MessageHandler *handler)=0|
|virtual void||HandleDone (bool success)=0|
|virtual void||HandleHeadersComplete ()=0|
Abstract base class for encapsulating streaming, asynchronous HTTP fetches.
If you want to fetch a resources, implement this interface, create an instance and call UrlAsyncFetcher::Fetch() with it.
It combines the 3 callbacks we expect to get from fetchers (Write, Flush and Done) and adds a HeadersComplete indicator that is useful in any place where we want to deal with and send headers before Write or Done are called.
Note that it automatically invokes HeadersComplete before the first call to Write, Flush or Done.
Keep track of whether the content-length is known before the body is sent, so that a server can decide whether it needs chunked.
Note that this is not necessarily the same as the Content-Length attribute in the response-headers, which might reflect pre-optimized or pre-compressed sizes.
Fetch complete. This interface is intended for callers (e.g. Fetchers). Implementors must override HandleDone.
Returns extra response headers which may be modified between calls to HeadersComplete() and Done(). This is used to allow a fetch to provide additional headers which cannot be determined when HeadersComplete() has been invoked, e.g., X-Original-Content-Length. This is needed because it is not safe for the producer to modify response_headers() once HeadersComplete() has been called.
Determines whether the specified request-headers imply that the server is running in a context where an explicit cache-control "public" header is needed to make caching work, and adds that header if needed.
Called when ResponseHeaders have been set, but before writing contents. Contract: Must be called (at most once) before Write, Flush or Done. Automatically invoked (if neccessary) before the first call to Write, Flush, or Done. This interface is intended for callers (e.g. Fetchers). Implementors of the AsyncFetch interface must override HandleHeadersComplete.
Indicates whether the request is a background fetch. These can be scheduled differently by the fetcher.
Reimplemented in net_instaweb::SharedAsyncFetch.
Is the cache entry corresponding to headers valid? Default is that it is valid. Sub-classes can provide specific implementations, e.g., based on cache invalidation timestamp in domain specific options. Used by CacheUrlAsyncFetcher.
Determines whether the specified via header value matches the expected pattern for the Via header provided by the Google Cloud CDN to services running inside it.
Returns a pointer to a log record that wraps this fetch's logging info.
Returns logging information in a string eg. c1:0;c2:2;hf:45;. c1 is cache 1, c2 is cache 2, hf is headers fetch.
Returns the request context associated with this fetch, if any, or NULL if no request context exists.
Reimplemented in net_instaweb::SharedAsyncFetch.
Returns a pointer to the request-headers, lazily constructing them if needed. If they are constructed here (as opposed to being set with set_request_headers) then they will be owned by the class instance.
|const RequestHeaders* net_instaweb::AsyncFetch::request_headers||(||)||const|
|void net_instaweb::AsyncFetch::set_request_headers||(||RequestHeaders *||headers||)|
Sets the request-headers to the specifid pointer. The caller must guarantee that the pointed-to headers remain valid as long as the AsyncFetch is running.
Does not take ownership of headers.
Data available. This interface is intended for callers. Implementors must override HandlerWrite and HandleFlush.