Page Speed Optimization Libraries  1.9.32.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
apache_request_context.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013 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 
22 
23 #ifndef NET_INSTAWEB_APACHE_APACHE_REQUEST_CONTEXT_H_
24 #define NET_INSTAWEB_APACHE_APACHE_REQUEST_CONTEXT_H_
25 
26 #include "base/logging.h"
29 
30 struct request_rec;
31 struct spdy_slave_connection_factory;
32 
33 namespace net_instaweb {
34 
35 class AbstractMutex;
36 class RequestContext;
37 class Timer;
38 
40  public:
45  AbstractMutex* logging_mutex, Timer* timer, request_rec* req);
46 
50 
53  void SetupSpdyConnectionIfNeeded(request_rec* req);
54 
55  bool use_spdy_fetcher() const { return use_spdy_fetcher_; }
56  spdy_slave_connection_factory* spdy_connection_factory() {
57  DCHECK(!use_spdy_fetcher_ || (spdy_connection_factory_ != NULL))
58  << "Must call SetupSpdyConnectionIfNeeded before fetching";
59  return spdy_connection_factory_;
60  }
61 
62  protected:
63  virtual ~ApacheRequestContext();
64 
65  private:
66  bool use_spdy_fetcher_;
67  spdy_slave_connection_factory* spdy_connection_factory_;
68 
69  DISALLOW_COPY_AND_ASSIGN(ApacheRequestContext);
70 };
71 
72 }
73 
74 #endif
Definition: request_context.h:50
static ApacheRequestContext * DynamicCast(RequestContext *rc)
Definition: system_request_context.h:35
ApacheRequestContext(AbstractMutex *logging_mutex, Timer *timer, request_rec *req)
void SetupSpdyConnectionIfNeeded(request_rec *req)
Definition: apache_request_context.h:39