Page Speed Optimization Libraries  1.7.30.1
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 RequestHeaders;
00039 class ResponseHeaders;
00040 class RewriteDriver;
00041 class Statistics;
00042 
00043 class GoogleFontServiceInputResource : public CacheableResourceBase {
00044  public:
00046   static GoogleFontServiceInputResource* Make(const StringPiece& url,
00047                                               RewriteDriver* rewrite_driver);
00048   virtual ~GoogleFontServiceInputResource();
00049 
00050   static void InitStats(Statistics* stats);
00051 
00052  protected:
00054   virtual void PrepareRequest(const RequestContextPtr& request_context,
00055                               RequestHeaders* headers);
00056   virtual void PrepareResponseHeaders(ResponseHeaders* headers);
00057 
00058  private:
00059   GoogleFontServiceInputResource(RewriteDriver* rewrite_driver,
00060                                  bool is_https,
00061                                  const StringPiece& url,
00062                                  const StringPiece& cache_key,
00063                                  const GoogleString& user_agent);
00064   GoogleString user_agent_;
00065   bool is_https_;
00066 
00067   DISALLOW_COPY_AND_ASSIGN(GoogleFontServiceInputResource);
00068 };
00069 
00070 }  
00071 
00072 #endif  ///< NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines