Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
single_rewrite_context.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SINGLE_REWRITE_CONTEXT_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_SINGLE_REWRITE_CONTEXT_H_
21 
26 
27 namespace net_instaweb {
28 
29 class CachedResult;
30 class OutputPartitions;
31 class ResourceContext;
32 class RewriteDriver;
33 
37  public:
41  ResourceContext* resource_context);
42  virtual ~SingleRewriteContext();
43 
44  protected:
46  virtual void RewriteSingle(const ResourcePtr& input,
47  const OutputResourcePtr& output) = 0;
48 
50  virtual bool Partition(OutputPartitions* partitions,
51  OutputResourceVector* outputs);
52  virtual void Rewrite(int partition_index,
53  CachedResult* partition,
54  const OutputResourcePtr& output);
55 
57  void AddLinkRelCanonical(const ResourcePtr& input,
58  ResponseHeaders* output);
59 
62 
63  private:
64 
65 };
66 
67 }
68 
69 #endif
RewriteContext * parent()
Allows a nested rewriter to walk up its parent hierarchy.
Definition: rewrite_context.h:280
virtual void Rewrite(int partition_index, CachedResult *partition, const OutputResourcePtr &output)
SingleRewriteContext(RewriteDriver *driver, RewriteContext *parent, ResourceContext *resource_context)
void AddLinkRelCanonical(const ResourcePtr &input, ResponseHeaders *output)
Adds a link: rel=canonical header pointing to the input URL as canonical.
Read/write API for HTTP response headers.
Definition: response_headers.h:37
virtual void RewriteSingle(const ResourcePtr &input, const OutputResourcePtr &output)=0
Subclasses of SingleRewriteContext must override this:
void AddLinkRelCanonicalForFallbackHeaders(ResponseHeaders *output)
Helper for using above in FixFetchFallbackHeaders()
Definition: rewrite_driver.h:100
Definition: rewrite_context.h:155
virtual bool Partition(OutputPartitions *partitions, OutputResourceVector *outputs)
SingleRewriteContext takes care of these methods from RewriteContext:
Definition: single_rewrite_context.h:36