Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: components/precache/core/fetcher_pool.h

Issue 2119673002: Precache manifest should not be added to fetcher pool which is full (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/precache/core/precache_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/precache/core/fetcher_pool.h
diff --git a/components/precache/core/fetcher_pool.h b/components/precache/core/fetcher_pool.h
index 1a9cd1cd73c96845a67dce24343cefa6545dfd20..a4c9579b6cf49e8228958123dbc1d6c5549689c6 100644
--- a/components/precache/core/fetcher_pool.h
+++ b/components/precache/core/fetcher_pool.h
@@ -8,6 +8,7 @@
#include <memory>
#include <unordered_map>
+#include "base/gtest_prod_util.h"
#include "base/logging.h"
namespace precache {
@@ -67,6 +68,9 @@ class FetcherPool {
// Returns true iff the pool can accept a new element.
bool IsAvailable() const { return max_size_ > elements_.size(); }
+ // Returns the maximum size of the pool.
+ size_t max_size() const { return max_size_; }
+
private:
const size_t max_size_;
std::unordered_map<const T*, std::unique_ptr<T>> elements_;
« no previous file with comments | « no previous file | components/precache/core/precache_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698