Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mod_spdy_fetcher.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 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 
21 
22 #ifndef NET_INSTAWEB_APACHE_MOD_SPDY_FETCHER_H_
23 #define NET_INSTAWEB_APACHE_MOD_SPDY_FETCHER_H_
24 
26 
27 #include "httpd.h"
28 
29 
31 #include "pagespeed/kernel/base/basictypes.h"
32 #include "pagespeed/kernel/base/string.h"
33 #include "pagespeed/kernel/base/string_util.h"
34 
35 struct request_rec;
36 struct spdy_slave_connection_factory;
37 
38 namespace net_instaweb {
39 
40 class AsyncFetch;
41 class MessageHandler;
42 class ModSpdyFetchController;
43 class RewriteDriver;
44 class Statistics;
45 
47  public:
49  StringPiece url, RewriteDriver* driver,
50  spdy_slave_connection_factory* connection_factory);
51  virtual ~ModSpdyFetcher();
52 
55  static void Initialize();
56 
58  static void InitStats(Statistics* statistics);
59 
60  virtual void Fetch(const GoogleString& url,
61  MessageHandler* message_handler,
62  AsyncFetch* fetch);
63 
66  static bool ShouldUseOn(request_rec* req);
67 
70 
71  private:
72  friend class ModSpdyFetchController;
73 
76  void BlockingFetch(const GoogleString& url,
77  ModSpdyFetchController* controller,
78  Statistics* stats,
79  MessageHandler* message_handler,
80  AsyncFetch* fetch);
81 
82  ModSpdyFetchController* controller_;
83  UrlAsyncFetcher* fallback_fetcher_;
84  Statistics* stats_;
85  GoogleString own_origin_;
86  spdy_slave_connection_factory* connection_factory_;
87 
88  DISALLOW_COPY_AND_ASSIGN(ModSpdyFetcher);
89 };
90 
91 }
92 
93 #endif
Definition: mod_spdy_fetch_controller.h:43
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
static void InitStats(Statistics *statistics)
This must be called for every statistics object in use before using this.
Definition: async_fetch.h:53
Definition: rewrite_driver.h:98
Definition: mod_spdy_fetcher.h:46
static bool ShouldUseOn(request_rec *req)
Definition: url_async_fetcher.h:33