Page Speed Optimization Libraries  1.6.29.3
net/instaweb/rewriter/public/split_html_config.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 
00018 
00019 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_SPLIT_HTML_CONFIG_H_
00020 #define NET_INSTAWEB_REWRITER_PUBLIC_SPLIT_HTML_CONFIG_H_
00021 
00022 #include <map>
00023 #include <vector>
00024 
00025 #include "net/instaweb/util/public/basictypes.h"
00026 #include "net/instaweb/util/public/string.h"
00027 
00028 namespace net_instaweb {
00029 
00030 class CriticalLineInfo;
00031 class Panel;
00032 class RewriteDriver;
00033 
00034 struct XpathUnit {
00035   XpathUnit() : child_number(0) {}
00036 
00037   GoogleString tag_name;
00038   GoogleString attribute_value;
00039   int child_number;
00040 };
00041 
00042 typedef std::map<GoogleString, const Panel*> PanelIdToSpecMap;
00043 typedef std::vector<XpathUnit> XpathUnits;
00045 typedef std::map<GoogleString, XpathUnits*> XpathMap;
00046 
00049 class SplitHtmlConfig {
00050  public:
00054   explicit SplitHtmlConfig(RewriteDriver* driver);
00055   ~SplitHtmlConfig();
00056 
00058   static void Initialize();
00059   static void Terminate();
00060 
00061   const CriticalLineInfo* critical_line_info() {
00062     return critical_line_info_;
00063   }
00064 
00067   static void UpdateCriticalLineInfoInDriver(RewriteDriver* driver);
00068 
00069   XpathMap* xpath_map() { return &xpath_map_; }
00070   PanelIdToSpecMap* panel_id_to_spec() { return &panel_id_to_spec_; }
00071 
00072  private:
00073   const CriticalLineInfo* critical_line_info_; 
00074 
00076   XpathMap xpath_map_;
00077 
00080   PanelIdToSpecMap panel_id_to_spec_;
00081 
00082   DISALLOW_COPY_AND_ASSIGN(SplitHtmlConfig);
00083 };
00084 
00085 }  
00086 
00087 #endif  ///< NET_INSTAWEB_REWRITER_PUBLIC_SPLIT_HTML_CONFIG_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines