Page Speed Optimization Libraries  1.2.24.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions
net_instaweb::RequestContext Class Reference

#include "request_context.h"

Inheritance diagram for net_instaweb::RequestContext:
net_instaweb::RefCounted< RequestContext > RefCountedThreadSafe

List of all members.

Public Member Functions

 RequestContext (AbstractMutex *logging_mutex)
RequestTracetrace_context ()
 The trace context. Takes ownership of the given context.
void set_trace_context (RequestTrace *x)
LogRecordlog_record ()
 The log record for the this request, created when the request context is.

Static Public Member Functions

static RequestContextPtr NewTestRequestContext (ThreadSystem *thread_system)

Protected Member Functions

 RequestContext ()
void set_log_record (LogRecord *l)
virtual ~RequestContext ()
 Destructors in refcounted classes should be protected.
 REFCOUNT_FRIEND_DECLARATION (RequestContext)

Detailed Description

A class which wraps state associated with a request.

This object should be reference counted, wrapped in a RequestContextPtr. We use reference counting because, depending on the timing of asynchronous rewrites, RPC calls, and so on, a RequestContext may outlive the original HTTP request serving, or not. Reference counting avoids the complexity of explicit transfer of ownership in these cases.


Constructor & Destructor Documentation

|logging_mutex| will be passed to the request context's LogRecord, which will take ownership of it. If you will be doing logging in a real (threaded) environment, pass in a real mutex. If not, a NullMutex is fine.

The default constructor will not create a LogRecord. Subclass constructors must do this explicitly.


Member Function Documentation

Todo:
TODO(marq): Move this test context factory to a test-specific file. Makes a request context for running tests.

The log record can only be set once. This should only be used by a subclass during initialization.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines