Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
system_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 
21 
22 #ifndef PAGESPEED_SYSTEM_SYSTEM_REQUEST_CONTEXT_H_
23 #define PAGESPEED_SYSTEM_SYSTEM_REQUEST_CONTEXT_H_
24 
25 #include "net/instaweb/http/public/request_context.h"
29 
30 namespace net_instaweb {
31 
32 class AbstractMutex;
33 class Timer;
34 
36  public:
39  SystemRequestContext(AbstractMutex* logging_mutex,
40  Timer* timer,
41  StringPiece hostname,
42  int local_port,
43  StringPiece local_ip);
44 
47  void set_url(StringPiece url) { url.CopyToString(&url_); }
48 
52 
53  int local_port() const { return local_port_; }
54  const GoogleString& local_ip() const { return local_ip_; }
55  StringPiece url() const { return url_; }
56 
57  protected:
58  virtual ~SystemRequestContext() {}
59 
60  private:
61  int local_port_;
62  GoogleString local_ip_;
63  GoogleString url_;
64 
65 
66 };
67 
68 }
69 
70 #endif
Definition: request_context.h:51
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
void set_url(StringPiece url)
Definition: system_request_context.h:47
static SystemRequestContext * DynamicCast(RequestContext *rc)
Definition: system_request_context.h:35
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
SystemRequestContext(AbstractMutex *logging_mutex, Timer *timer, StringPiece hostname, int local_port, StringPiece local_ip)
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27