Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
google_font_service_input_resource.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 
26 
27 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
28 #define NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
29 
30 #include "net/instaweb/http/public/request_context.h"
35 
36 namespace net_instaweb {
37 
38 class GoogleUrl;
39 class RequestHeaders;
40 class ResponseHeaders;
41 class RewriteDriver;
42 class Statistics;
43 
45  public:
48  RewriteDriver* rewrite_driver);
50  static void InitStats(Statistics* stats);
51 
53  static bool IsFontServiceUrl(const GoogleUrl& url);
54 
55  protected:
57  virtual void PrepareRequest(const RequestContextPtr& request_context,
58  RequestHeaders* headers);
59  virtual void PrepareResponseHeaders(ResponseHeaders* headers);
60 
61  private:
63  bool is_https,
64  const StringPiece& url,
65  const StringPiece& cache_key,
66  const GoogleString& user_agent);
67  GoogleString user_agent_;
68  bool is_https_;
69 
70 
71 };
72 
73 }
74 
75 #endif
class GoogleUrl
Definition: google_url.h:58
static bool IsFontServiceUrl(const GoogleUrl &url)
Returns true if the URL looks like one from font service.
virtual void PrepareRequest(const RequestContextPtr &request_context, RequestHeaders *headers)
Overrides of CacheableResourceBase API.
Read/write API for HTTP request (RequestHeaders is a misnomer).
Definition: request_headers.h:32
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
Read/write API for HTTP response headers.
Definition: response_headers.h:37
static GoogleFontServiceInputResource * Make(const GoogleUrl &url, RewriteDriver *rewrite_driver)
Returns NULL if not recognized as a valid font service URL.
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
virtual void PrepareResponseHeaders(ResponseHeaders *headers)
Definition: rewrite_driver.h:100
Definition: google_font_service_input_resource.h:44
Definition: cacheable_resource_base.h:50
virtual GoogleString cache_key() const
Definition: cacheable_resource_base.h:67
virtual GoogleString url() const
Gets the absolute URL of the resource.
Definition: cacheable_resource_base.h:66