22 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_OUTPUT_RESOURCE_H_
23 #define NET_INSTAWEB_REWRITER_PUBLIC_OUTPUT_RESOURCE_H_
25 #include "base/logging.h"
26 #include "net/instaweb/http/public/request_context.h"
35 namespace net_instaweb {
56 StringPiece unmapped_base,
57 StringPiece original_base,
114 const GoogleString& unmapped_base()
const {
return unmapped_base_; }
115 const GoogleString& original_base()
const {
return original_base_; }
116 const ResourceNamer& full_name()
const {
return full_name_; }
117 ResourceNamer* mutable_full_name() {
return &full_name_; }
118 StringPiece name()
const {
return full_name_.name(); }
119 StringPiece experiment()
const {
return full_name_.experiment(); }
120 StringPiece suffix()
const;
121 StringPiece filter_prefix()
const {
return full_name_.
id(); }
122 StringPiece hash()
const {
return full_name_.hash(); }
123 StringPiece signature()
const {
return full_name_.signature(); }
124 bool has_hash()
const {
return !hash().empty(); }
127 computed_url_.clear();
176 void clear_cached_result();
181 clear_cached_result();
191 return rewrite_options_;
197 Writer*
BeginWrite(MessageHandler* message_handler);
198 void EndWrite(MessageHandler* message_handler);
206 return cache_control_suffix_;
209 DCHECK(cache_control_suffix_.empty());
210 cache_control_suffix_ = x;
218 friend class RewriteDriver;
219 friend class ServerContext;
220 friend class ServerContextTest;
222 void SetHash(StringPiece hash);
223 StringPiece extension()
const {
return full_name_.ext(); }
225 bool CheckSignature();
230 bool writing_complete_;
238 bool cached_result_owned_;
239 CachedResult* cached_result_;
265 ResourceNamer full_name_;
270 const RewriteOptions* rewrite_options_;
const GoogleString & resolved_base() const
output-specific
Definition: output_resource.h:113
virtual GoogleString name_key() const
Writer * BeginWrite(MessageHandler *message_handler)
void UpdateCachedResultPreservingInputInfo(CachedResult *to_update) const
CachedResult * EnsureCachedResultCreated()
void SetWritten(bool written)
This is called by CacheCallback::Done in rewrite_driver.cc.
Definition: output_resource.h:188
StringPiece id() const
Simple getters.
Definition: resource_namer.h:72
void set_cached_result(CachedResult *cached_result)
Definition: output_resource.h:180
Definition: resource.h:217
GoogleString UrlEvenIfHashNotSet()
virtual bool UseHttpCache() const
Definition: output_resource.h:200
Definition: resource.h:57
NotCacheablePolicy
Definition: resource.h:68
GoogleString decoded_base() const
virtual void SetType(const ContentType *type)
Sets the type of the output resource, and thus also its suffix.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual GoogleString url() const
OutputResource(const RewriteDriver *driver, StringPiece resolved_base, StringPiece unmapped_base, StringPiece original_base, const ResourceNamer &resource_id, OutputResourceKind kind)
GoogleString HttpCacheKey() const
Definition: rewrite_driver.h:100
Definition: content_type.h:31
void ClearHash()
Other setter-like operations.
Definition: resource_namer.h:98
void DumpToDisk(MessageHandler *handler)
Definition: message_handler.h:39
const GoogleString & cache_control_suffix() const
Definition: output_resource.h:205
Definition: output_resource.h:44
const CachedResult * cached_result() const
Definition: output_resource.h:165
bool IsWritten() const
Definition: output_resource.h:148
Definition: rewrite_options.h:84
virtual void LoadAndCallback(NotCacheablePolicy not_cacheable_policy, const RequestContextPtr &request_context, AsyncCallback *callback)
Definition: resource_namer.h:32
OutputResourceKind
Definition: output_resource_kind.h:26