Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_HTTP_CACHE_LOOKUP_MANAGER_H_ | |
| 6 #define NET_HTTP_CACHE_LOOKUP_MANAGER_H_ | |
| 7 | |
| 8 #include "net/base/net_export.h" | |
| 9 #include "net/http/http_cache.h" | |
| 10 #include "net/http/http_cache_transaction.h" | |
| 11 #include "net/spdy/server_push_delegate.h" | |
| 12 | |
| 13 namespace net { | |
| 14 | |
| 15 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.
| |
| 16 public: | |
| 17 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.
| |
| 18 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.
| |
| 19 ~HttpCacheLookupManager() override; | |
| 20 | |
| 21 void OnPush(std::unique_ptr<ServerPushHelper> push_helper) override; | |
| 22 | |
| 23 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.
| |
| 24 | |
| 25 private: | |
| 26 struct LookupTransaction { | |
|
Ryan Hamilton
2016/11/15 23:16:06
comment.
Zhongyi Shi
2016/11/16 21:04:43
Done.
| |
| 27 explicit LookupTransaction(std::unique_ptr<ServerPushHelper> push_helper); | |
| 28 ~LookupTransaction(); | |
| 29 | |
| 30 std::unique_ptr<ServerPushHelper> push_helper; | |
| 31 std::unique_ptr<HttpRequestInfo> request; | |
| 32 std::unique_ptr<HttpTransaction> transaction; | |
| 33 }; | |
| 34 | |
| 35 NetLogWithSource net_log_; | |
| 36 // HttpCache must outlive the HttpCacheLookupManager. | |
| 37 HttpCache* http_cache_; | |
| 38 std::map<GURL, std::unique_ptr<LookupTransaction>> lookup_transactions_; | |
| 39 base::WeakPtrFactory<HttpCacheLookupManager> weak_factory_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace net | |
| 43 | |
| 44 #endif // NET_HTTP_CACHE_LOOKUP_MANAGER_H_ | |
| OLD | NEW |