19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_IN_PLACE_REWRITE_CONTEXT_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_IN_PLACE_REWRITE_CONTEXT_H_
39 namespace net_instaweb {
42 class CacheUrlAsyncFetcher;
46 class ResourceContext;
47 class ResponseHeaders;
58 static const char kIproSlotLocation[];
83 static const char kInPlaceUncacheableRewrites[];
92 virtual const char*
id()
const {
return RewriteOptions::kInPlaceRewriteId; }
98 GoogleUrlStarVector* url_vector);
102 static void InitStats(
Statistics* statistics);
104 bool proxy_mode()
const {
return proxy_mode_; }
105 void set_proxy_mode(
bool x) { proxy_mode_ = x; }
110 const ResourceContext* resource_context)
const;
125 bool PolicyPermitsRendering()
const override;
127 virtual void Harvest();
128 void StartFetchReconstructionParent();
130 virtual void FixFetchFallbackHeaders(
const CachedResult& cached_result,
134 const StringPiece& hash);
136 virtual void FetchCallbackDone(
bool success);
141 void UpdateDateAndExpiry(
const protobuf::RepeatedPtrField<InputInfo>& inputs,
142 int64* date_ms, int64* expiry_ms);
145 bool InPlaceOptimizeForBrowserEnabled()
const;
148 void AddVaryIfRequired(
const CachedResult& cached_result,
153 void RemoveRedundantRelCanonicalHeader(
const CachedResult& cached_result,
157 bool IsLoadFromFileBased();
194 int desired_s_maxage_sec,
211 bool CanInPlaceRewrite();
216 bool ShouldStream()
const;
227 int desired_s_maxage_sec_;
231 bool can_in_place_rewrite_;
238 Variable* in_place_oversized_opt_stream_;
239 Variable* in_place_uncacheable_rewrites_;
virtual int64 GetRewriteDeadlineAlarmMs() const
virtual void HandleDone(bool success)
Implements SharedAsyncFetch::HandleDone().
Definition: http_value.h:38
virtual bool HandleFlush(MessageHandler *handler)
Implements SharedAsyncFetch::HandleFlush().
Definition: statistics.h:43
virtual bool DecodeFetchUrls(const OutputResourcePtr &output_resource, MessageHandler *message_handler, GoogleUrlStarVector *url_vector)
Implements RewriteContext::DecodeFetchUrls().
virtual GoogleString LocationString() const
Implements ResourceSlot::LocationString().
bool ScheduleNestedContextViaCentalController() const override
Definition: in_place_rewrite_context.h:119
virtual GoogleString UserAgentCacheKey(const ResourceContext *resource_context) const
static const char kInPlaceOversizedOptStream[]
Definition: in_place_rewrite_context.h:82
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
Definition: resource_slot.h:54
Definition: html_element.h:42
Definition: in_place_rewrite_context.h:188
Definition: scoped_ptr.h:30
virtual OutputResourceKind kind() const
Implements RewriteContext::kind().
Definition: in_place_rewrite_context.h:94
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual const char * id() const
Implements RewriteContext::id().
Definition: in_place_rewrite_context.h:92
virtual bool CreationLockBeforeStartFetch() const
Definition: in_place_rewrite_context.h:115
Definition: async_fetch.h:278
Definition: async_fetch.h:53
Definition: rewrite_filter.h:35
virtual void StartFetchReconstruction()
Implements RewriteContext::StartFetchReconstruction().
Definition: rewrite_driver.h:100
Definition: content_type.h:31
Derived from some input resource URL or URLs.
Definition: output_resource_kind.h:27
Context that is used for an in-place rewrite.
Definition: in_place_rewrite_context.h:77
virtual void HandleHeadersComplete()
Implements SharedAsyncFetch::HandleHeadersComplete().
virtual bool HandleWrite(const StringPiece &content, MessageHandler *handler)
Implements SharedAsyncFetch::HandleWrite().
Definition: single_rewrite_context.h:36
virtual HtmlElement * element() const
Return HTML element associated with slot, or NULL if none (CSS, IPRO)
Definition: in_place_rewrite_context.h:61
Definition: message_handler.h:39
Definition: in_place_rewrite_context.h:56
virtual void EncodeUserAgentIntoResourceContext(ResourceContext *context)
virtual void Render()
Implements ResourceSlot::Render().
Definition: http_value_writer.h:33
OutputResourceKind
Definition: output_resource_kind.h:26
virtual void RewriteSingle(const ResourcePtr &input, const OutputResourcePtr &output)
Implements SingleRewriteContext::RewriteSingle().