Page Speed Optimization Libraries  1.11.33.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | List of all members
net_instaweb::StringAsyncFetch Class Reference

#include "async_fetch.h"

Inheritance diagram for net_instaweb::StringAsyncFetch:
net_instaweb::AsyncFetch net_instaweb::ExpectStringAsyncFetch net_instaweb::FetcherTest::CheckCallback

Public Member Functions

 StringAsyncFetch (const RequestContextPtr &request_ctx)
 
 StringAsyncFetch (const RequestContextPtr &request_ctx, GoogleString *buffer)
 
virtual bool HandleWrite (const StringPiece &content, MessageHandler *handler)
 
virtual bool HandleFlush (MessageHandler *handler)
 
virtual void HandleHeadersComplete ()
 
virtual void HandleDone (bool success)
 
bool success () const
 
bool done () const
 
const GoogleString & buffer () const
 
virtual void Reset ()
 
- Public Member Functions inherited from net_instaweb::AsyncFetch
 AsyncFetch (const RequestContextPtr &request_ctx)
 
void HeadersComplete ()
 
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
 
bool headers_complete () const
 
bool content_length_known () const
 
int64 content_length () const
 
void set_content_length (int64 x)
 
GoogleString LoggingString ()
 
virtual const RequestContextPtr & request_context ()
 
virtual AbstractLogRecord * log_record ()
 

Protected Member Functions

void set_success (bool success)
 
void set_done (bool done)
 

Additional Inherited Members

- Static Public Attributes inherited from net_instaweb::AsyncFetch
static const int kContentLengthUnknown = -1
 

Detailed Description

Class to represent an Async fetch that collects the response-data into a string, which can be accessed via buffer() and cleared via Reset().

Todo:
TODO(jmarantz): move StringAsyncFetch into its own file.

Member Function Documentation

virtual void net_instaweb::StringAsyncFetch::Reset ( )
inlinevirtual

Resets the 'headers_complete_' flag.

Todo:
TODO(jmarantz): should this also clear the response headers?

Reimplemented from net_instaweb::AsyncFetch.

void net_instaweb::StringAsyncFetch::set_success ( bool  success)
inlineprotected

For subclasses that need to use complex logic to set success_ and done_. Most subclasses should not need these.


The documentation for this class was generated from the following file: