Index: net/http/http_cache_lookup_manager.h |
diff --git a/net/http/http_cache_lookup_manager.h b/net/http/http_cache_lookup_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0fb07dd25362ad8f6d016ca06254dcbd76ec264c |
--- /dev/null |
+++ b/net/http/http_cache_lookup_manager.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_HTTP_CACHE_LOOKUP_MANAGER_H_ |
+#define NET_HTTP_CACHE_LOOKUP_MANAGER_H_ |
+ |
+#include "net/base/net_export.h" |
+#include "net/http/http_cache.h" |
+#include "net/http/http_cache_transaction.h" |
+#include "net/spdy/server_push_delegate.h" |
+ |
+namespace net { |
+ |
+class NET_EXPORT_PRIVATE HttpCacheLookupManager : public ServerPushDelegate { |
Ryan Hamilton
2016/11/15 23:16:06
Class comment, please.
Zhongyi Shi
2016/11/16 21:04:42
Done.
|
+ public: |
+ explicit HttpCacheLookupManager(HttpCache* http_cache, |
Ryan Hamilton
2016/11/15 23:16:06
Can you comment on the lifetime of |http_cache|.
Zhongyi Shi
2016/11/16 21:04:43
Done.
|
+ const NetLogWithSource& net_log); |
Ryan Hamilton
2016/11/15 23:16:06
nit: no need for explicit.
Zhongyi Shi
2016/11/16 21:04:43
Done.
|
+ ~HttpCacheLookupManager() override; |
+ |
+ void OnPush(std::unique_ptr<ServerPushHelper> push_helper) override; |
+ |
+ void OnPushFilteringComplete(const GURL& url, int rv); |
Ryan Hamilton
2016/11/15 23:16:06
Comment.
Zhongyi Shi
2016/11/16 21:04:43
Done.
|
+ |
+ private: |
+ struct LookupTransaction { |
Ryan Hamilton
2016/11/15 23:16:06
comment.
Zhongyi Shi
2016/11/16 21:04:43
Done.
|
+ explicit LookupTransaction(std::unique_ptr<ServerPushHelper> push_helper); |
+ ~LookupTransaction(); |
+ |
+ std::unique_ptr<ServerPushHelper> push_helper; |
+ std::unique_ptr<HttpRequestInfo> request; |
+ std::unique_ptr<HttpTransaction> transaction; |
+ }; |
+ |
+ NetLogWithSource net_log_; |
+ // HttpCache must outlive the HttpCacheLookupManager. |
+ HttpCache* http_cache_; |
+ std::map<GURL, std::unique_ptr<LookupTransaction>> lookup_transactions_; |
+ base::WeakPtrFactory<HttpCacheLookupManager> weak_factory_; |
+}; |
+ |
+} // namespace net |
+ |
+#endif // NET_HTTP_CACHE_LOOKUP_MANAGER_H_ |