Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rewrite_filter.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 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_REWRITE_FILTER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_REWRITE_FILTER_H_
21 
32 
33 namespace net_instaweb {
34 
35 class RewriteFilter : public CommonFilter {
36  public:
37  explicit RewriteFilter(RewriteDriver* driver)
38  : CommonFilter(driver) {
39  }
40  virtual ~RewriteFilter();
41 
42  virtual const char* id() const = 0;
43 
48  virtual void DetermineEnabled(GoogleString* disabled_reason);
49 
53  virtual bool CanModifyUrls() { return true; }
54 
59  virtual const UrlSegmentEncoder* encoder() const;
60 
67  virtual bool ComputeOnTheFly() const;
68 
73 
78  RewriteContext* parent, const ResourceSlotPtr& slot);
79 
84  ResourceContext* context) const {}
85 
98  static StringPiece GetCharsetForScript(const Resource* script,
99  const StringPiece attribute_charset,
100  const StringPiece enclosing_charset);
101 
115  const Resource* stylesheet,
116  const StringPiece attribute_charset,
117  const StringPiece enclosing_charset);
118 
134  virtual const RewriteOptions::Filter* RelatedFilters(int* num_filters) const;
135 
139  virtual const StringPieceVector* RelatedOptions() const {
140  return NULL;
141  }
142 
143  protected:
145  virtual const char* LoggingId() { return id(); }
146 
147  private:
152  virtual bool UsesPropertyCacheDomCohort() const { return false; }
153 
154 
155 };
156 
157 }
158 
159 #endif
Definition: common_filter.h:47
virtual const UrlSegmentEncoder * encoder() const
virtual const StringPieceVector * RelatedOptions() const
Definition: rewrite_filter.h:139
virtual void DetermineEnabled(GoogleString *disabled_reason)
static StringPiece GetCharsetForScript(const Resource *script, const StringPiece attribute_charset, const StringPiece enclosing_charset)
Definition: resource.h:57
Definition: ref_counted_ptr.h:69
virtual bool CanModifyUrls()
Definition: rewrite_filter.h:53
static GoogleString GetCharsetForStylesheet(const Resource *stylesheet, const StringPiece attribute_charset, const StringPiece enclosing_charset)
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void EncodeUserAgentIntoResourceContext(ResourceContext *context) const
Definition: rewrite_filter.h:83
Definition: rewrite_filter.h:35
virtual bool ComputeOnTheFly() const
Filter
Definition: rewrite_options.h:106
Definition: rewrite_driver.h:100
virtual const char * LoggingId()
This class logs using id().
Definition: rewrite_filter.h:145
Definition: rewrite_context.h:155
Definition: url_segment_encoder.h:33
virtual const RewriteOptions::Filter * RelatedFilters(int *num_filters) const
virtual RewriteContext * MakeRewriteContext()
virtual RewriteContext * MakeNestedRewriteContext(RewriteContext *parent, const ResourceSlotPtr &slot)