Page Speed Optimization Libraries
1.7.30.4
|
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 static void InitStats(Statistics* stats); 00051 00053 static bool IsFontServiceUrl(const GoogleUrl& url); 00054 00055 protected: 00057 virtual void PrepareRequest(const RequestContextPtr& request_context, 00058 RequestHeaders* headers); 00059 virtual void PrepareResponseHeaders(ResponseHeaders* headers); 00060 00061 private: 00062 GoogleFontServiceInputResource(RewriteDriver* rewrite_driver, 00063 bool is_https, 00064 const StringPiece& url, 00065 const StringPiece& cache_key, 00066 const GoogleString& user_agent); 00067 GoogleString user_agent_; 00068 bool is_https_; 00069 00070 DISALLOW_COPY_AND_ASSIGN(GoogleFontServiceInputResource); 00071 }; 00072 00073 } 00074 00075 #endif ///< NET_INSTAWEB_REWRITER_PUBLIC_GOOGLE_FONT_SERVICE_INPUT_RESOURCE_H_