Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
beacon_critical_line_info_finder.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 
21 
22 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_BEACON_CRITICAL_LINE_INFO_FINDER_H_
23 #define NET_INSTAWEB_REWRITER_PUBLIC_BEACON_CRITICAL_LINE_INFO_FINDER_H_
24 
26 
28 #include "net/instaweb/util/public/property_cache.h"
29 #include "pagespeed/kernel/base/basictypes.h"
30 #include "pagespeed/kernel/base/string_util.h"
31 
32 namespace net_instaweb {
33 
34 class MessageHandler;
35 class NonceGenerator;
36 class RewriteDriver;
37 class Timer;
38 
60  public:
61  static const char kBeaconCriticalLineInfoPropertyName[];
62 
63  BeaconCriticalLineInfoFinder(const PropertyCache::Cohort* cohort,
64  NonceGenerator* nonce_generator);
66 
68 
73  const StringSet& xpaths_set, StringPiece nonce,
74  const PropertyCache* cache, const PropertyCache::Cohort* cohort,
75  AbstractPropertyPage* page, MessageHandler* message_handler,
76  Timer* timer);
77 
78  protected:
80  virtual void UpdateInDriver(RewriteDriver* driver);
81 
82  private:
83  static const int kDefaultSupportInterval = 10;
84 
85  virtual int SupportInterval() const { return kDefaultSupportInterval; }
86 
87  NonceGenerator* nonce_generator_;
88  DISALLOW_COPY_AND_ASSIGN(BeaconCriticalLineInfoFinder);
89 };
90 
91 }
92 
93 #endif
virtual void UpdateInDriver(RewriteDriver *driver)
Updates the critical line information in the driver.
virtual BeaconMetadata PrepareForBeaconInsertion(RewriteDriver *driver)
Definition: critical_finder_support_util.h:78
Definition: beacon_critical_line_info_finder.h:59
Definition: rewrite_driver.h:98
static void WriteXPathsToPropertyCacheFromBeacon(const StringSet &xpaths_set, StringPiece nonce, const PropertyCache *cache, const PropertyCache::Cohort *cohort, AbstractPropertyPage *page, MessageHandler *message_handler, Timer *timer)
Definition: critical_line_info_finder.h:37
const PropertyCache::Cohort * cohort() const
Returns the cohort in pcache which stores the critical line info.
Definition: critical_line_info_finder.h:45