Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
css_image_rewriter.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_CSS_IMAGE_REWRITER_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_CSS_IMAGE_REWRITER_H_
21 
22 #include <cstddef>
23 
31 
32 namespace Css {
33 
34 class Values;
35 
36 }
37 
38 namespace net_instaweb {
39 
40 class CacheExtender;
41 class ImageCombineFilter;
42 class ImageRewriteFilter;
43 class MessageHandler;
44 class Statistics;
45 
47  public:
49  CssFilter* filter,
50  CacheExtender* cache_extender,
51  ImageRewriteFilter* image_rewriter,
52  ImageCombineFilter* image_combiner);
54 
55  static void InitStats(Statistics* statistics);
56 
61  bool RewriteCss(int64 image_inline_max_bytes,
62  RewriteContext* parent,
63  CssHierarchy* hierarchy,
64  MessageHandler* handler);
65 
67  bool FlatteningEnabled() const;
68 
70  bool RewritesEnabled(int64 image_inline_max_bytes) const;
71 
74  void RewriteSlot(const ResourceSlotPtr& slot,
75  int64 image_inline_max_bytes,
76  RewriteContext* parent);
77 
80  static void InheritChildImageInfo(RewriteContext* context);
81 
82  private:
83  RewriteDriver* driver() const {
84  return filter_->driver();
85  }
86  bool RewriteImport(RewriteContext* parent, CssHierarchy* hierarchy,
87  bool* is_authorized);
88  bool RewriteImage(int64 image_inline_max_bytes, const GoogleUrl& trim_url,
89  const GoogleUrl& original_url, RewriteContext* parent,
90  Css::Values* values, size_t value_index,
91  bool* is_authorized);
92 
94  CssFilter* filter_;
95 
97  CssFilter::Context* root_context_;
98 
102  CacheExtender* cache_extender_;
103  ImageCombineFilter* image_combiner_;
104  ImageRewriteFilter* image_rewriter_;
105 
106 
107 };
108 
109 }
110 
111 #endif
class GoogleUrl
Definition: google_url.h:58
Context used by CssFilter under async flow.
Definition: css_filter.h:251
bool RewriteCss(int64 image_inline_max_bytes, RewriteContext *parent, CssHierarchy *hierarchy, MessageHandler *handler)
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
Definition: css_hierarchy.h:64
Definition: ref_counted_ptr.h:69
void RewriteSlot(const ResourceSlotPtr &slot, int64 image_inline_max_bytes, RewriteContext *parent)
bool RewritesEnabled(int64 image_inline_max_bytes) const
Are any rewrites enabled?
Definition: rewrite_driver.h:100
Definition: rewrite_context.h:155
Definition: image_rewrite_filter.h:64
Definition: css_image_rewriter.h:46
Definition: message_handler.h:39
Definition: image_combine_filter.h:58
static void InheritChildImageInfo(RewriteContext *context)
Definition: cache_extender.h:49
Definition: css_filter.h:74
bool FlatteningEnabled() const
Is flattening enabled?