Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
static_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 PAGESPEED_AUTOMATIC_STATIC_REWRITER_H_
20 #define PAGESPEED_AUTOMATIC_STATIC_REWRITER_H_
21 
29 
30 namespace net_instaweb {
31 
32 class FileSystem;
33 class Hasher;
34 class MessageHandler;
35 class NamedLockManager;
36 class ProcessContext;
37 class RewriteOptions;
38 class ServerContext;
39 class UrlAsyncFetcher;
40 
48  public:
49  FileRewriter(const ProcessContext& process_context,
50  const RewriteGflags* gflags,
51  bool echo_errors_to_stdout);
52  virtual ~FileRewriter();
55  virtual Hasher* NewHasher();
57  virtual MessageHandler* DefaultHtmlParseMessageHandler();
58  virtual MessageHandler* DefaultMessageHandler();
59  virtual FileSystem* DefaultFileSystem();
60  virtual void SetupCaches(ServerContext* server_context);
61  virtual Statistics* statistics();
64  virtual bool UseBeaconResultsInFilters() const { return false; }
65 
66  private:
67  const RewriteGflags* gflags_;
68  SimpleStats simple_stats_;
69  bool echo_errors_to_stdout_;
70 
71 
72 };
73 
77  public:
78  StaticRewriter(const ProcessContext& process_context,
79  int* argc, char*** argv);
80  explicit StaticRewriter(const ProcessContext& process_context);
81  ~StaticRewriter();
82 
83  bool ParseText(const StringPiece& text,
84  const StringPiece& url,
85  const StringPiece& id,
86  const StringPiece& output_dir,
87  Writer* writer);
88 
89  FileSystem* file_system();
90  MessageHandler* message_handler();
91 
92  private:
93  RewriteGflags gflags_;
94  FileRewriter file_rewriter_;
95  ServerContext* server_context_;
96 
97 
98 };
99 
100 }
101 
102 #endif
virtual RewriteOptions * NewRewriteOptions()
Definition: static_rewriter.h:76
Definition: named_lock_manager.h:82
virtual void SetupCaches(ServerContext *server_context)
virtual UrlAsyncFetcher * DefaultAsyncUrlFetcher()
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
virtual NamedLockManager * DefaultLockManager()
Definition: static_rewriter.h:47
Simple name/value pair statistics implementation.
Definition: simple_stats.h:55
virtual ServerContext * NewServerContext()
Definition: rewrite_gflags.h:32
Definition: file_system.h:76
Interface for writing bytes to an output stream.
Definition: writer.h:29
Definition: server_context.h:99
Definition: process_context.h:35
virtual ServerContext * NewDecodingServerContext()
virtual bool UseBeaconResultsInFilters() const
Definition: static_rewriter.h:64
Definition: message_handler.h:39
Definition: rewrite_options.h:84
Definition: hasher.h:30
Definition: url_async_fetcher.h:33
Definition: rewrite_driver_factory.h:70