18 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_DEPENDENCY_TRACKER_H_
19 #define NET_INSTAWEB_REWRITER_PUBLIC_DEPENDENCY_TRACKER_H_
23 #include "net/instaweb/rewriter/dependencies.pb.h"
27 #include "pagespeed/kernel/base/thread_annotations.h"
29 namespace net_instaweb {
76 const Dependencies*
read_in_info()
const {
return read_in_info_.get(); }
79 void Clear() LOCKS_EXCLUDED(mutex_);
80 void ClearLockHeld() EXCLUSIVE_LOCKS_REQUIRED(mutex_);
81 void WriteToPropertyCacheIfDone() EXCLUSIVE_LOCKS_REQUIRED(mutex_);
89 std::unique_ptr<Dependencies> read_in_info_;
93 std::map<
int, Dependency> computed_info_ GUARDED_BY(mutex_);
95 int next_id_ GUARDED_BY(mutex_);
96 int outstanding_candidates_ GUARDED_BY(mutex_);
100 bool saw_end_ GUARDED_BY(mutex_);
109 bool operator()(
const Dependency& a,
const Dependency& b);
void Start()
Must be called when parsing pages, after pcache has read in.
const Dependencies * read_in_info() const
This is temporary, nicer API coming later.
Definition: dependency_tracker.h:76
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
void ReportDependencyCandidate(int id, const Dependency *dep)
Compares two Dependency objects based on the order_key field.
Definition: dependency_tracker.h:107
Definition: rewrite_driver.h:100
Definition: server_context.h:99
void SetServerContext(ServerContext *server_context)
This needs to be called to help initialize locking.
DependencyTracker(RewriteDriver *driver)
Note: you must also call SetServerContext on this before operation.
Definition: dependency_tracker.h:41
int RegisterDependencyCandidate()