Page Speed Optimization Libraries  1.7.30.3
net/instaweb/rewriter/public/google_font_service_input_resource.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2013 Google Inc.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http:///www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00026 
00027 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
00028 #define NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
00029 
00030 #include "net/instaweb/http/public/request_context.h"
00031 #include "net/instaweb/rewriter/public/cacheable_resource_base.h"
00032 #include "pagespeed/kernel/base/basictypes.h"
00033 #include "pagespeed/kernel/base/string.h"
00034 #include "pagespeed/kernel/base/string_util.h"
00035 
00036 namespace net_instaweb {
00037 
00038 class GoogleUrl;
00039 class RequestHeaders;
00040 class ResponseHeaders;
00041 class RewriteDriver;
00042 class Statistics;
00043 
00044 class GoogleFontServiceInputResource : public CacheableResourceBase {
00045  public:
00047   static GoogleFontServiceInputResource* Make(const GoogleUrl& url,
00048                                               RewriteDriver* rewrite_driver);
00049   virtual ~GoogleFontServiceInputResource();
00050 
00051   static void InitStats(Statistics* stats);
00052 
00053  protected:
00055   virtual void PrepareRequest(const RequestContextPtr& request_context,
00056                               RequestHeaders* headers);
00057   virtual void PrepareResponseHeaders(ResponseHeaders* headers);
00058 
00059  private:
00060   GoogleFontServiceInputResource(RewriteDriver* rewrite_driver,
00061                                  bool is_https,
00062                                  const StringPiece& url,
00063                                  const StringPiece& cache_key,
00064                                  const GoogleString& user_agent);
00065   GoogleString user_agent_;
00066   bool is_https_;
00067 
00068   DISALLOW_COPY_AND_ASSIGN(GoogleFontServiceInputResource);
00069 };
00070 
00071 }  
00072 
00073 #endif  ///< NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines